Export of excel out of memory

4 posts, 0 answers
  1. Charlie
    Charlie avatar
    2 posts
    Member since:
    Aug 2008

    Posted 23 Jun 2009 Link to this post

    Hi, I was testing out the export to excel feature using the ExportToExcelML object but I found out that it throws out of memory exception when the grid has over 65000 records. I used the following source code:

             void exportExcel_Click(object sender, EventArgs e)
            {
                SaveFileDialog fileSave = new SaveFileDialog();
                fileSave.Filter = "Excel Files(*.XLS)|*.xls";
                if (fileSave.ShowDialog() != DialogResult.OK)
                    return;
                string strExportLocation = fileSave.FileName;
                ExportToExcelML exporter = new ExportToExcelML();
                exporter.HiddenColumnOption = ExportToExcelML.HiddenOption.DoNotExport;
                bool exportThemeColors = false;
                exporter.RunExport(radGridView1, strExportLocation, ExportToExcelML.ExcelMaxRows._65536, exportThemeColors);
            
            }

    did I do something wrong or is it a problem with the ExportToExcelML object?
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 24 Jun 2009 Link to this post

    Hello Charlie,

    Thank you for writing.

    Described exception is a known issue with ExportToExcelML class, when you are trying to export a large number of rows and columns. Unfortunately, there is no suitable work-around for this.

    The good news is that it has been already addressed and the fix will be available in the upcoming new release Q2 2009. Please, excuse us for the inconvenience.


    Sincerely yours,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 01 Jul 2009 Link to this post

    Charlie,

    I wrote a very straight-forward simplistic export to ExcelML for my girds. Does not have the many Telerik features and does not support formatted exporting -  but can export basic types and does not use much memory. Should also be pretty easy to adopt to your needs.
    Contact me at info@richardconsulting.ch for the source code, if - like me  - you cannot wait for Q2.

    Erwin
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 06 Jul 2009 Link to this post

    Hello guys,

    The new Q2 2009 release is live and available for download. It contains refactored ExportToExcelML class where the OutOfMemoryException issue is addressed. Please give it a try.

    If you have questions, feel free to ask.

    Regards,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top