Summary: | Output file get corrupted with SXSSFWorkbook and "chart sheet" | ||
---|---|---|---|
Product: | POI | Reporter: | jobe <jonas.berglin> |
Component: | SXSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jonas.berglin, maligang1 |
Priority: | P2 | ||
Version: | 3.10-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | testfile with chart sheet |
Description
jobe
2014-05-23 11:28:42 UTC
Same problem in my project. I checked the corrupted file by unzip it,and I found some useful imformation. The xml file under xl\chartsheets had an additionnal elememt named <sheetData>,which should not exist in a type of chartsheet. I think this is a bug . my poi version is 3.14 Same problem in my project. I checked the corrupted file by unzip it,and I found some useful imformation. The xml file under xl\chartsheets had an additionnal elememt named <sheetData>,which should not exist in a type of chartsheet. I think this is a bug . my poi version is 3.14 Both 3.10 and 3.14 are somewhat old now, I'd suggest you try upgrading 3.16 is (In reply to Nick Burch from comment #3) > Both 3.10 and 3.14 are somewhat old now, I'd suggest you try upgrading tried 3.16 , same problem occur. I have modified the method org.apache.poi.xssf.streaming.SXSSFWorkbook.injectData(File, OutputStream) at line 354. --- if(xSheet!=null) -> if(xSheet!=null && !(xSheet instanceof XSSFChartSheet)) --- Since there is no <sheetData> in a chartsheet, XSSFChartSheet should not take this if branch.(copyStreamAndInjectWorksheet(is,zos,xis) process the field <sheetData>) The trick works fine in my case. Applied now on trunk via r1798913 The following in a test-case also showed the problem via some invalid XML structure that was produced. Workbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb); assertNotNull(wbBack); wbBack.close(); Thanks for fixing this, it should have been "readOnly: true"... |