Closed StanBertrand closed 3 years ago
Tried FormulaEvaluator?
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator;
FormulaEvaluator evaluator = new XSSFFormulaEvaluator(new XSSFWorkbook());
FormulaEvaluator evaluator = new HSSFFormulaEvaluator(new HSSFWorkbook());
or
FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
Usage:
evaluator.evaluateFormulaCell(cell);
XSSFFormulaEvaluator.evaluateAllFormulaCells(wb);
Hello !
Thanks for your answer, but when I try to use CellValue cellValue = evaluator.evaluate(cell)
, I get these results :
N.B : my cell type is NUMERIC
Hello !
I'm trying to get the unformatted value of a cell. For example, I have a cell with this value :
1049
and this numericFormat :\€#,##0.00
€1 049,00
1049.0
None of those returns the raw cell content, i.e. 1049 Is it possible to have a getter on rawContents in StreamingCell or a method which return unformatted String value ?
Thanks in advance.