https://bz.apache.org/bugzilla/show_bug.cgi?id=58838

            Bug ID: 58838
           Summary: Some cells are null when they aren't
           Product: POI
           Version: 3.13-FINAL
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 33425
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33425&action=edit
testFile.xls

Hi all,
when I try to read some values into the xls (as attach) I obtain that a lot of
cells result as null when they aren't.

Example code: print all the cells in the first row that contain a value (not
null)

HSSFWorkbook workbook = new HSSFWorkbook(new
FileInputStream(pathToTestFileXls));
HSSFSheet sheet = workbook.getSheet("InitCharge");
int lastCol = CellReference.convertColStringToIndex("BC");
for (int c=0; c <= lastCol; c++) {
    HSSFCell cell = sheet.getRow(1).getCell(c);
    if (cell != null)
        System.out.print(new CellReference(1, c).formatAsString() + ", ");
}

Result:
A2, B2, AA2, AD2,

This is very strange! Only few cells doesn't contain a value!
Even stranger: open the xls with Excel, do NOTHING, click save, re-execute the
same code, result:
A2, B2, Z2, AA2, AB2, AD2, AE2, AG2, AH2, AI2, AJ2, AK2, AL2, AM2, AN2, AO2,
AP2, AQ2, AR2, AS2, AT2, AU2, AV2, AW2, AX2, AY2, AZ2, BA2, BB2, BC2, 

The xls used as input was generated previously with POI.

Thanks,
Michele

-- 
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]

Reply via email to