https://issues.apache.org/bugzilla/show_bug.cgi?id=52220
Yegor Kozlov <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID OS/Version| |All --- Comment #1 from Yegor Kozlov <[email protected]> 2011-11-21 10:09:10 UTC --- As the javadoc states, both Sheet#rowIterator() and Cell#cellIterator() iterate over the physical data, i.e. they iterate over the rows and cells that are physically defined in the file. For optimization purposes Excel typically does not write blank cells and it explains why you are getting only the actual data cells and not blanks. For the indexed cell access via Row.getCell(int columnIndex) there is a way to control the missing cell policy for the case of null and blank cells: // return a blank if a cell is null or missing workbook.setMissingCellPolicy(Row.RETURN_BLANK_AS_NULL); Cell cell = sheet.getRow(0).getCell(0); // never null Note that MissingCellPolicy works only for indexed access and not for iterators, that it, no matter what you pass to workbook.setMissingCellPolicy the cell iterator will always return only physical cells. 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: [email protected] For additional commands, e-mail: [email protected]
