While exporting a huge data to excel it consumes more than 1GB memory (RAM) on my machine. And finally I gets "Out of memory exception".
Is there any way by which we can release some memory while exporting to excel?
Will ExportCache.Clear() solve the problem? If yes, how can we call it because ExportCache is a private property in DataPresenterExcelExporter class?
I am already done with setting ExportOptions. Is there any other way to get it done?
Any help is very much appreciated.
Hi,
This issue was resolved in a service release of NetAdvantage for WPF Line of Business 2011 Vol. 1.
Please let me know if you have applied the latest service release and are still having issues.
Here is the stack trave of OutOfMemoryException on exporting a huge data (1M rows, 6columns) using DataPresenter.
tack : at System.Collections.Generic.Dictionary`2.Resize() at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Infragistics.Excel.WorksheetCell.set_CellFormatProxy(WorksheetCellFormatProxy value) at Infragistics.Excel.WorksheetCell.get_CellFormatInternal() at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.SetRegionRelativeToOrigin(DataPresenterExcelExporterHelper exportHelper, Rectangle rect, Object val, IWorksheetCellFormat cellFormat) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.WriteSingleRecord(DataPresenterExcelExporterHelper exportHelper, Record record, FormatSettings cellFormatSettings) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.ProcessSingleRecord(DataPresenterExcelExporterHelper exportHelper, Record record, Int32 nestingOffset) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.ProcessRecordInternal(DataPresenterExcelExporterHelper exportHelper, Record record, ProcessRecordParams processRecordParams) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporterHelper.ProcessRecord(Record record, ProcessRecordParams processRecordParams) at Infragistics.Windows.DataPresenter.DataPresenterExportControl.OnTraverseRecord(Record record, Visibility visibility, RecordManager recordManager, IExportOptions options, List`1 flattenedList, Boolean& skipSiblings) at Infragistics.Windows.DataPresenter.DataPresenterExportControlBase.TraverseVisibleRecords(ViewableRecordCollection records, RecordManager recordManager, IExportOptions options, List`1 flattenedList) at Infragistics.Windows.DataPresenter.DataPresenterBase.Export(IDataPresenterExporter exporter, IExportOptions options) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.Export(DataPresenterBase dataPresenter, Worksheet worksheet, Int32 startRow, Int32 startColumn, ExportOptions options) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.Export(DataPresenterBase dataPresenter, WorkbookFormat workbookFormat, ExportOptions options)
Hi Marianne,
I am facing the same issue. Is there any solution?
Can you please update if there is any further release that fixed this issue?
Thanks.
Hi Vikas,
I’ve consulted with our development staff concerning this behavior and I am now in the process of logging this as a development issue. I am also creating a case for you so that we will be able to update you on our progress more directly.
You will hear from me shortly thru that case.
Thanks for the information. I’ll modify my sample data as you described and we’ll go from there.