I am using the below code to create an excel file:
Workbook workbook = new Workbook();
string fileName = "SampleFile.xlsx";
IWorkbookFormatProvider formatProvider = new XlsxFormatProvider();
using (FileStream output = new FileStream(fileName, FileMode.Create))
formatProvider.Export(workbook, output); //System.OutOfMemoryException thrown here
Where the variable workbook contains a lot of data (about 115000 rows worth). My problem is that the host computer doesn't have enough memory to do the excel export, so an outofmemoryexception is thrown at formatProvider.export().
Is there a way to split up Excel file export into smaller parts so that I don't run out of memory? I need all of the data to be in the same excel file.