Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Display query result and export to excel using classic asp

Posted on 2011-09-12
5
Medium Priority
?
291 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 34

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

610 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