473,325 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Export to Excel: Page cannot be displayed

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
Nov 18 '05 #1
1 3608
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" <an*******@discussions.microsoft.com> wrote in message
news:11**********************************@microsof t.com...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Funbeat | last post by:
Hi everybody, I'm facing with the following problem (bug ?) : A page is calling another one (export.aspx) for exporting data to excel. The tecnhique used is to create a Excel-MIME stream...
1
by: Matt | last post by:
I have an ASP page that calls ASP routines that I created that execute a database query and return the results to a recordset. I then iterate through the recordset and display the data in a table....
9
by: | last post by:
I have a web page written in asp.net that has multiple datagrids on it that would need to be exported to Excel. Each of the datagrids would be a subset of what the datagrid above it was. Thus...
0
by: jeremy | last post by:
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...
3
by: mattdaddym | last post by:
Hi all, I have been using the following code to export my datagrids to excel for quite some time. Very simple and very effective. <code> Sub btnExcelExport_Click ( s As Object, e As...
1
by: forumaic | last post by:
Hello, I am trying to export data to excel from datagrid, and I am getting an error: "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." ...
5
by: karthick | last post by:
Hi, I am exporting a Gridview to Excel and it works fine without any issues. But as one of the field holds values such as "71646E100" it gets converted to: "7.16E+104" (like a formula) in...
7
Merlin1857
by: Merlin1857 | last post by:
Its great producing data for users to look at in your web pages and generally that is sufficient for their needs but sometimes you may want to supply your user with the data in a form they can...
1
by: suresh76 | last post by:
I am having reports generated in jsp with HTML codings in tabular format. On report displayed page I have to use one button , which on click has to export to excel sheet. I tried using below code....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.