I try to count number of rows in a xls file with Apache POI
. File contains 300 rows, but I get just 24 as output of both of these commands.
int noOfColumns = sh.getRow(0).getPhysicalNumberOfCells();
int noOfColumns = sh.getRow(0).getLastCellNum();
There aren't any empty rows between lines in file.
It gives right number of rows on a sheet:
int rnum = sheet.getLastRowNum() - sheet.getFirstRowNum();