If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Export from ASP to Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-20-06, 19:41
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
Export from ASP to Excel

Hi all,

Can anyone tell me how to export data from ASP classic to excel?
Thanx
Appreciate your help
Reply With Quote
  #2 (permalink)  
Old 03-24-06, 09:53
cenvo cenvo is offline
Registered User
 
Join Date: Jul 2005
Posts: 2
A simpler way to achive this is to set content type to excel and output data in tabular format as below..
Code:
<%
	Response.ContentType = "application/vnd.ms-excel"
	Response.AddHeader "Content-Disposition","attachment; filename=export.xls" 
	Response.Write("<table border=1>")
	Response.Write("<tr><td>a</td><td>b</td><td>c</td></tr>")
	Response.Write("<tr><td>1</td><td>2</td><td>3</td></tr>")
	Response.Write("<tr><td>x</td><td>y</td><td>z</td></tr>")
	Response.Write("</table>")
%>
When outputting data as Excel, be sure to remove most HTML tags and only use tags that control format or layout of that data.

Hope this helps!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On