poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khanh Tran" <trancongkh...@gmail.com>
Subject POI formula syntax checking?
Date Tue, 02 Jan 2007 08:15:41 GMT
Dear experts,
I am using Formula Evaluator package to evaluate some Excel functions. When
I enter the correct formula syntax, it works fine. But when I enter
incorrect formula syntax, it does not throws any error message. I want to
retreive the error messages related to my wrong syntax.
Here is the code:
//it works fine with correct formula syntax
HSSFFormulaEvaluator.CellValue cellValue = evaluator.evaluate(cell);
//Cannot get error message
cell.setCellFormula("Upper(\"abc\", \"def\")"); //incorrect formula syntax
HSSFFormulaEvaluator.CellValue cellValue = evaluator.evaluate(cell);
assert(cellValue.cellType = CELL_TYPE_ERROR);

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message