poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48598] New: code migration problem
Date Fri, 22 Jan 2010 09:30:44 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48598

           Summary: code migration problem
           Product: POI
           Version: 3.5-FINAL
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: satishkk@collabera.com


We are using poi3.0.2.jar file.

where the code(attached) works fine for xls files

wb=WorkbookFactory.create(fin);
Sheet sheet = wb.getSheetAt(0);
Row row;
Cell cell;
for(int r = 0; r < rows; r++) {
    System.out.println();
    row = sheet.getRow(r);
    if(row != null) {
    for(int c = -1; c < cols; c++) {
    cell = row.getCell((short)c);
    }

where as if I  pass xlsx files its giving followig error.

java.lang.IllegalArgumentException: Cell index must be >= 0
    at org.apache.poi.xssf.usermodel.XSSFRow.getCell(XSSFRow.java:191)
    at org.apache.poi.xssf.usermodel.XSSFRow.getCell(XSSFRow.java:178)
    at org.apache.poi.xssf.usermodel.XSSFRow.getCell(XSSFRow.java:35)
    at ReadExcel.readBoth(ReadExcel.java:190)
    at ReadExcel.main(ReadExcel.java:39)

The problem is with row.getCell(-1)
this method returns null in POI3.0.2
the same method throws IllegalArgumentException in POI3.5

So we need to change the code?

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


Mime
View raw message