Export ASP reports to Excel
Hi everyone,
I have been trying to export ASP reports to Excel format.
So I put this line on the top of my ASP page:
************************************************** *
Response.ContentType = "application/vnd.ms-excel"
************************************************** *
It did save my report to Excel file but it has no records in that excel file while it shows 50 records on my ASP report.
Here is my work environment:
I have 3 asp pages (search.asp, search_response.asp, search_excel_response).
On my search.asp page, I allow users to select the customers that they want to search for. As soon as they select a customer and click the SUBMIT button, it will take the users to the search_results.asp page and from there it will display a list of records based on the user's selection.
On this search_response.asp page, I put a button that links to search_excel_response.asp. This page looks exactly like the search_response.asp page except I added this line (Response.ContentType = "application/vnd.ms-excel") to the top of my page and hope that when the user click the button on Search_response.asp page, it would save this file to excel format.
Well, the truth is, it did save the file to excel format but it doesn't include any records in that excel file (I know for sure there are 50 records somewhere).
I did search goole.com for this problem but so far, I haven't found any solution. If someone has experienced this problem, please share.
Thanks for any input you might provide.
|