When running HSSFFormulaEvaluator.evaluateAllFormulaCells(wb); the following exception occurs: java.lang.IllegalArgumentException: Array size should be (0) but was (114) at org.apache.poi.hssf.record.formula.eval.AreaEvalBase.<init>(AreaEvalBase.java:50) at org.apache.poi.hssf.record.formula.eval.Area3DEval.<init>(Area3DEval.java:32) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateArea3dPtg(HSSFFormulaEvaluator.java:510) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateCell(HSSFFormulaEvaluator.java:414) 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 inavero.excelReporter.Generator.start(Generator.java:59) at inavero.excelReporter.App$2.handleEvent(App.java:58) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at inavero.excelReporter.App.main(App.java:70) I will try and put together a sanitized spreadsheet as soon as I can that still reproduces the error.
Alas without the sample spreadsheet, we won't be able to figure out what's going wrong (none of our current tests manage to trigger this) If you could please upload a spreadsheet that triggers this, that'd be wonderful. (You'll probably find that replacing all the strings and numbers with dummy values using poi will yield a file that triggers the error, but is uploadable to bugzilla)
I have the same issue and it is reproduced by the VLOOKUP function for example : VLOOKUP(D28;$Z$129:$AE$276;2;0) All the data within the VLOOKUP does not contain functions. Kind regards
Created attachment 22446 [details] Template that produce the error This file produce a similar error: java.lang.IllegalArgumentException: Array size should be (-2) but was (1998) at org.apache.poi.hssf.record.formula.eval.AreaEvalBase.<init>(AreaEvalBase.java:50) at org.apache.poi.hssf.record.formula.eval.Area3DEval.<init>(Area3DEval.java:32) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateArea3dPtg(HSSFFormulaEvaluator.java:510) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateCell(HSSFFormulaEvaluator.java:414) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.internalEvaluate(HSSFFormulaEvaluator.java:338) at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCell(HSSFFormulaEvaluator.java:183) I hope that it is a help to resolve the problem. PS: The file is compress because it's was so big.
There were 3 problems encountered getting the sample spreadsheet to work with HSSFFormulaEvaluator.evaluateAllFormulaCells(wb). The first bug was that 3-d area refs like "Sheet1!A10:A40000" had a 16-bit signed/unsigned error. Fixed and junit added in svn r690772. Secondly there was a major performance problem with all the recursive evaluation of the large areas referenced by the formulas. Before the fix, evaluation was extremely slow (a test run was terminated after 4 minutes, with no sign of progress). After the fix, the whole spreadsheet evaluates in about 10 seconds. It's also likely that the fix for bug 45376 (when it happens) will alleviate things further. This was fixed in r690835. Lastly there was a ClassCastException in the implementation of 'IF' due to the first arg not being a plain BoolEval. Fix and junit added in svn r690836.