How can I use Excel to display a ASP.NET Datagrid? I have a fairly large datagrid that would look better using excel so the headers stay stationary so is it possible I can call excel from the ASP.NET application to display my datagrid data? Any suggestions?
Wow, this is exactly what you are looking for, lol Export to Excel with ASP.NET C# from a Datagrid: http://www.c-sharpcorner.com/Upload...2005041447AM/ExportASPNetDataGridToExcel.aspx
If you want to do this easily, you can build a table <table></table> in html and send the contents in a session variable to a new page with a load handler like this: protected void Page_Load(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=FileName.xls"); Response.Charset = ""; Response.ContentType = "application/vnd.xls"; Response.Write(Session["ExcelContents"].ToString()); Session.Clear(); Response.End(); }