I am trying to export asp.net gridview to excel using openxml. i have seen many posts converting gridview to table row and then table is rendered this wont work for me because my gridview has lot of formatting and adding additional rows in rowdatabound. So i need to see exactly in the excel as it is on webpage. Please help me on this...
As mentioned above my gridview has lot of formatting that includes adding additional rows in rowdatabound and column merges, i am currently able to export to excel using gridview render control to htmlwriter and stringwriter then response.write stringwriter however this is eating up memory and it taking longer times to open the excel file. I thaught of using openxmlwriter which can be faster than response object . Any sample code snippets that resolve my issues?
I don't have an example that works specifically with the GridView. The PowerTools for OpenXML Core has an example of creating a spreadsheet from an in-memory structure. If memory is really a problem, then look at this post about how to stream output for really large spreadsheets.