Summary: | XSSF not updating worksheet dimensions | ||
---|---|---|---|
Product: | POI | Reporter: | Sheet JS <dev> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 65562 |
Description
Sheet JS
2020-06-19 07:29:58 UTC
Bug #65562 reports the same for SXSSF Dominik - I think the XSSF and SXSSF issues should be treated differently. XSSFSheet has this code. protected void write(OutputStream out) ... // finally, if we had at least one cell we can populate the optional dimension-field if(minCell != Integer.MAX_VALUE) { String ref = new CellRangeAddress(getFirstRowNum(), getLastRowNum(), minCell, maxCell).formatAsString(); if(worksheet.isSetDimension()) { worksheet.getDimension().setRef(ref); } else { worksheet.addNewDimension().setRef(ref); } } ``` While in SXSSF, the issue is that the order of the XML is messed up. Microsoft chose to put the dimension in the sheet XML before the row data - so the SXSSF code doesn't yet know the dimensions when it writes the dimension data. It might be possible to get SXSSF to work by taking advantage of temp files and creating the sheet XML based on row data that is in temp files (and we then know how many rows there are. In XSSF, this is so much easier because the whole sheet is in memory. |