Kendo-ui-core: When importing an xlsx with hidden columns to Spreadsheet, the hidden columns letter headings (A, B, C etc.) remain visible and overlap each other

Created on 6 Jul 2016  路  5Comments  路  Source: telerik/kendo-ui-core

The above issue could be reproduced in the Import / Export Spreadsheet demo.

Bug Spreadsheet Medium

Most helpful comment

The issue here is that we only care about the hidden attribute when deciding to hide a column/row in import. We should probably set it hidden if it has a zero width/height, even if the attribute is missing. Will do that.

All 5 comments

Could be reproduced with the following file:
Book1.xlsx

The problem. The overlapping of cells (in green) could no longer be observed with the internal build 2016.2.704.
collapsedhiddencellsheadings

This is apparent in the client-side import as well. Pinging @mishoo

A related issue might be:

  • An xls file created with Excel 2010 with hidden colums;
  • The file is Saved as xlsx using Excel 2013;
  • The hidden columns are not respected at all in the Spreadsheet, however they remain hidden in the xlsx file.

Sample converted test file:
TextConvertedMine.xlsx

The issue here is that we only care about the hidden attribute when deciding to hide a column/row in import. We should probably set it hidden if it has a zero width/height, even if the attribute is missing. Will do that.

This is more tricky than I thought. Turns out, if you set a column's width to zero, it can be no longer hidden. Here's the relevant code. In short, axis.hide(column) will move its width to the _hidden list, and set it in the main list to zero (if it's not already hidden), and axis.hidden(column) returns true only if the _hidden list contains a non-zero value for that column. Higher level, the following will happen:

sheet.columnWidth(0, 0);
sheet.hideColumn(0);
sheet.isHiddenColumn(0); // returns false

To workaround the Excel import issue with minimum impact, I'll just skip setting a column's width to zero, and will mark it hidden instead. But it's still a bug we might need to revisit.

Was this page helpful?
0 / 5 - 0 ratings