Bug 54327 - cellIterator skips blank/unformatted cells in a row
Summary: cellIterator skips blank/unformatted cells in a row
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.5-FINAL
Hardware: PC All
: P2 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2012-12-19 11:37 UTC by Smitha
Modified: 2012-12-19 11:41 UTC (History)
0 users

sample excel (8.43 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2012-12-19 11:37 UTC, Smitha

Note You need to log in before you can comment on or make changes to this bug.
Description Smitha 2012-12-19 11:37:51 UTC
Created attachment 29778 [details]
sample excel

Summary: I need to process excel sheets by finding a header (i.e the first row with 8 consecutive columns). The subsequent rows' following the header becomes the data for the header cell values. 

Problem Statement: In a row if 2nd cell is blank and unformatted but the rest of the cells in that row are formatted, then the 2nd cell is not read and hence the values are messed up. 

Example: In the attached excel sheet, cell B4 and B6 are skipped by the cellIterator and thus the header 'Completion Date' has the values of the next columns i.e., M India Limited & Steel in row 4 and 6 respectively. But the same is not true for 5th row. It is read properly though B5 is blank.

Please let me know the solution at the earliest. Also, the possible way to un-format the entire excel sheet before processing.
Comment 1 Nick Burch 2012-12-19 11:41:10 UTC
This is expected behaviour, the iterator only processes the cells that are defined in the file

If you need to fetch all cells, you should use a for loop, and call getCell(columnNumber, MissingCellPolicy) to control how missing / blank cells are handled