martes, 11 de septiembre de 2012

Send excel file to save locally using ASP.NET

Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=reporte.csv");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/excel";
Response.TransmitFile(Server.MapPath("~/exportado/reporte.csv"));
Response.End();