Hi there, my problem is the file is not writing to the client side nothing happening
my code is above:
thanks
I really Appreciate your comments.
my code is above:
//Save the Excel spreadsheet to a MemoryStream and return it to the client
using (var exportData = new MemoryStream())
{
try
{
hssfworkbook.Write(exportData);
string saveAsFileName = string.Format("ObrasNuevas-{0:d}.xls", DateTime.Now).Replace("/", "-");
Context.Response.ContentType = "application/vnd.ms-excel";
Context.Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", saveAsFileName));
Context.Response.Clear();
Context.Response.BinaryWrite(exportData.GetBuffer());
Context.ApplicationInstance.CompleteRequest();
//Context.Response.End();
}
catch (Exception ex)
{
Context.Response.Write(ex.Message);
}
}
my server is Windows 2003 , only work with chrome but with ie i cant get the xls filethanks
I really Appreciate your comments.