poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris McCann <testflyj...@gmail.com>
Subject "Not implemented" exception for SUMIF function in xlsx file
Date Sat, 11 Jun 2011 06:33:05 GMT
I'm having trouble evaluating the SUMIF function in a *.xlsx file.  It's
throwing a "not implemented yet" exception but I can't figure out what's not
implemented.

Is this function supported?  If not, is there a list somewhere of what
functions are supported for evaluation?  The Sumif class has an evaluate()
method so I'm a bit confused.

FWIW, the function call in Excel is:

=SUMIF($AI$3:$JN$3,C$36,$AI40:$JN40)

Cell C36 is simply 1.

Is there an issue with one of the arguments to the function relative to what
POI can handle?

Here's the stacktrace.

Exception in thread "main" java.lang.RuntimeException: Not implemented yet
    at
org.apache.poi.xssf.usermodel.XSSFEvaluationWorkbook.getNameXPtg(XSSFEvaluationWorkbook.java:105)
    at
org.apache.poi.ss.formula.FormulaParser.function(FormulaParser.java:916)
    at
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:556)
    at
org.apache.poi.ss.formula.FormulaParser.parseRangeable(FormulaParser.java:427)
    at
org.apache.poi.ss.formula.FormulaParser.parseRangeExpression(FormulaParser.java:266)
    at
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1117)
    at
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1077)
    at
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1064)
    at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1424)
    at
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1524)
    at
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1508)
    at
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1465)
    at
org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1445)
    at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1566)
    at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:174)
    at
org.apache.poi.xssf.usermodel.XSSFCell.convertSharedFormula(XSSFCell.java:394)
    at
org.apache.poi.xssf.usermodel.XSSFCell.getCellFormula(XSSFCell.java:368)
    at
org.apache.poi.xssf.usermodel.XSSFEvaluationWorkbook.getFormulaTokens(XSSFEvaluationWorkbook.java:146)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:277)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:44)
    at
org.apache.poi.hssf.record.formula.eval.OperandResolver.getSingleValue(OperandResolver.java:62)
    at
org.apache.poi.hssf.record.formula.eval.RelationalOperationEval.evaluate(RelationalOperationEval.java:64)
    at
org.apache.poi.hssf.record.formula.functions.Fixed2ArgFunction.evaluate(Fixed2ArgFunction.java:33)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:119)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyAreaEval.getRelativeValue(LazyAreaEval.java:51)
    at
org.apache.poi.hssf.record.formula.functions.Sumif.accumulate(Sumif.java:95)
    at
org.apache.poi.hssf.record.formula.functions.Sumif.sumMatchingCells(Sumif.java:83)
    at
org.apache.poi.hssf.record.formula.functions.Sumif.eval(Sumif.java:72)
    at
org.apache.poi.hssf.record.formula.functions.Sumif.evaluate(Sumif.java:65)
    at
org.apache.poi.hssf.record.formula.functions.Var2or3ArgFunction.evaluate(Var2or3ArgFunction.java:36)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyAreaEval.getRelativeValue(LazyAreaEval.java:51)
    at
org.apache.poi.hssf.record.formula.eval.AreaEvalBase.getValue(AreaEvalBase.java:109)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.collectValues(MultiOperandNumericFunction.java:143)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.getNumberArray(MultiOperandNumericFunction.java:127)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.evaluate(MultiOperandNumericFunction.java:89)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:44)
    at
org.apache.poi.hssf.record.formula.eval.OperandResolver.getSingleValue(OperandResolver.java:62)
    at
org.apache.poi.hssf.record.formula.eval.TwoOperandNumericOperation.singleOperandEvaluate(TwoOperandNumericOperation.java:29)
    at
org.apache.poi.hssf.record.formula.eval.TwoOperandNumericOperation.evaluate(TwoOperandNumericOperation.java:35)
    at
org.apache.poi.hssf.record.formula.functions.Fixed2ArgFunction.evaluate(Fixed2ArgFunction.java:33)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:119)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyAreaEval.getRelativeValue(LazyAreaEval.java:51)
    at
org.apache.poi.hssf.record.formula.eval.AreaEvalBase.getValue(AreaEvalBase.java:109)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.collectValues(MultiOperandNumericFunction.java:143)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.getNumberArray(MultiOperandNumericFunction.java:127)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.evaluate(MultiOperandNumericFunction.java:89)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:221)
    at
org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:257)
    at
org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:116)
    at PoiExcel.main(PoiExcel.java:29)

In order to try to debug into the method that's failing I need the source
for the XSSFEvaluationWorkbook class but it doesn't appear to be in the
poi-3.7 source download.  Is that source available somewhere?

I found a fork of the code at
http://code.google.com/p/zkpoi/source/browse/branches/zkpoi/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java?r=46and
the getNameXPtg() method simply throws the not implemented exception.
I'm guessing this is true in the Apache POI code as well.

If anyone can help me understand the issue here I'd appreciate it!

Cheers,

Chris

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message