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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

System.OutOfMemoryException exporting large data

Thread ID:





123976 May 4,2016 05:00 PM UTC May 9,2016 06:05 AM UTC ASP.NET Web Forms 3
Tags: XlsIO
Asked On May 4, 2016 05:00 PM UTC


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.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 10:07 AM UTC

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.



Ishwarya N

Replied On May 6, 2016 08:19 AM UTC

I get the error adding more data

I attach an example

Attachment: XlsIO_Sample_93041715.zip

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

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. 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon