// activate logging to console
System.setProperty("org.apache.poi.util.POILogger", "org.apache.poi.util.SystemOutLogger");
System.setProperty("poi.log.level", POILogger.INFO + "");
-
+
// open your file
Workbook wb = new HSSFWorkbook(new FileInputStream("foobar.xls"));
- HSSFFormulaEvaluator fe = (HSSFFormulaEvaluator) wb.getCreationHelper().createFormulaEvaluator();
+ FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
// get your cell
Cell cell = wb.getSheet(0).getRow(0).getCell(0); // just a dummy example
// perform debug output for the next evaluate-call only
- fe.setDebugEvaluationOutputForNextEval(true);
+ evaluator.setDebugEvaluationOutputForNextEval(true);
evaluator.evaluateFormulaCell(cell);
evaluator.evaluateFormulaCell(cell); // no logging performed for this next evaluate-call
</source>
_bookEvaluator.setIgnoreMissingWorkbooks(ignore);
}
- /**
- * @param value whether perform detailed output
- *
- * Perform detailed output of formula evaluation for next evaluation only?
- * Is for developer use only (also developers using POI for their XLS files).
- * Log-Level WARN is for basic info, INFO for detailed information. These quite
- * high levels are used because you have to explicitly enable this specific logging.
- */
+ /** {@inheritDoc} */
public void setDebugEvaluationOutputForNextEval(boolean value){
_bookEvaluator.setDebugEvaluationOutputForNextEval(value);
}
* @param cell
*/
Cell evaluateInCell(Cell cell);
+
+ /**
+ * Perform detailed output of formula evaluation for next evaluation only?
+ * Is for developer use only (also developers using POI for their XLS files).
+ * Log-Level WARN is for basic info, INFO for detailed information. These quite
+ * high levels are used because you have to explicitly enable this specific logging.
+
+ * @param value whether to perform detailed output
+ */
+ void setDebugEvaluationOutputForNextEval(boolean value);
+
}
public void notifyUpdateCell(Cell cell) {}
public CellValue evaluate(Cell cell) {return null; }
public Cell evaluateInCell(Cell cell) { return null; }
+ public void setDebugEvaluationOutputForNextEval(boolean value) {}
+
public void evaluateAll() {}
public int evaluateFormulaCell(Cell cell) {
}
throw new RuntimeException("Unexpected eval class (" + eval.getClass().getName() + ")");
}
+
+ /** {@inheritDoc} */
+ public void setDebugEvaluationOutputForNextEval(boolean value){
+ _bookEvaluator.setDebugEvaluationOutputForNextEval(value);
+ }
+
}