Stefan Motz
asked on
Export data to Excel from Classic ASP page
Hi Experts,
The query below returns data to my Classic ASP page from SQL Server database:
SELECT * FROM Complaints WHERE DateRcvd between '" & Request.Form("Date1") & "' AND '" & Request.Form("Date2") & "'
I would like to export the returned data from my web page to Excel by placing an "Export to Excel" text link on the page.
When users click the link an Excel sheets should open and get populated with the data that is already diplayed on the web page.
Is there a way this could be done by using JavaScript or any other method? I would appreciate your help.
The query below returns data to my Classic ASP page from SQL Server database:
SELECT * FROM Complaints WHERE DateRcvd between '" & Request.Form("Date1") & "' AND '" & Request.Form("Date2") & "'
I would like to export the returned data from my web page to Excel by placing an "Export to Excel" text link on the page.
When users click the link an Excel sheets should open and get populated with the data that is already diplayed on the web page.
Is there a way this could be done by using JavaScript or any other method? I would appreciate your help.
ASKER
Thank you for your quick response. Where do I have to place this code? Is this a separate page which is linked from my ASP page by the "Export to Excel" text link?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thank you very much; it's perfect!
Exactly what I needed.
Exactly what I needed.
Glad you got it worked out. Thanks for the points!
Open in new window