Bug 66687 - Combination of XSSF and SXSSF may result in invalid files
Summary: Combination of XSSF and SXSSF may result in invalid files
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 5.2.3-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-13 10:00 UTC by Martin Schlömer
Modified: 2023-08-01 08:29 UTC (History)
0 users



Attachments
Test case to produce a file that Excel will have trouble with (2.42 KB, text/plain)
2023-07-13 10:00 UTC, Martin Schlömer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schlömer 2023-07-13 10:00:51 UTC
Created attachment 38600 [details]
Test case to produce a file that Excel will have trouble with

When mixing XSSF and SXSSF and not creating XSSF cells in the correct order, the resulting file will contain the broken cell order, leading Excel to display a repair option and losing data.

This is achieved by adding XSSF cells and then adding new rows with SXSSF, thus bypassing both mechanisms that would have sorted the cells.

I assume calling XSSFRow.onDocumentWrite for the sorting even when dimensionOverride is set would fix the issue.