问题描述
我正在使用POI 3.8读取excel,我正在使用POI的用户模型api,该模型能够读取HSSF和XSSF,但是在评估公式POI 3.8时不存在问题,不支持Excle的IFERROR功能备用,我不希望将公式转换为ISERROR caz,而旧版本的excel不支持.
I am using POI 3.8 to read the excel i am using User model api of POI which is capable of reading HSSF and XSSF both but there is some problem in evaluating the fomula POI 3.8 doesnt support the IFERROR function of Excle is there any alternate and i dont want to convert the formula to ISERROR caz it not supported by older version of excel.
我知道POI 3.8不支持IFERROR,但是我能做些什么-预先感谢
I know POI 3.8 doesnt support IFERROR but what can i do to make it done -- Thanks in advance
以下是例外线程主"中的异常org.apache.poi.ss.formula.eval.NotImplementedException:计算单元格Sheet1!F1时出错在org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:356)在org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:297)在org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:229)在org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:264)在org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:117)在TestFormula.cellValue(TestFormula.java:48)在TestFormula.loadCell(TestFormula.java:37)在TestFormula.loadRows(TestFormula.java:29)在TestFormula.testRun(TestFormula.java:22)在FISValidator.main(FISValidator.java:27)引起原因:org.apache.poi.ss.formula.eval.NotImplementedException:IFERROR在org.apache.poi.ss.formula.atp.AnalysisToolPak $ NotImplemented.evaluate(AnalysisToolPak.java:40)在org.apache.poi.ss.formula.UserDefinedFunction.evaluate(UserDefinedFunction.java:64)在org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:129)在org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:491)在org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:287)
os this Following is the ExceptionException in thread "main" org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell Sheet1!F1 at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:356) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:297) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:229) at org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:264) at org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:117) at TestFormula.cellValue(TestFormula.java:48) at TestFormula.loadCell(TestFormula.java:37) at TestFormula.loadRows(TestFormula.java:29) at TestFormula.testRun(TestFormula.java:22) at FISValidator.main(FISValidator.java:27)Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: IFERROR at org.apache.poi.ss.formula.atp.AnalysisToolPak$NotImplemented.evaluate(AnalysisToolPak.java:40) at org.apache.poi.ss.formula.UserDefinedFunction.evaluate(UserDefinedFunction.java:64) at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:129) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:491) at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:287)
推荐答案
IFERROR已在poi-3.10中实现.因此,您无需黑客即可升级到该版本.
IFERROR has now been implemented in poi-3.10. So you can upgrade to that version without the need for hacks.
这篇关于POI公式评估器IFERROR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!