https://issues.apache.org/bugzilla/show_bug.cgi?id=53517
Priority: P2
Bug ID: 53517
Assignee: [email protected]
Summary: Row iteration on formatted Sheet raise Nullpointer
Exception
Severity: normal
Classification: Unclassified
Reporter: [email protected]
Hardware: PC
Status: NEW
Version: 3.7
Component: XSSF
Product: POI
Created attachment 29037
--> https://issues.apache.org/bugzilla/attachment.cgi?id=29037&action=edit
formatted Template
If using a formatted sheet as template and e.g setting row.height at Row 510
raise nullpointer exception when iterate over rows using LastRowNr.
Code:
for (int i=0; i <= workbook.getSheet("template").getLastRowNum(); i++)
{
Row actRow = workbook.getSheet("template").getRow(i);
}
because it looks like a empty sheet hast normally only 500 rows and formatting
a row after 500 at this row to the row list.
Now the row treeMap has 501 entries, with keys 0 to 499 and the additional key
510
from the formatted row as entry 501 .
Calling workbook.getSheetAt(0).getLastRowNum() get the key 510 and iterate like
above raise Nullpointer in workbook.getSheetAt(0).getRow(i) because keys 500 to
509 are not in the treeMap.
I put the template file as attachment
--
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]