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

Grouping in export to excel in kendoReact

9 Answers 943 Views
Wrappers for React
This is a migrated thread and some comments may be shown as answers.
Rashmi
Top achievements
Rank 1
Veteran
Rashmi asked on 11 Jun 2020, 12:36 PM

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

9 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 12 Jun 2020, 06:37 AM

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.
0
Rashmi
Top achievements
Rank 1
Veteran
answered on 16 Jun 2020, 08:30 AM

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.

0
Stefan
Telerik team
answered on 16 Jun 2020, 08:59 AM

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.
0
Rashmi
Top achievements
Rank 1
Veteran
answered on 16 Jun 2020, 09:52 AM

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?.

0
Stefan
Telerik team
answered on 17 Jun 2020, 07:13 AM

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.
0
Rashmi
Top achievements
Rank 1
Veteran
answered on 22 Jun 2020, 12:43 PM

Hi Stefan,

Thanks!

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

0
Stefan
Telerik team
answered on 23 Jun 2020, 09:29 AM

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.
Jie
Top achievements
Rank 3
Iron
Iron
Iron
commented on 26 May 2023, 08:05 PM

Hi,

For the expand/collapse issue - https://github.com/telerik/kendo-react/issues/641. How does it work? Someone commented that it didn't work. I tried it and not working for me either.

 

Thanks,

Jie

0
Wissam
Telerik team
answered on 30 May 2023, 11:42 AM

Hello, Jie,

I tested the Grid with `ExcelExport` with the `collapsible` prop set to `true` and it is working on my side. Therefore, could you please send me a runnable example where the issue is reproduced? You can use my test demo below as a base.

In addition, please make sure to enable editing when opening the exported excel sheet, in order to be able to toggle the expand/collapse buttons.

I hope this helps, but please let me know if you have any further questions.

Regards,
Wissam
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Jie
Top achievements
Rank 3
Iron
Iron
Iron
answered on 30 May 2023, 12:48 PM

Hi Wissam,

It doesn't work with version 5.1.0. Here is the example, I basically just changed the dependency versions of your example.

https://stackblitz.com/edit/react-vo3gq8-bewvhs?file=package.json

The 'collapsible' property is already available in version 5.1.0.

 

Thanks,

Jie

Wissam
Telerik team
commented on 31 May 2023, 12:14 PM

Hi, Jie,

I tested your example, but unfortunately, I was not able to reproduce the issue. For convenience, I recorded a video of my test:

Could you please provide me with more information on the faced issue? For example, are the expand/collapse buttons not appearing in the Excel sheet? It would also be helpful if you send me a video where the issue is reproduced.

Jie
Top achievements
Rank 3
Iron
Iron
Iron
commented on 31 May 2023, 12:34 PM

hmm...I can't reproduce either. Maybe stackblitz didn't clean build it when I changed the versions. Anyway, I am planning to upgrade everything to latest versions. So this should be fine. Thank you.
Wissam
Telerik team
commented on 02 Jun 2023, 07:49 AM

Hello, Jie,

It appears that this issue is related to an old bug that was resolved in version `5.5.1`. Here is the GitHub item related to it:

Since you are upgrading to the latest versions, this issue will be resolved.

If you need any further assistance with the ExcelExport, please let me know.

Jie
Top achievements
Rank 3
Iron
Iron
Iron
commented on 02 Jun 2023, 11:02 AM

That makes sense now. Thanks for the update.
Wissam
Telerik team
commented on 02 Jun 2023, 11:15 AM

You are welcome, Jie.
Tags
Wrappers for React
Asked by
Rashmi
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Rashmi
Top achievements
Rank 1
Veteran
Wissam
Telerik team
Jie
Top achievements
Rank 3
Iron
Iron
Iron
Share this question
or