user4706312
user4706312

Reputation: 21

Kendo Detail Grid Excel Export

How to Export Kendo Detail grid to Excel?When Apply code for my project from Telerik Kendo UI Documentation and API reference does not work correctly

Upvotes: 1

Views: 1448

Answers (1)

NinjaCoder
NinjaCoder

Reputation: 51

Kendo's built in MVC Excel Export will not handle exporting the detail grids without javascript similar to the example in the link I provided.

In the example you are referencing:

  1. .ToolBar(tools => tools.Excel()) === Built in Export button
  2. .Excel(excel => excel .FileName("Kendo UI Grid Export.xlsx") .Filterable(true) .ProxyURL(Url.Action("Excel_Export_Save", "Grid")) ) === Config
  3. .DataSource(dataSource => dataSource ....omitted for brevity.... .Read(read => read.Action("Excel_Export_Read", "Grid")) ) === Data source for the export

Your details are not included in your dataSource. Even if they were, something has to handle building that relationship within the spreadsheet. Otherwise, the hierarchy will be ignored, hence, you are only getting your master rows.

If you ONLY want your detail grid exported, then apply the code in your referenced example to your detail grids.

Upvotes: 2

Related Questions