starydynamo
starydynamo

Reputation: 49

Save ASP page into a different file format such as XLS

There is alot of info on converting HTML table to EXCEL which is actually what I intend to do.

However, none of the examples work so am looking for a more brute force solution converting the whole web page. I have noticed by renaming the extension from HTML/ASP to XLS the conversion is fine (good enough for my needs anyway).

So...

I have an ASP page with large amount of table data which by clicking a button I need this to open up a save dialog box with the file format as EXCEL only and not HTML/ASP etc. Then the user can choose where to download it and open it up as EXCEL Spreadsheet at discretion.

Appreciate the help.

Upvotes: 0

Views: 2947

Answers (1)

armen
armen

Reputation: 1283

in ASP all you need to do, is to create a link to the .asp page containing the table, and add the following lines to that .asp page, before any html tag :

Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment;filename=fileName.xls"

Upvotes: 1

Related Questions