https://issues.apache.org/bugzilla/show_bug.cgi?id=56973
Bug ID: 56973
Summary: Use Sxssf write a xlsx file, but xssfReader read it
Nothing
Product: POI
Version: 3.10-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: SXSSF
Assignee: [email protected]
Reporter: [email protected]
Use the SXSSFWorkbook to produce a xlsx file,But use the usermode XSSF read
nothing;
xlsx write code:
SXSSFWorkbook wb = new SXSSFWorkbook(100);
Sheet sh = wb.createSheet();
for(int rownum = 0; rownum < 1000; rownum++){
Row row = sh.createRow(rownum);
for(int cellnum = 0; cellnum < 10; cellnum++){
Cell cell = row.createCell(cellnum);
cell.setCellValue("test");
}
}
FileOutputStream out = new FileOutputStream("/temp/sxssf.xlsx");
wb.write(out);
out.close();
// dispose of temporary files backing this workbook on disk
wb.dispose();
xlsx read code:
OPCPackage pkg = OPCPackage.open(filename);
XSSFReader r = new XSSFReader(pkg);
ReadOnlySharedStringsTable sst = new ReadOnlySharedStringsTable(pkg);
XMLReader parser =
XMLReaderFactory.createXMLReader();//"org.apache.xerces.parsers.SAXParser");
handler = new SheetHandler(sst);
parser.setContentHandler(handler);
InputStream sheet2 = r.getSheet("rId1");
InputSource sheetSource = new InputSource(sheet2);
parser.parse(sheetSource);
sheet2.close();
--
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]