473,569 Members | 2,879 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Export to Excel: Page cannot be displayed

I've created an asp.net page that renders an html table. Using ContentType="ap plication/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 3624
Try:
Response.Conten tType = "applicatio n/vnd.ms-excel"
Response.Charse t = String.Empty
Also, if the data is coming from a datagrid, turn off the viewstate while
you are downloading to Excel.
<datagrid>.Enab leViewState = False

"jeremy" <an*******@disc ussions.microso ft.com> wrote in message
news:11******** *************** ***********@mic rosoft.com...
I've created an asp.net page that renders an html table. Using ContentType="ap plication/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
4756
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 for viewing it directly in the browser. (below is a sample code)
1
5016
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. Before I iterate through the recordset I instruct the browser that the content type is Excel using the following line: (Response.ContentType =...
9
3000
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 far, I've had no luck in finding anything to work reliably. Some of the files I've saved (using a radio button click event), will open fine in...
0
371
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 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...
3
1660
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 EventArgs ) Response.Clear() Response.AddHeader("content-disposition", "attachment;filename=FileName.xls")
1
2646
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. <% ... %>)." Error details: System.Web.HttpException was unhandled by user code Message="The Controls collection cannot be modified because the control
5
2811
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 Excel. How can I prevent this from happening ?. I need to value to be in Excel as it is displayed in the Gridview (on the web page).
7
28882
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 actually do something more with. This code shows you how to display data from your database and then how to give that data to the user in the form of a...
1
18309
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. String mimeType = "application/vnd.ms-excel"; response.setContentType(mimeType); response.setHeader("content-disposition","attachment;...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.