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

Export to Excel in Grid wrongly generated

1 Answer 240 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Salim
Top achievements
Rank 1
Salim asked on 27 Apr 2018, 09:59 AM
The excel file is wrongly generated when we have grouping and fetching all data

I have a grid that is pageable and I want all the data to be  exported to excel with the grouping
The grouping is not shown and the data shifts form column to another

Reproduced in https://plnkr.co/edit/kSRgv4pGwNoA2WknXQ2q?p=preview

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 30 Apr 2018, 10:29 AM
Hi Salim,

In order to export the Grouped data as expected, you will need to process the data in accordance with the Grid grouping descriptors (and also sorting and filtering descriptors if needed) and omit only the paging-related state properties (skip and take), as demonstrated in the following section of our documentation:

https://www.telerik.com/kendo-angular-ui/components/grid/export/excel-export/#toc-exporting-specific-data

I updated the provided Plunker to demonstrate the described approach:

https://plnkr.co/edit/6bfRYr6VYywJbLgIhUw1?p=preview

public allData(): ExcelExportData {
    const result: ExcelExportData = {
      data: process(this.products, {group: this.group}).data, // process the data and access the "data" field
      group: this.group
    };
 
    return result;
  }

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Salim
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or