Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/07/2008, 11:09
diegolo
 
Fecha de Ingreso: enero-2008
Mensajes: 144
Antigüedad: 16 años, 4 meses
Puntos: 2
Respuesta: Exportar Excel

YO HAGO ESTO EN VS 2003 C#
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=NombreArchivo.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.ContentType = "application/vnd.xls";
//para que no salgan esos malditos signos
Response.ContentEncoding = System.Text.Encoding.UTF7;
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
this.dgGeneralPrensa.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();

VELE SI TE FUNCIONA NO LO HE PROBADO AUN EN 2005