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

           Summary: Formula calcuation does not support named cells
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Created an attachment (id=22222)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22222)
Example referenced in the description

Note: the version is 3.1-FINAL (but there is no selection for it in the Version
field)

When calculating a formula that has "named" cell references I get the following
exception.

Exception in thread "main" java.lang.ClassCastException:
org.apache.poi.hssf.record.formula.eval.NameEval cannot be cast to
org.apache.poi.hssf.record.formula.eval.ValueEval
        at
org.apache.poi.hssf.record.formula.eval.NumericOperationEval.singleOperandEvaluate(NumericOperationEval.java:62)
        at
org.apache.poi.hssf.record.formula.eval.AddEval.evaluate(AddEval.java:67)
        at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.invokeOperation(HSSFFormulaEvaluator.java:473)
        at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateCell(HSSFFormulaEvaluator.java:386)
        at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.internalEvaluate(HSSFFormulaEvaluator.java:338)
        at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCell(HSSFFormulaEvaluator.java:183)
        at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateAllFormulaCells(HSSFFormulaEvaluator.java:278)
        at NamedCellTest.main(NamedCellTest.java:20)

I've provided two examples:

* named-cell-test has one named cell and a second cell getting its value
(=NAME)
* named-cell-in-formula-test has two named cells and a third adding them
together (=sum(name1+name2))


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

Reply via email to