S
Sudhakar
We are getting a strange problem in exporting data grid to excel.
We have a data grid in hand with basic data bounded to it and adding some summary data as DataGridItems rows at particular levels in datagrid (summation values)
When we export the grid to excel using the following code
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("content-disposition", "attachment; filename=ProductVersionSummaryReport.xls");
Response.Charset = "";
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(tw);
hw.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Html);
reportGrid.RenderControl(hw);
hw.RenderEndTag();
Response.Write(tw);
Response.End();
This code is able to export the grid successfully to excel format except the summation rows….
It is able to create rows, columns (cells at exact location) but not able to display data in those cells.
What could be the mistake in this code?
We have a data grid in hand with basic data bounded to it and adding some summary data as DataGridItems rows at particular levels in datagrid (summation values)
When we export the grid to excel using the following code
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("content-disposition", "attachment; filename=ProductVersionSummaryReport.xls");
Response.Charset = "";
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(tw);
hw.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Html);
reportGrid.RenderControl(hw);
hw.RenderEndTag();
Response.Write(tw);
Response.End();
This code is able to export the grid successfully to excel format except the summation rows….
It is able to create rows, columns (cells at exact location) but not able to display data in those cells.
What could be the mistake in this code?