473,386 Members | 1,864 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,386 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 3612
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.