Is it better to buffer the Excel file to the file system? or to write the content straight into response stream?
Writing into the file system poses a two problems: performance and garbage.
Writing straight into stream sounds good. But I've had some annoying experience in the past: if i hit download button and choose to Open the file without any instances of Excel open, IE would have to open an instance of Excel, and then after Excel opens,
it would give an error saying something like "temporary file xxx is not found..." But if there's an existing instance of Excel when I hit the "open" button, it displays the file correctly.
Just copy paste this piece of information in ur buttin click autmaticall a new excel sheet will be displayed on ur monitor in a new window from ur datagrid
I tried using the example for excel, and can successfully
"save" the spreadsheet to my machine,but the "open" option fails with this error:
"... \Temporary Internet Files\content.IE5\A5GR6p25\POWERbase.xls[1].xls' could not be found.
Check the spelling... If you are trying to open the file from your list of most recently
used files on the file menu, make sur that the file has not been renamed, moved, or deleted."
I tried using the example for excel, and can successfully
"save" the spreadsheet to my machine,but the "open" option fails with this error:
"... \Temporary Internet Files\content.IE5\A5GR6p25\POWERbase.xls[1].xls' could not be found.
Check the spelling... If you are trying to open the file from your list of most recently
used files on the file menu, make sur that the file has not been renamed, moved, or deleted."
I am also having the same problem . Can anyone Help .
haoest
Participant
1768 Points
404 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Nov 20, 2006 01:06 AM|LINK
I have a question.
Is it better to buffer the Excel file to the file system? or to write the content straight into response stream?
Writing into the file system poses a two problems: performance and garbage.
Writing straight into stream sounds good. But I've had some annoying experience in the past: if i hit download button and choose to Open the file without any instances of Excel open, IE would have to open an instance of Excel, and then after Excel opens, it would give an error saying something like "temporary file xxx is not found..." But if there's an existing instance of Excel when I hit the "open" button, it displays the file correctly.
So, what do you think?
samirindia
Member
32 Points
22 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Nov 24, 2006 09:31 AM|LINK
good stuff but i want something diff.. i want make one query and direct download all data to client system in "Excel sheet" so plz.. give me answer..
Thanks,
Asp.net uncut
add url
freelance web developer
caokou
Member
5 Points
1 Post
Re: How To: Make "Export to Excel" always open excel in a separate Window
Dec 06, 2006 02:20 AM|LINK
Are you wanting to to put the sheet on the client machine or prompt for download?
c.ratnakar
Member
145 Points
44 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Dec 07, 2006 08:39 AM|LINK
Just copy paste this piece of information in ur buttin click autmaticall a new excel sheet will be displayed on ur monitor in a new window from ur datagrid
Response.Clear();
Response.AddHeader("Content-Disposition", "Attachment; FileName = FileName.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "Application/vnd.xls";
System.IO.StringWriter stringWrite =
new System.IO.StringWriter();System.Web.UI.HtmlTextWriter htmlWrite =
new HtmlTextWriter(stringWrite);DataGrid1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
all da best
cheers frm Rutts
c.ratnakar@gmail.com,
Tension Nahi Leneka Apun Hai Nah...
mukeshajmera
Member
4 Points
12 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Jan 24, 2007 04:27 AM|LINK
Hello ,
I tried using the example for excel, and can successfully
"save" the spreadsheet to my machine,but the "open" option fails with this error:
"... \Temporary Internet Files\content.IE5\A5GR6p25\POWERbase.xls[1].xls' could not be found.
Check the spelling... If you are trying to open the file from your list of most recently
used files on the file menu, make sur that the file has not been renamed, moved, or deleted."
help, please???
Regards & Thanks
please replay back
Mukesh
mukesh.ajmera@indianic.com
karthik_regi...
Member
10 Points
5 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Jan 24, 2007 01:24 PM|LINK
Mukesh,
I tried using the example for excel, and can successfully
"save" the spreadsheet to my machine,but the "open" option fails with this error:
"... \Temporary Internet Files\content.IE5\A5GR6p25\POWERbase.xls[1].xls' could not be found.
Check the spelling... If you are trying to open the file from your list of most recently
used files on the file menu, make sur that the file has not been renamed, moved, or deleted."
I am also having the same problem . Can anyone Help .
Thanks
Karthik
nskarhik78@hotmail.com
mukeshajmera
Member
4 Points
12 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Jan 25, 2007 04:49 AM|LINK
Hello Everyone
when i use this code for excel file download using IE Browse then
Response.Clear();
Response.AddHeader("Content-Disposition", "Attachment; FileName = FileName.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "Application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite =new HtmlTextWriter(stringWrite);
DataGrid1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
i am getting bellow error and open button to be clicked twice
I tried using the example for excel, and can successfully
"save" the spreadsheet to my machine,but the "open" option fails with this error:
"... \Temporary Internet Files\content.IE5\A5GR6p25\POWERbase.xls[1].xls' could not be found.
Check the spelling... If you are trying to open the file from your list of most recently
used files on the file menu, make sur that the file has not been renamed, moved, or deleted."
Please Help
Regards
Mukesh
mukesh.ajmera@indianic.com
AmitTiwari
Member
4 Points
2 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Feb 23, 2007 09:50 AM|LINK
Hi,
Can i save file without show save as dialog?
Thanks,
Amit Tiwari
Amit Tiwari
AmitTiwari
Member
4 Points
2 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Feb 23, 2007 09:51 AM|LINK
Hi,
Can i save file without show save as dialog?
Thanks,
Amit Tiwari
Amit Tiwari
karthik_regi...
Member
10 Points
5 Posts
Re: How To: Make "Export to Excel" always open excel in a separate Window
Apr 27, 2007 08:29 PM|LINK