Excel File Export - OutOfMemoryException

12 posts, 0 answers
  1. Siward Land
    Siward Land avatar
    10 posts
    Member since:
    Mar 2010

    Posted 03 Dec 2013 Link to this post

    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

  2. Nikolay Demirev
    Admin
    Nikolay Demirev avatar
    103 posts

    Posted 04 Dec 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Winston
    Winston avatar
    1 posts
    Member since:
    Apr 2011

    Posted 04 Dec 2013 Link to this post

    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
  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 05 Dec 2013 Link to this post

    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 >>
  6. Dean
    Dean avatar
    2 posts
    Member since:
    Mar 2015

    Posted 24 Apr 2015 in reply to Nikolay Demirev Link to this post

    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

  7. Petya
    Admin
    Petya avatar
    975 posts

    Posted 29 Apr 2015 Link to this post

    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.

     
  8. Dean
    Dean avatar
    2 posts
    Member since:
    Mar 2015

    Posted 29 Apr 2015 in reply to Petya Link to this post

    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)<-----------------

  9. Petya
    Admin
    Petya avatar
    975 posts

    Posted 04 May 2015 Link to this post

    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.

     
  10. Massimo
    Massimo avatar
    3 posts
    Member since:
    Sep 2012

    Posted 15 Dec 2015 in reply to Petya Link to this post

    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
  11. Nikolay Demirev
    Admin
    Nikolay Demirev avatar
    103 posts

    Posted 16 Dec 2015 Link to this post

    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
  12. Rafael
    Rafael avatar
    4 posts
    Member since:
    May 2013

    Posted 12 Jul in reply to Nikolay Demirev Link to this post

    Hi

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

  13. Nikolay Demirev
    Admin
    Nikolay Demirev avatar
    103 posts

    Posted 12 Jul Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready