Bug 55107 - Problem reading formatted cel in Excel
Summary: Problem reading formatted cel in Excel
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.8-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-17 13:50 UTC by csaghira
Modified: 2015-10-01 14:41 UTC (History)
0 users



Attachments
Test Excel File (10.22 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2013-06-17 13:50 UTC, csaghira
Details

Note You need to log in before you can comment on or make changes to this bug.
Description csaghira 2013-06-17 13:50:38 UTC
Created attachment 30447 [details]
Test Excel File

A cell in excel is being skipped and not read at all using XSSFWorkbook and getSheetAt. The cell seems to have a special formatting. Is this a limitation? Please find attached the test case excel file. Note how B2 is skipped.

This is the code:

import org.apache.poi.xssf.usermodel.*
import org.apache.poi.ss.usermodel.*

//Excel .xlsx
Workbook wbx = new XSSFWorkbook("test.xlsx")
XSSFSheet sheetx = wbx.getSheetAt(0); 
              
//Get Values from Excel
for (XSSFRow rowx : sheetx) {
    println rowx    
}
Comment 1 Dominik Stadler 2015-10-01 14:41:42 UTC
The Excel file that you attached contains a cell for B1 which has no value and contains no cell at B2 at all. Note that the file format only contains cells after they were written to, obviously they can stay after they were made empty again. 

So the result that you see is expected as far as I see.