Export to Excel: Page cannot be displayed

G

Guest

I've created an asp.net page that renders an html table. Using ContentType="application/vnd.ms-excel" it will open in the browser as an excel file on 4 out of the test machines I have available to me. On one machine it consistently comes back with a standard "Page cannot be displayed" error. When i remove the ContentType line, the page will render correctly. As long as that attripbute is set, however, the one machine always fails. All the machines have pretty much identical builds of Win2k with .net 1.1, Office 2k, and internet explorer 5.5+ (the machine giving me errors is running 6.1 128 bit). An earlier version of this same asp (proof of concept) also is displaying the error, but did not two months ago

This gets deployed next week to a target audience of approximately 5000 users, so I'd appreciate any info I can get

Thanks

j
 
R

Rick Spiewak

Try:
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = String.Empty
Also, if the data is coming from a datagrid, turn off the viewstate while
you are downloading to Excel.
<datagrid>.EnableViewState = False

jeremy said:
I've created an asp.net page that renders an html table. Using
ContentType="application/vnd.ms-excel" it will open in the browser as an
excel file on 4 out of the test machines I have available to me. On one
machine it consistently comes back with a standard "Page cannot be
displayed" error. When i remove the ContentType line, the page will render
correctly. As long as that attripbute is set, however, the one machine
always fails. All the machines have pretty much identical builds of Win2k
with .net 1.1, Office 2k, and internet explorer 5.5+ (the machine giving me
errors is running 6.1 128 bit). An earlier version of this same asp (proof
of concept) also is displaying the error, but did not two months ago.
This gets deployed next week to a target audience of approximately 5000
users, so I'd appreciate any info I can get.
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top