You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Michael <mi...@electronicscience.com> on 2016/06/01 06:50:28 UTC

Difference of getLastRowNum() and getPhysicalNumberOfRows()

Hi All,

Would like to ask the difference between getLastRowNum() and 
getPhysicalNumberOfRows() on a XSSFSheet.
Both method returns different number of row.

I have an Excel file with 1103 number of row. Using getLastRowNum() 
returns 1103 and using getPhysicalNumberOfRows() returns 1104.

Regards,
Michael.A

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


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


RE: Difference of getLastRowNum() and getPhysicalNumberOfRows()

Posted by "Murphy, Mark" <mu...@metalexmfg.com>.
getLastRowNum() retrieves the index of the last row in a spreadsheet. These indexes are 0 based, and if you have no missing rows, row 1104 the last row will have index 1103. getPhysicalNumberOfRows() returns the number of rows actually used in the spreadsheet. Unused rows are just missing from the spreadsheet. So you could have a situation where you only have one row at row 1104. In that case getPhysicalNumberOfRows() would return 1, but getLastRowNum() would return 1103.

-----Original Message-----
From: Michael [mailto:michael.a@electronicscience.com] 
Sent: Wednesday, June 01, 2016 2:50 AM
To: POI Users List
Subject: Difference of getLastRowNum() and getPhysicalNumberOfRows()

Hi All,

Would like to ask the difference between getLastRowNum() and
getPhysicalNumberOfRows() on a XSSFSheet.
Both method returns different number of row.

I have an Excel file with 1103 number of row. Using getLastRowNum() returns 1103 and using getPhysicalNumberOfRows() returns 1104.

Regards,
Michael.A

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


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