Exporting Excel but keeping cell styles/colouring

1 Answer 367 Views
Excel Export Grid
Ricky
Top achievements
Rank 1
Iron
Ricky asked on 20 Jan 2022, 12:40 PM

Hi,

I have logic in cellRender to format the cell styles such as changing background colours (for example if age is > 20 change the cell background colour to green).

Exporting to PDF the styles persist - the PDF looks exactly as the grid with the cell styling.

With Excel, all cell styling is lost. Is there any way I can persist the cell styling on export?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 20 Jan 2022, 01:07 PM

Hello, Ricky,

That occurs as the excel export is exporting the data, not the formating and the styles. This is because the HTML elements and styles and not 100% with excel cells.

This can be done by looping over the data and styling it with the available Excel styles:

https://www.telerik.com/kendo-react-ui/components/excelexport/customization/

The same approach can be used with there is a Grid.

Regards,
Stefan
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.

Tags
Excel Export Grid
Asked by
Ricky
Top achievements
Rank 1
Iron
Answers by
Stefan
Telerik team
Share this question
or