Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/07/2008, 14:25
diegolo
 
Fecha de Ingreso: enero-2008
Mensajes: 144
Antigüedad: 16 años, 4 meses
Puntos: 2
De acuerdo Respuesta: Mensaje al abrir creado desde c#

HOOLA YO HAGO ESTO EN C# 2003 OJALA TE SIRVA

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.Datagrid1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();

PRUEBALO Y ME DICES
SUERTE!!!!!