kendo-ui-core icon indicating copy to clipboard operation
kendo-ui-core copied to clipboard

Spreadsheet exports corrupted xlsx when containing conditional formatting cells

Open mparvanov opened this issue 5 years ago • 1 comments

Bug report

Spreadsheet exports corrupted xlsx when containing conditional formatting cells

Reproduction of the problem

  1. Run https://dojo.telerik.com/@Dimitar-Goshev/olaWAwUb
  2. Export to xlsx
  3. 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

mparvanov avatar Feb 12 '20 12:02 mparvanov

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.

mishoo avatar Oct 10 '22 06:10 mishoo