Hi Ray,
We were able to reproduce the “Out of Memory Exception” issue while exporting with 8000 columns. This exception occurs because new Excel style will be created for each and every cell while exporting. Hence you can overcome this issue by setting the property ExportStyle of ExcelExportingOptions as false. Please find the code example for your reference.
Note: While using this option, cell styles are not exported. It will export the cell content only.
var options = new ExcelExportingOptions();
options.ExportStyle = false;
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = excelEngine.Excel.Workbooks.Add();
workbook.Version = ExcelVersion.Excel2013;
IWorksheet workSheet = workbook.Worksheets[0];
gridControl.Model.ExportToExcel(workSheet, options);
workbook.SaveAs("Sample.xlsx");
System.Diagnostics.Process.Start(@"Sample.xlsx"); |
Regards
Kanimozhi B