Hi ,

    I am trying to upload XLS and XLSX files , and before processing I kept
a check whether are there any rows existed other than header row. To
determine this I used getPhysicalNumberOfRows() function , to know no. of
rows existed in file. But , it is giving different value for XLS and XLSX
file.

Below is the code snippet ...

Workbook workbook = WorkbookFactory.create(uploadBO.getFile()); 
Sheet sheet = workbook.getSheetAt(0);

if(sheet.getPhysicalNumberOfRows()<=1)
                        throw new Exception("No data exists in file");

So, Pl. let me know how to proceede on this.

Note :Also enclosed the XLS and XLSX files for your reference.

Thanks
Naren BUG_418_Issue_1.xlsx
<http://apache-poi.1045710.n5.nabble.com/file/n5711535/BUG_418_Issue_1.xlsx>  
BUG_235_ACE_Book1.xls
<http://apache-poi.1045710.n5.nabble.com/file/n5711535/BUG_235_ACE_Book1.xls>  



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/getPhysicalNumberOfRows-value-is-different-from-XLS-files-to-XLSX-files-tp5711535.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to