I bind data from a dataset to a grid and export the data from the grid to excel. If the number of items in the grid is greater than 50,000, an error message is displayed.
So, I want to split the data and display it in different sheets in excel. (I work in a web application)
using this code to export to excel
gvExcel.DataSource = DTS; gvExcel.DataBind(); Response.AddHeader("content-disposition", "attachment; filename= filename.xls"); Response.ContentType = "application/excel"; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); gvExcel.RenderControl(htw); // Style is added dynamically Response.Write(style); Response.Write(sw.ToString()); Response.End();
Can someone help me with this?
Alex
source share