Active Server Pages Programming (ASP)/export to excel

Advertisement


Question
hey i added a export to excel button on my asp page..
even the data is visible on the page..but when i clcik on export to excel button to get that in an excel sheet ..it shows the option to sav that but dost not display data. It shows blank sheet. what is happening i am not able to understand..help me out

Answer
Hi Lisha,

Use something like this

<%@ Language=VBScript %>
<%  Option Explicit

Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=excelTest.xls"
%>
<table>
   <tr>
       <td>Test</td>
   </tr>
</table>



Thanks

-Srini

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.

©2012 About.com, a part of The New York Times Company. All rights reserved.