Grouping in export to excel in kendoReact

8 posts, 0 answers
  1. Rashmi
    Rashmi avatar
    11 posts
    Member since:
    Jun 2020

    Posted 11 Jun Link to this post

    Hi, 
    I am using kendo React in my project. When I am doing grouping on grid and exporting as excel, grouping is not applied in Excel and is download with flat table.

    I am sending grouped array in group property of ExcelExport butgrouping is not happening in export to excel.

    <ExcelExport group = {group}>

    </Excel Export>

    Please let me know is it the expected behaviour for excel or is it an issue.

     

    Thanks

  2. Stefan
    Admin
    Stefan avatar
    2960 posts

    Posted 12 Jun Link to this post

    Hello, Rashmi,

    Exporting the grouped data in excel requires setting the group property to the same value that is passed to the Grid.

    Also, the data property of the ExcelExport has to receive the same grouped data as the Grid.

    I made an example showcasing this:

    https://stackblitz.com/edit/react-zf7dvp?file=app/main.jsx

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  3. Rashmi
    Rashmi avatar
    11 posts
    Member since:
    Jun 2020

    Posted 16 Jun in reply to Stefan Link to this post

    Hi Stefan,

    Thanks.

    I implemented the above logic. When I am passing <ExcelExport group={this.state.dataState.group} ></ExcelExport>

    and doing export to excel, excel is getting downloaded without grouping and header is shifting towards right and data in table remains intact.

    If I group by one column it, header shifts by one column towards right . If grouping is done by two column, header shifts to right by two column and table of grid remains intact at its place.

  4. Stefan
    Admin
    Stefan avatar
    2960 posts

    Posted 16 Jun Link to this post

    Hello, Rashmi,

    The grouping also requires passing a grouped data not only the groups.

    In the example that I have shared I passed the grouped data to the excel export as well:

          <ExcelExport
            data={this.state.result.data}
            ref={exporter => (this._export = exporter)}
            group={this.state.dataState.group}
    Please try passing the grouped (processed) data to the ExcelExport and advise if the same issue still occurs.

    Regards,
    Stefan
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  5. Rashmi
    Rashmi avatar
    11 posts
    Member since:
    Jun 2020

    Posted 16 Jun in reply to Stefan Link to this post

    Hi Stefan,

    Thanks That worked !

    Is there a way we can implement the expand and collapse feature for the grouped data in the exported excel sheet?.

  6. Stefan
    Admin
    Stefan avatar
    2960 posts

    Posted 17 Jun Link to this post

    Hello, Rashmi,

    I`m glad to hear that the data is already exported grouped.

    As for the expand collapsed feature, please let me know if this is the same as the issue described here:

    https://github.com/telerik/kendo-ui-core/issues/4686

    If it is, I will log the same feature request for KendoReact as well and if it is not, please share more details on the requirement.

    Regards,
    Stefan
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  7. Rashmi
    Rashmi avatar
    11 posts
    Member since:
    Jun 2020

    Posted 22 Jun in reply to Stefan Link to this post

    Hi Stefan,

    Thanks!

    Yes we need the same expand and collapse feature as per example.

  8. Stefan
    Admin
    Stefan avatar
    2960 posts

    Posted 23 Jun Link to this post

    Hello, Rashmi,

    Thank you for the confirmation.

    I have logged this enhancement in our repository and you can track the progress there:

    https://github.com/telerik/kendo-react/issues/641

    Regards,
    Stefan
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top