Solved

Display query result and export to excel using classic asp

Posted on 2011-09-12
5
286 Views
Last Modified: 2012-05-12
I want to give the option to export results from a query to excel after displaying the query results.

I know how to do it one separately, and I am assuming that I would have to either put the results of the query in a query string or a session and pass it to the export.asp page.
0
Comment
Question by:rschooff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 36525975
0
 
LVL 9

Expert Comment

by:djpazza
ID: 36529068
The easiest way is to add the attached code to the page that you want to output to excel.  So passing you query to the export page which you would design in an excel like simple format.  With the attached code the page result will open in excel.
<%
'Set content type to Excel so page will open in Excel
	Response.ContentType = "application/vnd.ms-excel"
%>

Open in new window

0
 

Author Comment

by:rschooff
ID: 36531293
I found my answer here. I already knew how to make it go straight to Excel, but I wanted the results listed first and then they could decide if they want to export to Excel.

This solution hides the sql string in a form and then submits it to a page that then has the code as above. ie set content type

http://bytes.com/topic/asp-classic/insights/706819-how-export-your-displayed-data-excel
0
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 37230420
Question PAQ'd and stored in the solution database.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question