Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
145 Points
44 Posts
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 =
System.Web.UI.HtmlTextWriter htmlWrite =
DataGrid1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
all da best
cheers frm Rutts
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...