Desconocido
|
| Enviado - 12/1/2005 |
| ? |
Hola amigos:
Tengo un problema al exportar un datagrid a excel. Utilizo el siguiente c?digo:
// Preparaci?n
Response.Buffer = false;
Response.ContentType = "application/vnd.ms-excel";
this.EnableViewState = false;
DataGrid1.AllowPaging = false;
DataGrid1.AllowSorting = false;
DataGrid1.DataBind ();
// Escribimos el html que genera el grid en respuesta para enviarlo al cliente
System.IO.StringWriter tw = new System.IO.StringWriter ();
HtmlTextWriter hw = new HtmlTextWriter (tw);
DataGrid1.RenderControl(hw);
Response.Write(tw.ToString());
// Enviamos los datos al cliente
Response.End();
Sin embargo, cuando abro el excel, todas las tildes y ? no se exportan bien. Por ejemplo, Jos? Mar?a --> José María.
Por favor, ?puede alguien ayudarme?
Muchas gracias. |
| ? |
|