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 2012/02/27 10:18:08 UTC

DO NOT REPLY [Bug 51989] Cells that contain only comments are missing in XSSFRow

https://issues.apache.org/bugzilla/show_bug.cgi?id=51989

Yegor Kozlov <ye...@dinom.ru> changed:

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

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2012-02-27 09:18:08 UTC ---
By default, Row#getCell returns what is physically stored in the workbook
stream and in your case it is null. 

However, you can control what to do when getting missing or blank cells  with

        Workbook.setMissingCellPolicy(MissingCellPolicy missingCellPolicy);

there are three options:


    /** Missing cells are returned as null, Blank cells are returned as normal
*/
    public static final MissingCellPolicy RETURN_NULL_AND_BLANK = new
MissingCellPolicy();
    /** Missing cells are returned as null, as are blank cells */
    public static final MissingCellPolicy RETURN_BLANK_AS_NULL = new
MissingCellPolicy();
    /** A new, blank cell is created for missing cells. Blank cells are
returned as normal */
    public static final MissingCellPolicy CREATE_NULL_AS_BLANK = new
MissingCellPolicy();

If you expect a blank cell then call 

workbook.setMissingCellPolicy(MissingCellPolicy.CREATE_NULL_AS_BLANK );

after constructing your workbook.

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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