We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

System.OutOfMemoryException exporting large data

Thread ID:

Created:

Updated:

Platform:

Replies:

123976 May 4,2016 01:00 PM May 9,2016 02:05 AM ASP.NET Web Forms 3
loading
Tags: XlsIO
Manolo
Asked On May 4, 2016 01:00 PM

Hi,

I need export over 200k records into an excel.

This process works fine with 50k records:

            ExcelEngine excelEngine = new ExcelEngine();
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);

            IStyle style = workbook.Styles.Add("RowStyle");
            //style.Color = System.Drawing.Color.AliceBlue;
            style.Color = System.Drawing.Color.CadetBlue;
            style.Font.Bold = true;


            IWorksheet sheet = workbook.Worksheets.Create();
            sheet.Name = "Nominales";
            sheet.SetDefaultRowStyle(1, 1, style);
            sheet.ImportData((IEnumerable)lstNominales, 1, 1, true);

            workbook.Worksheets.Remove(0);
            //workbook.SaveAs(@"c:\datos\datos.xlsx");
            workbook.SaveAs("Nominales", page.Response, ExcelDownloadType.PromptDialog, ExcelHttpContentType.Excel2010);

But now, I get this exception.

What can I do?




Ishwarya Narayanan [Syncfusion]
Replied On May 5, 2016 06:07 AM

Hi Manolo,

 

Thank you for contacting Syncfusion support.

 

We are unable to reproduce the reported exception from our side. So we have prepared a sample as per your requirement which can be downloaded from the following link.

 

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/XlsIO_Sample1810156344

 

Kindly share us the modified issue reproducing sample along with your machine configuration which will be helpful for us to provide you a prompt solution at the earliest. In XlsIO, There are few ways to improve the performance and memory optimization which is explained briefly in the following UG documentation link. 

 

UG documentation link: http://help.syncfusion.com/file-formats/xlsio/improving-performance  

 

Please let us know if you need any concerns.

 

Regards,

Ishwarya N


Manolo
Replied On May 6, 2016 04:19 AM

I get the error adding more data

I attach an example

Attachment: XlsIO_Sample_93041715.zip

Abirami Varadharajan [Syncfusion]
Replied On May 9, 2016 02:05 AM

Hi Manolo, 
 
Thank you for updating us. 
 
We are able to reproduce the issue “Argument out of range exception”, while running the given sample. The maximum row limit of worksheet is 1,048,576 and you are trying to import 1,197,000 rows of records which is greater than maximum row limit so “Argument out of range exception” is thrown. 
 
Kindly refer following UG documentation and MS Excel forum to know more about maximum row and column limit specification in worksheet. 
 
 
 
Please let us know if you have any concerns. 
 
Regards, 
Abirami. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;