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

[Solved] Export Telerik Grid (Hierarchy) Data to Excel

5 Answers 256 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ramy Mahrous
Top achievements
Rank 1
Ramy Mahrous asked on 14 Jan 2010, 01:06 PM
I need to Export Telerik Grid Data in Hierarchy to Excel, when I tried your sample, it just exported the top parent, but actually I need to export all data in all Master and details tables.

Thank you

5 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 14 Jan 2010, 01:11 PM
Hello Ramy,

Please set HierarchyDefaultExpanded="true" as shown in the code-snippet below:
<MasterTableView HierarchyDefaultExpanded="true" ...

Best regards,
Daniel
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.
0
Ramy Mahrous
Top achievements
Rank 1
answered on 14 Jan 2010, 02:38 PM
Thank you so much, Daniel :)
It exported data in ugly view! I think because I didn't choose the right format. So I made it ExcelML GridView1.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
But it gives me exception Index was out of range. Must be non-negative and less than the size of thecollection.
Parameter name: index
in GridView1_ExcelMLExportRowCreated I used the solution in http://www.telerik.com/community/forums/aspnet-ajax/grid/exporting-to-excelml-index-out-of-range-problem.aspx but no thing happened, I generate columns at runtime.

0
Accepted
Daniel
Telerik team
answered on 14 Jan 2010, 04:55 PM
Hello Ramy,

What do you mean by "ugly view"? Did you try to set ExportOnlyData="true"?

As to the ExcelML export - please try to set UseAllDataFields to true:
<MasterTableView UseAllDataFields="true" ...

ExcelML export
Word/Excel export (HTML-based)

Best regards,
Daniel
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.
0
Ramy Mahrous
Top achievements
Rank 1
answered on 17 Jan 2010, 05:03 PM
doesn't work too, it gives the same exception!
0
Ramy Mahrous
Top achievements
Rank 1
answered on 18 Jan 2010, 04:38 PM
It works in the latest version 2009.3.1314.35
Thank you, Daniel :)
Tags
Grid
Asked by
Ramy Mahrous
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ramy Mahrous
Top achievements
Rank 1
Share this question
or