Hello, I want to save the gridview to excel file. If I change the place of (.xlsx) to (.xls) , it is saved as 97-2003 excel format.
But now I change the (.xlsx).
It is saved as excel file.But I cannot reopen the excel file.
Can anybody help me in my problem?
Thanks a lot :-)
grvid.AllowPaging = false;
getgrid();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=file-name.xlsx");
Response.ContentType = "application/vnd.xlsx";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
grvid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
grvid.AllowPaging = true;
getgrid();

Kimberlee LowePosted May 20, 2015, 7:10 AM
Asp.Net HeinPosted May 20, 2015, 5:02 AM
Kimberlee LowePosted May 20, 2015, 4:16 AM
{
Asp.Net HeinPosted May 19, 2015, 5:35 AM
Kimberlee LowePosted May 19, 2015, 5:06 AM