https://issues.apache.org/bugzilla/show_bug.cgi?id=50096
Summary: Wrong cell value in XSSF when evaluating formula in a
cell with index > 255
Product: POI
Version: 3.7-dev
Platform: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
Cells in a row with an index > 255 that contain formulas may be evaluated
wrongly.
The specific case can be seen in the attached Excel file (repro.xlsx). There
are two rows. The first row simply contains the numbers 1 - 300. The second row
simply refers to the cell value above in the first row by a simple formula.
When evaluating the cell values (using the FormulaEvaluator) you get wrong cell
values for cells in the second row if they have an index > 255.
The following code demonstrates the problem:
Workbook wb = WorkbookFactory.create(new FileInputStream("repro.xlsx"));
FormulaEvaluator evaluator =
wb.getCreationHelper().createFormulaEvaluator();
for(int i = 245; i < 265; i++) {
Cell cell_noformula = wb.getSheetAt(0).getRow(0).getCell(i);
Cell cell_formula = wb.getSheetAt(0).getRow(1).getCell(i);
CellValue cv_noformula = evaluator.evaluate(cell_noformula);
CellValue cv_formula = evaluator.evaluate(cell_formula);
System.out.println("Cell " + i + ": no formula = " +
cv_noformula.getNumberValue() + ", formula = " + cv_formula.getNumberValue());
}
OS: Windows 7
POI: 3.7-beta3
Java: 1.6.0_20 64-bit
--
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: [email protected]
For additional commands, e-mail: [email protected]