poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaikiran pai <jai_forums2...@yahoo.co.in>
Subject HSSFSheet's getPhysicalNumberOfRows and getLastRowNumber return wrong values
Date Sat, 13 Jan 2007 09:40:48 GMT



I have a xls file which contains 10 rows. But when i invoke the getPhysicalNumberOfRows and
getLastRowNumber method on HSSFSheet, i get values as 224 and 223. Here's the code:


POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream("c:\\TEST.XLS"));
HSSFWorkbook wb = new HSSFWorkbook(fs);
for (int i=0;i<wb.getNumberOfSheets();i++){
    HSSFSheet sheet = wb.getSheetAt(i);
    System.out.println("Physical number of rows: " + sheet.getPhysicalNumberOfRows());
    System.out.println("Number of rows: " + sheet.getLastRowNum());


Any idea what's wrong with the code. Have attached the xls file for reference.




Yahoo! India Answers: Share what you know. Learn something new
View raw message