The following url used to create a excel file in specified location.
http://www.mikesknowledgebase.com/pages/CSharp/ExportToExcel.htm
After storing the excel file in server, it should be transmitted to local.
Response.TransmitFile() to explicitly send the file from your ASP.NET application and then add the Content Type and Content-Disposition headers.
http://www.mikesknowledgebase.com/pages/CSharp/ExportToExcel.htm
After storing the excel file in server, it should be transmitted to local.
if
(CreateExcelFileOriginal.CreateExcelDocument(dt, location))
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("content-disposition", attachment;filename=" + "sample.xlsx");
HttpContext.Current.Response.ContentType
= "application/spl.xlsx";
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.TransmitFile(location);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}
No comments:
Post a Comment