https://bz.apache.org/bugzilla/show_bug.cgi?id=64341
Bug ID: 64341
Summary: Incorrect value returned for FormulaError after
evaluating formula cell
Product: POI
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 37169
--> https://bz.apache.org/bugzilla/attachment.cgi?id=37169&action=edit
Spreadsheet for above test case.
1. I am using below attached excel file.
2. In below excel cell A1 contains formula "=G2-G5" which evaluates to zero.
3. On evaluating this cell using FormulaEvaluator, value for formula error must
be FormulaError._NO_ERROR but it is FormulaError.NULL
5. Apache POI version used is 3.17
4. Below mentioned is my code :
// Java Code
try {
// cell is instance of Cell A1
CellValue cellValue = formulaEvaluator.evaluate(cell);
formulaError = FormulaError.forInt(cellValue.getErrorValue());
System.out.println(formulaError);
System.out.println(cell.getCachedFormulaResultTypeEnum());
} catch (NotImplementedException ex) {
} catch (FormulaParseException ex) {
}
5. The output of the above-mentioned code is
NULL
NUMERIC
6. There is an ambiguity here result type is NUMERIC and formula error is
FormulaError.NULL but it should be FormulaError._NO_ERROR as formula
successfully evaluates to zero.
--
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]