You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Levi Strope <ls...@besttransport.com> on 2007/04/09 15:24:12 UTC

using HSSFRow.getLastCellNum()

Hello,
 
In my code I'm using HSSFRow.getLastCellNum(), part of
org.apache.poi.HSSF.usermodel to fetch the last cell number contained
within the row I am currently on.  I do this so I can iterate through
each cell value and output it's contents.
 
The description for this method is as follows:
"gets the number of the last cell contained in this row PLUS ONE."
 
This seems perfect, however I'm finding the behavior to be slightly
different.  When I call this method, it appears to take into account the
row with the most defined cells.  That is if Rows 0, 1 and 2 all have 5
defined cells and row 3 has 7, then while I am on row 0 I call
getLastCellNum() and it returns 7, not 5 as I would expect.
 
Is this how it should behave?  Thats fine if it is as I can find a way
to negate the exception, but it was mis-leading based on the javadoc.
 
I am using version poi-src-3.0-rc3-20070402
 
Thanks
-Levi