When evaluation an SXSSFCell containing a formula, the value of the cell is always cleared. In the following code, I would expect the output to be 3.0, but it is 0.0. If I instead created the Workbook as an XSSFWorkbook, the code works as expected. final Workbook wb = new SXSSFWorkbook(); final Cell cell = wb.createSheet().createRow(0).createCell(0); cell.setCellFormula("1+2"); wb.getCreationHelper().createFormulaEvaluator().evaluateInCell(cell); System.out.println(cell.toString()); wb.close();
FYI, I have a fix pending for this that is waiting for another fix to land. When this is done, we should check if it also solves bug 60302 by fixing the cached formula content.
*** Bug 61532 has been marked as a duplicate of this bug. ***
Fixed some related problem with SXSSF via r1808874 and the core issue reported here via r1808929, unfortunately a slight hack needed to be employed, see the fix for details. So this should be fixed now.