Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download of data into excel spreadsheet 1

Status
Not open for further replies.

SonJ

Programmer
Oct 24, 2002
166
GB
Hi,

I have some data stored in an sql server 2000 database, and I need to be able to download the information into an Excel spreadsheet.

If anyone has any pointers, hints, references as to how I can do this, then your help would be much appreciated.

Thanks in advance.
 
Set the return type to Excel

Response.ContentType = "application/vnd.ms-excel"

You then just print out a HTML table

<Table>
<TR>
<TD>Data1</TD>
<TD>Data2</TD>
...
</TR>
</TABLE>

Hope this helps,

Gabe
 
Thanks for that, it worked a treat!

Just out of curiosity, do you know how I can create 2 spreadsheets in the same file from the same asp page, and name them each differently eg Details1, Details2 in the file of Details.xls?

Again, any hints, tips or references would be much appreciated.

Thanks in advance.
 
Sorry, I have never had that need. My guess would be to create an Excel file and then deliver that to the user instead of using HTML. That doesn't mean it can't be done though.

Thanks,

Gabe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top