This is a migrated thread and some comments may be shown as answers.

Excel File Export - OutOfMemoryException

11 Answers 348 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Siward Land
Top achievements
Rank 1
Siward Land asked on 03 Dec 2013, 07:08 PM
I am using the below code to create an excel file:

Workbook workbook = new Workbook();
workbook.Worksheets.Add();
string fileName = "SampleFile.xlsx";
  
IWorkbookFormatProvider formatProvider = new XlsxFormatProvider();
  
using (FileStream output = new FileStream(fileName, FileMode.Create))
{
    formatProvider.Export(workbook, output); //System.OutOfMemoryException thrown here
}

Where the variable workbook contains a lot of data (about 115000 rows worth).  My problem is that the host computer doesn't have enough memory to do the excel export, so an outofmemoryexception is thrown at formatProvider.export().

Is there a way to split up Excel file export into smaller parts so that I don't run out of memory?  I need all of the data to be in the same excel file.

Siward

11 Answers, 1 is accepted

Sort by
0
Nikolay Demirev
Telerik team
answered on 04 Dec 2013, 11:47 AM
Hi Siward,

This issue is fixed already and the fix will be included in the Q3 2013 SP1 release. However there is another known problem with our Zip library that does not allow exporting large documents. We are working on resolving this and we expect to be able to release the fix for Q1 2014.

I am sorry for the inconvenience. Please, let me know if you have any further questions.

Regards,
Nikolay Demirev
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Winston
Top achievements
Rank 1
answered on 04 Dec 2013, 09:13 PM
I am using WPF Q1 2013.  My version is two quarters behind.

What exactly was fixed in WPF Q3 2013?  Can you give me a link to what was fixed?  I will upgrade my version if it fixes my problem.

Siward
0
Petya
Telerik team
answered on 05 Dec 2013, 11:10 AM
Hello Siward,

You can find the release notes for the Q3 2013 version of RadControls for WPF here and here you can find the notes for the just released service pack version of the suite.

I hope this is helpful!

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Dean
Top achievements
Rank 1
answered on 24 Apr 2015, 01:57 PM

Hi Nikolay,

     I am having this same out of memory issue with large exports and am using Q1 2014.  Is it possible the resolution is not in Q1 2014 and perhaps will be in a later version?  (Support ID:880148)

Regards, Dean

0
Petya
Telerik team
answered on 29 Apr 2015, 11:48 AM
Hi Dean,

In the past releases we have introduced plenty of performance and memory improvements, as well as new functionality for the Spreadsheet and SpreadProcessing components.

I took a look at the ticket you mentioned and just wanted to elaborate that the SpreadProcessing library is basically shared between the WPF and ASP.NET AJAX suites. It also looks to me you are actually using the most recent version of the library - Q1 2015 in which case I am afraid we have no suggestions additional to the ones Konstantin already provided - retrieve the data from the database directly instead of using RadGrid or limit the amount of data you are exporting.

Regards,
Petya
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Dean
Top achievements
Rank 1
answered on 29 Apr 2015, 11:57 AM

Hi Petya,

     Thanks for your response.    We will have to limit the size of the reports to export.

Regardless of the data's origination, grid or database, it is the workbook export function where

the issue lies. 

------------->formatProvider.Export(workbook, ms)<-----------------

0
Petya
Telerik team
answered on 04 May 2015, 10:37 AM
Hello Dean,

I understand your concerns and hope that reducing the size of the exported data will work for you.

In general, there are many factors that could influence the memory consumption of the Spreadsheet control, including the type of data in the respective workbook. We are constantly working on improving the component and will have your scenario in mind when implementing future enhancements.

Regards,
Petya
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Massimo
Top achievements
Rank 1
answered on 15 Dec 2015, 02:09 PM
Hello, is there any news about this problem? I still get SystemOutOfMemory exception exporting 60000 rows with XlsxFormatProvider using asp.net ui 2015.3.1111.40
0
Nikolay Demirev
Telerik team
answered on 16 Dec 2015, 09:44 AM
Hello Massimo,

Currently, we are working on a new library which will help you perform a fast export of large documents with low memory footprint. Hopefully, it will be released with Q2 2016 release.

Regards,
Nikolay Demirev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rafael
Top achievements
Rank 1
answered on 12 Jul 2016, 12:12 PM

Hi

could you confirm if the feature was indeed released on Q2 2016?

0
Nikolay Demirev
Telerik team
answered on 12 Jul 2016, 12:54 PM
Hi Rafael,

Yes, It is released in Q2 2016. The library name is RadSpreadStreamProcessing. Here is the link to the library documentation.

Regards,
Nikolay Demirev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Spreadsheet
Asked by
Siward Land
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Winston
Top achievements
Rank 1
Petya
Telerik team
Dean
Top achievements
Rank 1
Massimo
Top achievements
Rank 1
Rafael
Top achievements
Rank 1
Share this question
or