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
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
Our thoughts here at Progress are with those affected by the outbreak.
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.
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}
Regards,
Stefan
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
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?.
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
Our thoughts here at Progress are with those affected by the outbreak.
Hi Stefan,
Thanks!
Yes we need the same expand and collapse feature as per example.
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
Our thoughts here at Progress are with those affected by the outbreak.
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
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.
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
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.
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.