System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw); // Render grid view control. reportGrid.RenderControl(htw); // Write the rendered content to a file. string renderedGridView = sw.ToString(); File.WriteAllText(Request.MapPath("~/Account/temp.xls"), renderedGridView); htw = new System.Web.UI.HtmlTextWriter(sw);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)