Author Login
Post Reply
Hi. Now i have another problem with the evaluation of a formulacell. The
evaluate a whole spreadsheet and interate over all cell. Therefor i used the
following code:
[....]
for(Iterator<HSSFCell> cit = (Iterator<HSSFCell>)row.cellIterator();
cit.hasNext(); ) {
cell = cit.next();
if (cell.getCellType() == HSSFCell.CELL_TYPE_FORMULA) {
try {
System.out.println("Cell " + (new CellReference(row.getRowNum(),
cell.getCellNum())).formatAsString().replace("$", "") + " is checking");
cellValue = evaluator.evaluate(cell);
switch (cellValue.getCellType()) {
case HSSFCell.CELL_TYPE_ERROR:
switch (cellValue.getErrorValue()) {
case ErrorConstants.ERROR_DIV_0:
errors.add("cell.value.faulty.zerodivision"); break;
case ErrorConstants.ERROR_NAME:
errors.add("cell.value.faulty.name"); break;
case ErrorConstants.ERROR_VALUE:
errors.add("cells.value.faulty.value"); break;
default:
errors.add("cell.value.faulty");
}
}
}
catch (Exception ex) {
logger.debug(ex.toString());
}
[....]
this produce the following output:
15:21:59,574 INFO ExChecker:56 - start checking sheet "sheet2"
15:21:59,574 DEBUG ExChecker:87 - start checkFormulaCells
Cell AR1 is checking
Cell AS1 is checking
Cell AT1 is checking
Cell AP2 is checking
Cell AQ2 is checking
Cell AR2 is checking
Cell AS2 is checking
Cell AT2 is checking
Cell AU2 is checking
then nothing happens. i waited for more than 2 minutes. the prozess still
seems to work but no further output is printed. the input in cell AU2 is a
reference to cell U27 and this contains the formula
"=IF(ISERROR(ROUND((E27+O27)/$O$19;0)*$O$19);"";ROUND((E27+O27)/$O$19;0)*$O$19)"
E27 = "=IF(ISERROR(sheet3!AP21);"";IF(sheet3!AP21=0;"";sheet3!AP21))"
O27 = number value
$O$19 = double value
AP21 = text value
this are all references for AU2. why breaks the evaluate-methode there? has
anybody a solution? by the way the workbook contains 4 sheets (sheet1,
sheet2,...)
Thanks, Hardie
--
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)