You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Qing.Liao" <ql...@live.cn> on 2012/05/22 16:03:07 UTC

Re: Corrupt excels using SXSSF

can we use SXSSFWorkbook to read a template ? 

ClassLoader clzloader = ReadExsitExcel.class.getClassLoader();
InputStream stream = clzloader.getResourceAsStream("workbook.xlsx");
XSSFWorkbook xsbook = new XSSFWorkbook(stream);
Sheet sheet0 = xsbook.getSheetAt(0);
int xsnum0 = sheet0.getLastRowNum();
SXSSFWorkbook sxsbook = new SXSSFWorkbook(xsbook);
Sheet sheet = sxsbook.getSheetAt(0);
int xsnum = sheet.getLastRowNum();
System.out.println(xsnum0);
System.out.println("=============");
System.out.println(xsnum);

--------------------

29
=============
0

the value of xsnum0 is correct. but the value of xsnum always be 0.
SXSSFWorkbook  can't read template?
		

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Corrupt-excels-using-SXSSF-tp5649133p5709857.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org