Export to excel is extremely slow

3 posts, 1 answers
  1. Anu
    Anu avatar
    8 posts
    Member since:
    May 2011

    Posted 26 Mar 2012 Link to this post

    I am trying to export using the Export to Excel via ExcelML option (code below) and it is extremely slow even to export 3000 records. Is that expected behavior or i am doing something wrong, Please help:
    I am using the RadControls for winform Q2 2011
    When i try with <200 rows it worked fast

    public void ExportToExcel()
               ExportToExcelML exporter = new ExportToExcelML(this.radGV1);
               exporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
               exporter.ExportVisualSettings = true;
               exporter.SheetMaxRows = ExcelMaxRows._1048576;
               exporter.SheetName = "sheet";
               exporter.SummariesExportOption = SummariesOption.DoNotExport;
               string fileName = "C:\\Temp\\ExportedData123.xls";
  2. erwin
    erwin avatar
    392 posts
    Member since:
    Dec 2006

    Posted 28 Mar 2012 Link to this post

    Anu, I suggest you update to one of the later releases of the controls.
    Alernatively you can use my no-frills export code posted here, which is quite quick but does not support any of the advanced formatting features.

  3. Answer
    Ivan Petrov
    Ivan Petrov avatar
    705 posts

    Posted 29 Mar 2012 Link to this post

    Hello Anu,

    Thank you for writing.

    The main cause for the slow performance is that you export the grid visual settings. When you have this option turned on all the grid elements have to be created in order to build the styles. After each element is created, its style is exported. If you can, I would recommend that you set styles of the cells in the ExcelCellFormatting event and turn off the export of styles settings. Also, it's always advisable to export data in a separate thread. 

    I hope this will be useful for you. Should you have further questions, I would be glad to help.

    All the best,
    Ivan Petrov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top