Question

I'm starting to build an app (in java) and I am having some problems.I'm pretty new with all that and I'm getting a little lost.

I am trying to export some info to an excel template. I have no problem with that, but the template has some excel formulas.

When I open the template all the info is there, but in order to see the results of the formulas i have to copy/paste all the values given by the app.

I've found a sentence to update all the formulas

workbookInfDef.getCreationHelper().createFormulaEvaluator().evaluateAll();

But it doesn't work. An error stop happens with it and the app collapses...

I would be really greatfull if anyone could help me!

Was it helpful?

Solution

f you're using XSSF workbooks, you can re-evaluate all formula cells as follows:

XSSFFormulaEvaluator.evaluateAllFormulaCells(workbook)

A similar API exists if you're using an HSSF workbook:

HSSFFormulaEvaluator.evaluateAllFormulaCells(workbook)

Or, depending on exactly how you're set up and what specifically you're trying to get accomplished, you should be able to find your solution here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top