Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=DailyReport.xls"); Response.Charset = ""; Response.ContentType = "~/SDailyReport.xls"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); DataGrid g1 = new DataGrid(); List<griddisplay> obj1 = new List<griddisplay>(); obj1 = bl.Getgrid(); g1.DataSource = obj1; g1.DataBind(); g1.RenderControl (htmlWrite); Response.Write(stringWrite.ToString()); Response.End();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)