kendo-ui-core
kendo-ui-core copied to clipboard
Spreadsheet exports corrupted xlsx when containing conditional formatting cells
Bug report
Spreadsheet exports corrupted xlsx when containing conditional formatting cells
Reproduction of the problem
- Run https://dojo.telerik.com/@Dimitar-Goshev/olaWAwUb
- Export to xlsx
- Try to open in excel
Current behavior
An error dialog for corrupted file is displayed
Expected/desired behavior
The file is opened successfully as when there is no conditional formatting applied https://dojo.telerik.com/aLuPIZeP
Environment
https://feedback.telerik.com/kendo-jquery-ui/1442617-export-to-excel-in-kendo-spreadsheet-ui-for-formatted-column
- Kendo UI version: 2022.3.913
It seems that Excel supports at most 2 conditional sections in a format string, and maximum 4 sections in total: https://stackoverflow.com/questions/33521708/conditional-formattingcustom-format-with-multiple-conditions-for-a-number-in-e
Since such a format string can only be created manually, I would say it's not a bug in our Spreadsheet. I suggest we add a note in the documentation about this, and inform users that if they'd like compatibility with Excel they should stay under the above limits.
Another option would be to make the spreadsheet silently drop conditionals/sections on export to XLSX, such that the output format will be Excel-compatible, even if some formatting would be lost. Please let me know if this is desirable.