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

Export to Excel Timeout!

6 Answers 1009 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 24 Sep 2010, 02:45 PM
I have a grid with 20 columns and around 8,000 rows.  It takes about 30 seconds to load and timesout when I try to export to excel.  What would cause this to timeout?

protected void ButtonExcel_Click(object sender, System.EventArgs e)
   {
       RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");
       Grid1.ExportSettings.ExportOnlyData = true;
       Grid1.ExportSettings.IgnorePaging = true;
       Grid1.ExportSettings.OpenInNewWindow = true;
       Grid1.MasterTableView.ExportToExcel();
   }

Does anyone else have a problem with performance and exporting to excel?

6 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 24 Sep 2010, 06:14 PM
Hello Michael,

Have you tried increasing the executionTimeout in the httpRuntime section in your web.config file? You can view the details on this MSDN article:

http://msdn.microsoft.com/en-us/library/e1f13641.aspx

I've never experienced a time out when exporting to excel, but I'm assuming it's due to the amount of columns/records your exporting.

I hope that helps.
0
Mike
Top achievements
Rank 1
answered on 24 Sep 2010, 06:17 PM
Cori,
Thanks, but I have it timing out at fifteen minutes and I am not wanting to increase it anymore.  What I ended up doing was export to CSV instead of Excel, it still opens Excel and only takes a few seconds and the file size is much smaller.... probably because it doesn't push all that HTML even though I have exportdataonly = true.
0
Cori
Top achievements
Rank 2
answered on 24 Sep 2010, 08:28 PM
Does changing the Excel export type from HTML to ExcelML, change anything?
0
Daniel
Telerik team
answered on 29 Sep 2010, 10:15 PM
Hello guys,

In some scenarios the ExcelML format will be faster than HTML although it is still no match for the CSV format. A possible way to speedup the export process it to create another RadGrid on-the-fly (it should be added to the controls collection even though it won't be visible) and bind it with a limited set of data (I recommend that you reduce the number of columns).

Regards,
Daniel
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Mike
Top achievements
Rank 1
answered on 30 Sep 2010, 03:11 PM
I would love to tell the customer to reduce the number of columns.... but they are not going to buy it!  They want even more columns.
0
Daniel
Telerik team
answered on 06 Oct 2010, 02:31 PM
Hello Michael,

If you are not satisfied with the built-in exporting capabilities you can use a third-party exporting library such as NPOI. The following code-library could be used as a starting point:
Export to Excel with third-party library (NPOI)

If this is not suitable for you, I recommend that you try the built-in CSV format.

Best regards,
Daniel
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Mike
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or