https://issues.apache.org/bugzilla/show_bug.cgi?id=56274
Bug ID: 56274
Summary: SXSSF produces corrupt xlsx file from valid xlsx
template
Product: POI
Version: 3.10
Hardware: PC
Status: NEW
Severity: blocker
Priority: P2
Component: SXSSF
Assignee: [email protected]
Reporter: [email protected]
Created attachment 31393
--> https://issues.apache.org/bugzilla/attachment.cgi?id=31393&action=edit
Sample input file exhibiting the problem
Upgrading from poi-3.9 to poi-3.10 caused a bug where xlsx files loaded as a
template using XSSF, added with some data and written with SXSSF resulted in
corrupt files.
Opening the resulting files with Excel 2013 results in the following Yes/No
dialog:
"We found a problem with some content in 'Filename.xlsx'. Do you want us to try
to recover as much as we can? If you trust the source of this workbook, click
Yes."
Clicking yes shows the recovery result dialog, with a list of repaired
table*.xml files under /xl/tables in the internal excel structure.
Attached is a sample input xlsx file exhibiting the problem, which can be
reproduced by the following reduced test:
public static void main(String[] args) throws Exception {
File inputFile = new File("ExecutiveReportTemplate.xlsx");
File outputFile = new File("ExecutiveReportTemplate-new.xlsx");
XSSFWorkbook inputWorkbook = new XSSFWorkbook(new
FileInputStream(inputFile));
SXSSFWorkbook outputWorkbook = new SXSSFWorkbook(inputWorkbook);
outputWorkbook.write(new FileOutputStream(outputFile));
}
I examined the internal xml files, and the differences seem to be in the
/xl/tables/table*.xml files -
The tableColumn elements have the same id and dataDxfId attributes, but
different name attributes:
in poi-3.9 the name attributes correspond to the order of the columns in the
template worksheet,
in poi-3.10 the name attributes seem to be out-of-order, and one of the columns
have a duplicate name.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]