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

Improving grid exporttoexcel performance

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 25 Nov 2009, 05:06 PM
Does anyone have any tips/tricks for improving export to Excel performance in radgrid?

I have a grid linked to a stored procedure in needdatasource.  The stored procedure returns data in 65 seconds and the grid is fully displayed 11 secs later (with paging).  The datasource is  54 columns and 38,000 rows.  I am very happy with this performance on the front end.


   <telerik:RadGrid ID="RadGrid1" runat="server" PageSize="5" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true"
        </telerik:RadGrid> 
 


When exporttoexcel is called, the process to export is taking nearly 9 minutes.  With the first minute being the stored procedure.  The server is a quad core windows 2008 server.   Currently using build 1124.   Memory usage jumps approx 1.3GB during the 8 minute span which is my biggest concern at the moment.

    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource 
        Dim sql As String 
        sql = "exec sp_Export" 
        RadGrid1.DataSource = dal.GetDataTableNoTimeout(sql) 
    End Sub 
 
 
    Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.Click 
        RadGrid1.ExportSettings.FileName = "myfilename" 
        RadGrid1.ExportSettings.ExportOnlyData = True 
        RadGrid1.ExportSettings.IgnorePaging = True 
        RadGrid1.MasterTableView.ExportToExcel() 
    End Sub 


The resulting spreadsheet is approx 27mb.  I realize this is very large, but the memory usage and time spent for the server to process just doesn't seem proportional.

Thanks for any tips you can provide.

-Joel

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 01 Dec 2009, 07:29 AM
Hi Joel,

Basically, the pure amount of html which needs to be exported is the main culprit for the performance issue. Other than reducing the number of columns or rows, which are about to be exported, there is no other option to improve the performance.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Joel
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Share this question
or