Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 15, 2010 05:35 AM by bpnanu
Sep 07, 2007 06:55 AM|LINK
///Note special add a refrence for axcel 5.0 or later dll.
asp.net 2.0 export to excel
Sep 07, 2007 07:09 AM|LINK
and add refference of microsoft excell 5.0 or later
and use also this code
Sep 13, 2007 06:03 AM|LINK
Mukesh the line in bold is cause for your issue..once u comment that line ..excel will open without any error,,,,
Sep 13, 2007 03:06 PM|LINK
I just add the following line of code after the <%@ Page Language=........ %> line
And it does the job. Hope this helps.
Nov 05, 2007 11:00 AM|LINK
Can pls help me out for code to export Entire Gridview only to new Window on button Click event...its an Web application.
Nov 05, 2007 02:36 PM|LINK
Here are the steps:
1) You can add an "onclick" attribute to the button as follows:
Hope this helps.
Nov 28, 2007 02:42 PM|LINK
Ok, now one of my PCs is cursed with Excel saying that it could not find the temp .xls file in the ...\temporary internet files\Content.IE5 folder and to check the spelling blah blah blah. I have looked at lots of threads with people having the same problem
and as far as I can tell nobody seems to really have an answer.
Most of the threads have source code similar to this one with some minor changes to the order of the lines of code. Some people have suggested to not use the line of code "Response.Cache.SetCacheability(HttpCacheability.NoCache);" while others seem to
be OK with it. In some threads people say the problem goes away after changing this or that but I have tried all the combinations without success on my problem PC.
Now to add my own two riduculous workarounds which my users just love to hear me suggest, I have found the following:
1) Tell users to previously open Excel on the client desktop and then run the ASP.NET code in IE and the error will be avoided. This of course isn't a real workaround since you can't expect users to do this extra step and the spreadsheet after loading does
not pop up in front of ASP.NET program which causes confusion.
2) dump Internet Explorer and use Firefox instead
To me, this problem seems like a intermittent timing issue where Excel is sometimes taking too long to open or the temp .xls file is not ready to open yet to to an issue in IE. I have made sure that my problem PC is fully updated with Microsoft patches
but that did not make any difference. Once in a while, my problem PC does not have the error on the first attempt after starting the program but then seems to always fail on the second attempt. I have run the problem PC using ASP.NET code using IIS on both
a production server and on a local IIS instance on the problem PC without any difference.
Surely, someone has a better solution to this problem. Please let me know if anyone has any fresh ideas.
Nov 28, 2007 07:39 PM|LINK
One of the reasons could be the size of the Excel file. There is a limit on the Excel file size if you create by exporting from ASP.NET. If you are loading too many data it may be exceeding that size limit. Try with smaller set of data just to test.
Nov 28, 2007 08:47 PM|LINK
The error where Excel cannot open the temp .xls file in the ...\temporary internet files\content.ie5 folder happens on small files with only a few rows as well as files with a couple of thousand rows. I also experimented with changing IE to use c:\temp\temporary
internet files instead but this didn't change anything.
It also happens on my problem PC pointing to the production server where other PCs pointing to exactly the same ASP.NET application and identical Excel files and have never had this error show up.
The problem must be related to something unique to this PC.
Nov 29, 2007 03:58 PM|LINK
Did you check permissions on the temporary folder?