From d38a43270fa9a682ab36a394af71e0cda89162ac Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Wed, 9 Jan 2008 20:50:00 +0000 Subject: [PATCH] Put the anchors where forrest wants them git-svn-id: https://svn.eu.apache.org/repos/asf/poi/trunk@610560 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/hssf/eval.xml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/documentation/content/xdocs/hssf/eval.xml b/src/documentation/content/xdocs/hssf/eval.xml index 197391b..1416ad7 100644 --- a/src/documentation/content/xdocs/hssf/eval.xml +++ b/src/documentation/content/xdocs/hssf/eval.xml @@ -39,8 +39,9 @@ being supported fairly frequently. + +
Status -

The code currently provides implementations for all the arithmatic operators. It also provides implementations for approx. 100 built in functions in Excel. The framework however makes is easy to add @@ -55,8 +56,9 @@ in the context of other POI excel reading code.

There are two ways in which you can use the HSSFFormulaEvalutator API.

+ +
Using HSSFFormulaEvaluator.<strong>evaluate</strong>(HSSFCell cell) - FileInputStream fis = new FileInputStream("c:/temp/test.xls"); HSSFWorkbook wb = new HSSFWorkbook(fis); @@ -98,10 +100,10 @@ switch (cellValue.getCellType()) { a simple value object and does not maintain reference to the original cell.

-
+ +
Using HSSFFormulaEvaluator.<strong>evaluateInCell</strong>(HSSFCell cell) -

evaluateInCell(HSSFCell cell) will check to see if the supplied cell is a formula cell. If it isn't, then no changes will be made to it. If it is, then the @@ -142,8 +144,9 @@ if (cell!=null) { }

+ +
Re-calculating all formulas in a Workbook - FileInputStream fis = new FileInputStream("/somepath/test.xls"); HSSFWorkbook wb = new HSSFWorkbook(fis); @@ -168,8 +171,8 @@ wb.write(new FileOutputStream("/somepath/changed.xls"));
+
Performance Notes -
  • Generally you should have to create only one HSSFFormulaEvaluator instance per sheet, but there really is no overhead in creating -- 2.11.4.GIT