- Product: GroupDocs.Comparison for Java 26.10
- Runtime: Zulu OpenJDK 21.0.11, macOS 26.6.2, Apple M4 Pro
- License: metered
Summary
In an XLSX comparison result, every row that had no height set in the source (auto-fit) is written with a fixed height of 15 pt (ht="15" customHeight="1"). The sheet default row height also changes from 15 to 12.75. Wrapped multi-line cells and cells with large fonts are clipped as a result. Rows with an explicit height are kept as they were. This happens on every sheet, including sheets with no changes, and also when the two files are identical.
Steps to reproduce
height-old.xlsxandheight-new.xlsxhave the same layout as our generated reports: a “Cover” sheet with large centered titles, a “Document version control” sheet, and a “Data” sheet with wrapped cells. Many Data cells hold several items, one per line (2–6 lines). No row has a height set, except Data row 6, which is 45 pt. The only difference is one cell: Data!C3 “Lorem” → “Lorem ipsum”.HeightFixtures.javagenerates both files (needs Apache POI).- Compare them with default options (
RowHeightRepro.javain the attachment):
try (Comparer comparer = new Comparer("height-old.xlsx")) {
comparer.add("height-new.xlsx");
comparer.compare("height-result.xlsx", new CompareOptions());
}
- Look at the
<sheetFormatPr>and<row>elements inxl/worksheets/sheet*.xmlof the newer file and of the result.RowHeightRepro.javaprints them (output.txt).
Expected
Rows without a height in the source still have no height in the result, so Excel and LibreOffice fit them to their content. The default row height is unchanged.
Actual
height-new.xlsx |
height-result.xlsx |
|
|---|---|---|
sheetFormatPr (all sheets) |
defaultRowHeight="15.0" |
defaultRowHeight="12.75" |
| Cover, rows 1–8 | no ht |
ht="15" customHeight="1" |
| Document version control, rows 1–5 | no ht |
ht="15" customHeight="1" |
| Data, rows 1–5 and 7 (up to 6 lines) | no ht |
ht="15" customHeight="1" |
| Data, row 6 | ht="45.0" customHeight="true" |
ht="45" customHeight="1" |
In LibreOffice, the Data sheet of the newer file shows every line of every cell (height-new-rendered.png). In the result, each auto-height row is one line tall (height-result-rendered.png). The cells are bottom-aligned, so only the last line of each cell is visible, and fragments of the lines above it show in the row above. On the Cover sheet, the 24 pt and 32 pt titles are cut off at the top (height-new-cover-rendered.png, height-result-cover-rendered.png). The change itself is found and marked correctly.
We get the same result when we compare one of our real reports with an identical copy of itself (0 changes). All 572 rows across its three sheets, including 433 rows on its data sheet, get ht="15" customHeight="1".
Impact
Our generated spreadsheets put several related items in one cell, one per line, and leave row heights to auto-fit. In the comparison result these cells are clipped, so reviewers can’t see the full content without resizing every row by hand.
Question
Could the comparison keep the source row heights as they are, leaving ht out for rows that had none? If the fixed height is intended, is there an option to keep auto-fit row heights?
Related:
- XLSX comparison matches rows by position, so one deleted row marks every following row as changed
- XLSX comparison takes minutes even for identical files
Attachment
groupdocs-xlsx-row-height-repro.zip (144.2 KB)
groupdocs-xlsx-row-height-repro.zip: height-old.xlsx, height-new.xlsx, height-result.xlsx, RowHeightRepro.java, HeightFixtures.java (generates the input files, needs Apache POI), output.txt, height-new-rendered.png, height-result-rendered.png, height-new-cover-rendered.png, height-result-cover-rendered.png