Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

No of rows in Excel

807605Sep 13 2007 — edited Sep 13 2007
Hi,
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());

}


I need how can i check the no of rows (fields)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 11 2007
Added on Sep 13 2007
1 comment
144 views