You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2017/05/09 23:08:31 UTC

[Bug 61082] New: getLastRowNum is misleading / unclear

https://bz.apache.org/bugzilla/show_bug.cgi?id=61082

            Bug ID: 61082
           Summary: getLastRowNum is misleading / unclear
           Product: POI
           Version: 3.16-FINAL
          Hardware: Macintosh
                OS: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: shing10170@gmail.com
  Target Milestone: ---

In a layman POV,
If I want to find to the first empty row(=getLastRowNum + 1), I would have
called this method.
by empty, I mean the row appears to be empty (or in POI language, cell type
BLANK) if you open the xlsx with excel. It doesnt matter whether the cell has
been created or not.


The current problem is, if you have used a cell but then deleted the content
(that means it is blank now), that cell was created in the xlsx and
getLastRowNum will not consider that as the "last row".

I call that those created but blank or empty cells, "invisible cells"

Suggestion:
1. upadate the javadoc to warn developer about this (because the current
lastRow wording is misleading that people would think last row = last row that
is not blank but current implementation is, last row = the largest row Number
among the created cells in xlsx)

2. make a new method to do find the right "last row"
the new method could be called
getFirstBlankRowNum(column findWhichCol, row startAtRow)
,which is, find the first blank cell's rowNum or return the current
getLastRowNum if all the cells were not blank


I know I am not a good explainer, please let me know if you want to know more
or want to recruit someone to achieve this (I am looking for chances to do
my-first-open-source-project)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61082] getLastRowNum is misleading / unclear

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61082

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
We have updated the JavaDoc via r1809988 to explain this behavior better. 

Please note that for iterating over the actual valid rows/cells, you can use
Sheet.rowIterator() and Row.cellIterator() which will leave out non-existing
rows/cells, but still may return BLANK rows/cells.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org