R
Rob Petersen
Can anyone recommend a good, reliable solution or 3rd party component to
send a DataGrid or DataTable's contents to Excel? I've tried the following
code but it does not work reliably with large amounts of data (we have about
50,000 rows).
Server.ScriptTimeout = 1000;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
EnableViewState = false;
System.IO.StringWriter stringWriter = new System.IO.StringWriter();
HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
DataGrid1.RenderControl(htmlWriter);
Response.Write(stringWriter.ToString());
Response.End();
send a DataGrid or DataTable's contents to Excel? I've tried the following
code but it does not work reliably with large amounts of data (we have about
50,000 rows).
Server.ScriptTimeout = 1000;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
EnableViewState = false;
System.IO.StringWriter stringWriter = new System.IO.StringWriter();
HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
DataGrid1.RenderControl(htmlWriter);
Response.Write(stringWriter.ToString());
Response.End();