From 027375b75e2f095feb4e2ae7b891bd2214c94b99 Mon Sep 17 00:00:00 2001 From: Avik Sengupta Date: Tue, 28 May 2002 12:42:57 +0000 Subject: [PATCH] documentation for formula git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352655 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/xdocs/hssf/book.xml | 1 + src/documentation/xdocs/hssf/formula.xml | 90 ++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 src/documentation/xdocs/hssf/formula.xml diff --git a/src/documentation/xdocs/hssf/book.xml b/src/documentation/xdocs/hssf/book.xml index 672b815517..85167cf983 100644 --- a/src/documentation/xdocs/hssf/book.xml +++ b/src/documentation/xdocs/hssf/book.xml @@ -12,6 +12,7 @@ + diff --git a/src/documentation/xdocs/hssf/formula.xml b/src/documentation/xdocs/hssf/formula.xml new file mode 100644 index 0000000000..d3003d8b94 --- /dev/null +++ b/src/documentation/xdocs/hssf/formula.xml @@ -0,0 +1,90 @@ + + + + +
+ Formula Support + + + +
+ +
+

+ This document describes the current state of formula support in POI. + The information in this document applies to the 2.0-dev version of POI (i.e. CVS HEAD). + Since this area is a work in progress, this document will be updated with new features as and + when they are added. +

+ +
+
+

+ In org.apache.poi.hssf.usermodel.HSSFCell + setCellFormula("formulaString") is used to add a formula to sheet and + getCellFormula() is used to retrieve the string representation of a formula. +

+

+ We aim to support the complete excel grammer for formulas. Thus, the string that you pass in + to the setCellFormula call should be what you expect to type into excel. Also, note + that you should NOT add a "=" to the front of the string. +

+
+
+
    +
  • Cell References
  • +
  • String, integer and floating point literals
  • +
  • Area references
  • +
  • Relative or absolute references
  • +
  • Arithmetic Operators
  • +
  • Sheet Functions
  • +
+
+
+
    +
  • + The formula parser now has the ability to parse formulas containing strings. However + formulas that return a string value are not yet supported. +
  • +
  • Formula tokens in Excel are stored in one of three possible classes : + Reference, Value and Array. Based on the location of a token, its class can change + in complicated and undocumented ways. While we have support for most cases, we + are not sure if we have covered all bases (since there is no documentation for this area.) + We would therefore like you to report any + occurence of #VALUE! in a cell upon opening a POI generated workbook in excel. (Check that + typing the formula into Excel directly gives a valid result.) +
  • + +
+
+
+
    +
  • Array formulas
  • +
  • Formulas with logical operations (IF)
  • +
  • Sheet References in formulas
  • +
  • Everything else :)
  • +
+
+ +
+

+ Formulas in Excel are stored as sequences of tokens in Reverse Polish Notation order. The + open office XLS spec is the best + documentation you will find for the format. +

+ +

+ The tokens used by excel are modelled as individual *Ptg classes in the + org.apache.poi.hssf.record.formula package. +

+

+ The task of parsing a formula string into an array of RPN ordered tokens is done by the + org.apache.poi.hssf.record.formula.FormulaParser class. This class implements a hand + written recursive descent parser. +

+

Check out the javadocs for details. +

+
+ + +
\ No newline at end of file