Exporting datagrid to excel: Format cells?

wakeup

Freshman
Joined
Nov 9, 2004
Messages
35
I'm exportin a datagrid to excel, but Excel file is without format colors cells border...
Do you know how format it?
thanks

this is my code:
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=exportar.xls");
Response.Buffer= true;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;

System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);

dgNopaginado.Caption= ddPlanta.SelectedItem + ": "+ txtFechaIni.Fecha+"-"+txtFechaFin.Fecha;

this.ClearControls(dgNopaginado);
dgNopaginado.RenderControl(oHtmlTextWriter);

Response.Write(oStringWriter.ToString());

Response.End();

graffiti
 
Back
Top