[Bug 61082] New: getLastRowNum is misleading / unclear

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 61082] New: getLastRowNum is misleading / unclear

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61082] getLastRowNum is misleading / unclear

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

Dominik Stadler <[hidden email]> changed:

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

--- Comment #1 from Dominik Stadler <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]