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

Export of excel out of memory

3 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 1
Charlie asked on 23 Jun 2009, 07:26 PM
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?

3 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 24 Jun 2009, 04:57 PM
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.
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 01 Jul 2009, 01:31 PM
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
0
Martin Vasilev
Telerik team
answered on 06 Jul 2009, 04:36 PM
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.
Tags
GridView
Asked by
Charlie
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
erwin
Top achievements
Rank 1
Veteran
Iron
Share this question
or