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

Slow export to CSV when a detailtable is in grid

4 Answers 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Danny
Top achievements
Rank 1
Danny asked on 24 Jan 2015, 08:14 AM
Hi,

Since adding a detail table to my master table, the exporting of data from the master table to CSV has become very slow. I temporarily removed the detail table and the export worked fine. I came across this forum thread http://www.telerik.com/forums/how-to-suppress-detailtable-bind-when-exporting but setting the hierarchyloadmode has not made any difference. I do not have the hierarchyloadmode set anywhere else, so it's just using the default setting.

Here is the code for the RadGrid export:

Protected Sub lnkbtndownloaddata_Click(ByVal sender As Object, ByVal e As System.EventArgs)
RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand
RadGrid1.ExportSettings.IgnorePaging = True
RadGrid1.MasterTableView.ExportToCSV()
End Sub

Like I said, setting the hierarchyloadmode has not made any difference to the speed of exporting.

Is there anything else I could try? Is there a way to temporarily disable the detail table prior to exporting?

Regards

Tim

4 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 28 Jan 2015, 12:49 PM
Hi Tim,

Note that CSV does not support exporting of a hierarchical grid and in such case it will export only the master table view items. A possible solution is to collapse all data when export to CSV command is fired. Please check out the following code snippet.
Protected Sub lnkbtndownloaddata_Click(ByVal sender As Object, ByVal e As System.EventArgs)
RadGrid1.MasterTableView.HierarchyDefaultExpanded = False
RadGrid1.ExportSettings.IgnorePaging = True
RadGrid1.MasterTableView.ExportToCSV()
End Sub

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Danny
Top achievements
Rank 1
answered on 28 Jan 2015, 03:56 PM
Kostadin,

Thanks for your reply.

Unfortunately, that hasn't made any difference.

I don't need to export the detail table, just the master table. I didn't have the detail table expanded before anyway.

Do you have any other recommendations?

Thanks

Tim 
0
Kostadin
Telerik team
answered on 02 Feb 2015, 08:59 AM
Hi Tim,

Could you please isolate the issue in a small runnable sample in order to investigate it further? I tried to replicate the issue in a small runnable sample but on my side the time needed to generate the export file is identical with and without detail tables. Please check out the attached sample and let me know how it differs from your real setup.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Danny
Top achievements
Rank 1
answered on 18 Feb 2015, 12:28 PM
Kostadin,

Thanks for your efforts. Following my dedicated support ticket request and your suggestion, I wanted to post the solution here for the benefit of others.

I was able to fix it by including the following before exporting:
RadGrid1.MasterTableView.DetailTables.Clear()

Hope that helps someone.

Thanks

Tim
Tags
Grid
Asked by
Danny
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Danny
Top achievements
Rank 1
Share this question
or