输出错误是这个: com.scudata.common.RQException: 单元格 A2 中有错误 Error evaluating cell A105000 纳税调整项目明细表!E35 at com.scudata.expression.mfn.xo.XlsCell.calculate(Unknown Source:217) at com.scudata.expression.operator.DotOperator.calculate(Unknown Source:77) at com.scudata.expression.Expression.calculate(Unknown Source:143) at com.scudata.cellset.datamodel.PgmNormalCell.calculate(Unknown Source:159) at com.scudata.cellset.datamodel.PgmCellSet._$1(Unknown Source:1894) at com.scudata.cellset.datamodel.PgmCellSet.runNext(Unknown Source:2010) at com.scudata.ide.spl.SheetSpl$RunThread.run(SheetSpl.java:1371) Caused by: com.scudata.common.RQException: Error evaluating cell A105000 纳税调整项目明细表!E35 at com.scudata.excel.SheetXls.getCells(SheetXls.java:760) at com.scudata.excel.XlsFileObject.xlscell(XlsFileObject.java:312) at com.scudata.expression.mfn.xo.XlsCell.calculate(Unknown Source:214) … 6 more
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell A105000 纳税调整项目明细表!E35 at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:344) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:285) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:216) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCellValue(HSSFFormulaEvaluator.java:200) at org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluate(BaseFormulaEvaluator.java:109) at com.scudata.excel.ExcelUtils.getRowData(ExcelUtils.java:631) at com.scudata.excel.SheetXls.readLine(SheetXls.java:224) at com.scudata.excel.SheetXls.getCells(SheetXls.java:789) at com.scudata.excel.SheetXls.getCells(SheetXls.java:758) … 8 more
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell A105000 纳税调整项目明细表!E36 at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:344) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:285) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:798) at org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:48) at org.apache.poi.ss.formula.SheetRangeEvaluator.getEvalForCell(SheetRangeEvaluator.java:74) at org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:39) at org.apache.poi.ss.formula.eval.OperandResolver.chooseSingleElementFromRef(OperandResolver.java:217) at org.apache.poi.ss.formula.eval.OperandResolver.getSingleValue(OperandResolver.java:67) at org.apache.poi.ss.formula.eval.TwoOperandNumericOperation.singleOperandEvaluate(TwoOperandNumericOperation.java:32) at org.apache.poi.ss.formula.eval.TwoOperandNumericOperation.evaluate(TwoOperandNumericOperation.java:59) at org.apache.poi.ss.formula.functions.Fixed2ArgFunction.evaluate(Fixed2ArgFunction.java:33) at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:140) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:541) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:275) … 15 more
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell ‘A105080 资产折旧、摊销及纳税调整明细表’!L52 at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:344) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:285) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:798) at org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:48) at org.apache.poi.ss.formula.SheetRangeEvaluator.getEvalForCell(SheetRangeEvaluator.java:74) at org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:39) at org.apache.poi.ss.formula.eval.OperandResolver.chooseSingleElementFromRef(OperandResolver.java:217) at org.apache.poi.ss.formula.eval.OperandResolver.getSingleValue(OperandResolver.java:67) at org.apache.poi.ss.formula.eval.RelationalOperationEval.evaluate(RelationalOperationEval.java:66) at org.apache.poi.ss.formula.functions.Fixed2ArgFunction.evaluate(Fixed2ArgFunction.java:33) at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:140) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:541) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:275) … 27 more
可以加下输出 看下对应的 C6,B6 的值都是什么。还有,看下第 6 行的 for 循环,A2:A5 是否需要包含 A5,以及后边那个 D5
D18 是啥?是不是用了 POI 未支持的函数,参考https://blog.csdn.net/wengengeng/article/details/52664683
方便的话可以发一下 IDE 界面右下的“输出”里的完整信息。
单独读取这个单元格也是这个错误
单元格是公试,引用的有些单元格也是公式
输出错误是这个:
com.scudata.common.RQException: 单元格 A2 中有错误
Error evaluating cell A105000 纳税调整项目明细表!E35
at com.scudata.expression.mfn.xo.XlsCell.calculate(Unknown Source:217)
at com.scudata.expression.operator.DotOperator.calculate(Unknown Source:77)
at com.scudata.expression.Expression.calculate(Unknown Source:143)
at com.scudata.cellset.datamodel.PgmNormalCell.calculate(Unknown Source:159)
at com.scudata.cellset.datamodel.PgmCellSet._$1(Unknown Source:1894)
at com.scudata.cellset.datamodel.PgmCellSet.runNext(Unknown Source:2010)
at com.scudata.ide.spl.SheetSpl$RunThread.run(SheetSpl.java:1371)
Caused by: com.scudata.common.RQException: Error evaluating cell A105000 纳税调整项目明细表!E35
at com.scudata.excel.SheetXls.getCells(SheetXls.java:760)
at com.scudata.excel.XlsFileObject.xlscell(XlsFileObject.java:312)
at com.scudata.expression.mfn.xo.XlsCell.calculate(Unknown Source:214)
… 6 more
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell A105000 纳税调整项目明细表!E35
at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:344)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:285)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:216)
at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCellValue(HSSFFormulaEvaluator.java:200)
at org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluate(BaseFormulaEvaluator.java:109)
at com.scudata.excel.ExcelUtils.getRowData(ExcelUtils.java:631)
at com.scudata.excel.SheetXls.readLine(SheetXls.java:224)
at com.scudata.excel.SheetXls.getCells(SheetXls.java:789)
at com.scudata.excel.SheetXls.getCells(SheetXls.java:758)
… 8 more
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell A105000 纳税调整项目明细表!E36
at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:344)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:285)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:798)
at org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:48)
at org.apache.poi.ss.formula.SheetRangeEvaluator.getEvalForCell(SheetRangeEvaluator.java:74)
at org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:39)
at org.apache.poi.ss.formula.eval.OperandResolver.chooseSingleElementFromRef(OperandResolver.java:217)
at org.apache.poi.ss.formula.eval.OperandResolver.getSingleValue(OperandResolver.java:67)
at org.apache.poi.ss.formula.eval.TwoOperandNumericOperation.singleOperandEvaluate(TwoOperandNumericOperation.java:32)
at org.apache.poi.ss.formula.eval.TwoOperandNumericOperation.evaluate(TwoOperandNumericOperation.java:59)
at org.apache.poi.ss.formula.functions.Fixed2ArgFunction.evaluate(Fixed2ArgFunction.java:33)
at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:140)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:541)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:275)
… 15 more
后面的都一样
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell ‘A105080 资产折旧、摊销及纳税调整明细表’!L52
at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:344)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:285)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:798)
at org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:48)
at org.apache.poi.ss.formula.SheetRangeEvaluator.getEvalForCell(SheetRangeEvaluator.java:74)
at org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:39)
at org.apache.poi.ss.formula.eval.OperandResolver.chooseSingleElementFromRef(OperandResolver.java:217)
at org.apache.poi.ss.formula.eval.OperandResolver.getSingleValue(OperandResolver.java:67)
at org.apache.poi.ss.formula.eval.RelationalOperationEval.evaluate(RelationalOperationEval.java:66)
at org.apache.poi.ss.formula.functions.Fixed2ArgFunction.evaluate(Fixed2ArgFunction.java:33)
at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:140)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:541)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:275)
… 27 more
按照你的描述,我测试了下,xls 的 A1 至 A5,写成:
=DATEDIF(“2020-1-1”,“2021-3-4”,“m”)
1
2
3.1415926
=ROUND(A1+A2+A3+A4,2)
SPL:
=file(“xls.xls”).xlsopen()
=A1.xlscell(“A5”,“Sheet1”)
报错如下:
com.scudata.common.RQException: 单元格 A2 中有错误
Error evaluating cell Sheet1!A5
at com.scudata.expression.mfn.xo.XlsCell.calculate(XlsCell.java:217)
…
Caused by: com.scudata.common.RQException: Error evaluating cell Sheet1!A5
at com.scudata.excel.SheetXls.getCells(SheetXls.java:760)
…
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell Sheet1!A5
at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:344)
…
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell Sheet1!A1
at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:344)
…
Caused by: org.apache.poi.ss.formula.eval.NotImplementedFunctionException: DATEDIF
at org.apache.poi.ss.formula.functions.NotImplementedFunction.evaluate(NotImplementedFunction.java:40)
…
我觉得有可能是 round 里面引用的其他单元格里的某些公式不支持导致的,方便的话可以发下报错使用的 xls 文件。
确实有单元格引用了 DATEDIF() 函数
这个问题是没办法解决?
有办法,稍后发个 jar,可以替换下试试
https://note.youdao.com/s/akdq4R9p
替换安装目录 /esProc/lib 下的同名文件(esproc-bin-xxx.jar)
替换文件后上面报错的问题解决了,谢谢
还有一个问题,excel 单元格有引用外部文件,文件不存在时也会报错,能不能象 excel 那样没有外部文件也不报错,保存现值
https://note.youdao.com/s/akdq4R9p
更新了 jar,再替换下试试
可以了,谢谢