Hi all,
I am getting the lack of memory exception while export the data(in case of many rows)
i am getting error in the below bold line .
public void ExportToExcel(string filename, bool saveUltraGridFormat) { if (_excelExporter == null) { _excelExporter = new UltraGridExcelExporter(); //Saves the ultragrid format settings to excel if (saveUltraGridFormat) _excelExporter.InitializeColumn += new InitializeColumnEventHandler(UltraGridExcelExporter_InitializeColumn); _excelExporter.BeginExport += new BeginExportEventHandler(UltraGridExcelExporter_BeginExport); _excelExporter.CellExported += new CellExportedEventHandler(UltraGridExcelExporter_CellExported); _excelExporter.EndExport += new EndExportEventHandler(UltraGridExcelExporter_EndExport); } ExcelExporter.Export(this, filename); }
Plesae guide me on this
Exact exception is "system out of memory"
Hello,
Thank you for contacting Infragistics. OutOfMemoryExceptions occur when you are out of memory and the best way to resolve this is to reduce the amount of memory used in your application. For the UltraGrid, you can refer to the Memory Usage topic in the online documentation for how to optimize memory usage:
http://help.infragistics.com/doc/WinForms/2014.1/CLR4.0/?page=WinGrid_Memory_Usage.html
When exporting to excel the entire excel workbook is created in memory before being written to disk. Currently there isn't any streaming option to write as the excel workbook is being created. If you would like this you can submit a product idea for this on our ideas site:
ideas.infragistics.com
If you provide the logic that you written in the exporter's events we can review it to determine if there are optimizations that can be made to reduce memory usage.
Let me know if you have any additional questions.