Exporting as Excel (database results)

J

Jawahar Rajan

All,
I am trying to export a result set as an excel spread
sheet. Most of the time this works as expected, when a
user chooses to save as excel the browser pop-up a save as
dialog to allow the user to save the spreadshet with
a .xls name.

Some times the browser will open up the file as text file
within the bvrowser itself?

These are my two lines of code to prompt the save as
dialog for a Browser:
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-
disposition", "attachment;filename=ReportsName.xls"

I do not use any HTML to write out the Response from the
Database rather just plain text and VBTab for a new column
and VBCrLf for a new line.

Thanks
Jawahar
 
R

Ray at

If the user does not have Excel or if the user has "confirm open after
download" selected for the .xls filetype, he will get the download prompt.

Ray at work
 
B

Bullschmidt

Would possibly removing the word attachment; help at all?


Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,097
Latest member
RayE496148

Latest Threads

Top