Solved

Display query result and export to excel using classic asp

Posted on 2011-09-12
5
276 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
5 Comments
 
LVL 32

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now