aboutsummaryrefslogtreecommitdiffstats
path: root/src/documentation/content/xdocs
diff options
context:
space:
mode:
authorEvgeniy Berlog <berlog@apache.org>2012-09-04 21:00:41 +0000
committerEvgeniy Berlog <berlog@apache.org>2012-09-04 21:00:41 +0000
commit5bff0701fc08dcded7f38a709ad1147851e88918 (patch)
tree0532a4a8bf8012d0d181e7108b371908d11ec11e /src/documentation/content/xdocs
parent03d0088065d5cbd0c4e5620d527358584d3bcf5e (diff)
downloadpoi-5bff0701fc08dcded7f38a709ad1147851e88918.tar.gz
poi-5bff0701fc08dcded7f38a709ad1147851e88918.zip
resolved bugzilla ticket 53642
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1380882 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/documentation/content/xdocs')
-rw-r--r--src/documentation/content/xdocs/spreadsheet/eval.xml32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/documentation/content/xdocs/spreadsheet/eval.xml b/src/documentation/content/xdocs/spreadsheet/eval.xml
index 5ff76effb5..7cb6700196 100644
--- a/src/documentation/content/xdocs/spreadsheet/eval.xml
+++ b/src/documentation/content/xdocs/spreadsheet/eval.xml
@@ -42,7 +42,7 @@
<section><title>Status</title>
<p> The code currently provides implementations for all the arithmatic operators.
It also provides implementations for approx. 140 built in
- functions in Excel. The framework however makes is easy to add
+ functions in Excel. The framework however makes it easy to add
implementation of new functions. See the <link href="eval-devguide.html"> Formula
evaluation development guide</link> and <link href="../apidocs/org/apache/poi/hssf/record/formula/functions/package-summary.html">javadocs</link>
for details. </p>
@@ -249,7 +249,7 @@ for(int sheetNum = 0; sheetNum &lt; wb.getNumberOfSheets(); sheetNum++) {
existing workbooks with formulas. This can be done in two ways:
</p>
<p>
- 1. Re-evaluate formuals with POI's FormulaEvaluator:
+ 1. Re-evaluate formulas with POI's FormulaEvaluator:
</p>
<source>
Workbook wb = WorkbookFactory.create(new FileInputStream("workbook.xls"));
@@ -308,5 +308,33 @@ for(int sheetNum = 0; sheetNum &lt; wb.getNumberOfSheets(); sheetNum++) {
</li>
</ul>
</section>
+ <section><title>Formula Evaluation Debugging</title>
+ <p>POI is not perfect and you may stumble across formula evaluation problems (Java exceptions
+ or just different results) in your special use case. To support an easy detailed analysis, a special
+ logging of the full evaluation is provided.</p>
+ <p>The output of this logging may be very large (depends on your EXCEL), so this logging has to be explicitly enabled
+ for each single formula evaluation. Should not be used in production - only for specific development use.</p>
+ <p>Example use:</p>
+ <source>
+ // 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();
+
+ // 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.evaluateFormulaCell(cell);
+ evaluator.evaluateFormulaCell(cell); // no logging performed for this next evaluate-call
+ </source>
+ <p>The special Logger called "POI.FormulaEval" is used (useful if you use the CommonsLogger and a detailed logging configuration).
+ The used log levels are WARN and INFO (for detailed parameter info and results) - the level are so high to allow this
+ special logging without beeing disturbed by the bunch of DEBUG log entries from other classes.</p>
+ </section>
</body>
</document>