You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Brian Trezise <br...@intellidata.net> on 2012/02/16 20:32:59 UTC
Poi 3.8 Beta 5 - Streaming XSSF Question
I'm trying to build a very low-memory footprint XLSX row iterator. I
thought I'd found the solution with the new xssf.streaming package, but
I'm stumped and looking at the source code and documentation isn't
helping much as the documentation is all centered around writing, not
reading, a large xlsx file. So perhaps somebody can help me out here -
Basically what's happening is I'm creating an SXSSF workbook from an
existing workbook. The existing workbook contains data, but the SXSSF
version does not seem to have access to it. See the following code snippet:
[code]
Workbook wb = WorkbookFactory.create(new FileInputStream(new
File("/Users/BrianTrezise/Desktop/test1.xlsx")));
System.out.println("XSSF Sheet Name: " +
wb.getSheetAt(0).getSheetName());
System.out.println("XSSF Last Row Number: " +
wb.getSheetAt(0).getLastRowNum());
wb = new SXSSFWorkbook((XSSFWorkbook) wb);
System.out.println();
System.out.println("SXSSF Sheet Name: " +
wb.getSheetAt(0).getSheetName());
System.out.println("SXSSF Sheet Name: " +
wb.getSheetAt(0).getLastRowNum());
[/code]
[output]:
XSSF Sheet Name: new MFGs
XSSF Last Row Number: 7
SXSSF Sheet Name: new MFGs
SXSSF Sheet Name: 0
[/output]
What am I doing wrong here?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org