https://issues.apache.org/bugzilla/show_bug.cgi?id=54607

            Bug ID: 54607
           Summary: NPE in XSSFSheet.getTopRow() when the top row is 1
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified

Created attachment 29988
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29988&action=edit
trivial test case, created in Excel 2010

Exception in thread "main" java.lang.NullPointerException
    at org.apache.poi.ss.util.CellReference.<init>(CellReference.java:88)
    at org.apache.poi.xssf.usermodel.XSSFSheet.getTopRow(XSSFSheet.java:1181)
    at poi.ReadTest.main(ReadTest.java:22)

for the second sheet (note the first visible row of first sheet is 2). File is
created in Excel 2010, saving it in xls format (Excel 97-2003) solves the
issue.

To reproduce:

Workbook wb = WorkbookFactory.create(new File("c:/0/xxx.xlsx"));
for (int si = 0; si < wb.getNumberOfSheets(); si++) {
    Sheet sh = wb.getSheetAt(si);
    System.out.println(sh.getSheetName() + "/" + sh.getTopRow());
}

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