Improving grid exporttoexcel performance

2 posts, 0 answers
  1. Joel
    Joel avatar
    172 posts
    Member since:
    Oct 2006

    Posted 25 Nov 2009 Link to this post

    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"

    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 
        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.

  2. Yavor
    Yavor avatar
    11 posts

    Posted 01 Dec 2009 Link to this post

    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.

    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.
Back to Top