Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    202

    Unanswered: Export from ASP to Excel

    Hi all,

    Can anyone tell me how to export data from ASP classic to excel?
    Thanx
    Appreciate your help

  2. #2
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •