Tag
public class FormulaTag extends BaseTag
A FormulaTag
represents a dynamically generated Excel
Formula. The text
attribute contains formula text that may
contain Expressions that are dynamically evaluated. JETT does not verify
that the dynamically generated expression is a valid Excel Formula. A
FormulaTag
must be bodiless.
BaseTag
.String
String
Either "text" or "bean" must be specified, but not both.
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
ATTR_BEAN |
Attribute that specifies the bean name that contains the Expression
string to be evaluated by JETT that results in formula creation in the
cell.
|
static java.lang.String |
ATTR_IF_ERROR |
Attribute that specifies the Expression string to be evaluated by JETT
to be used as alternative text in case an Excel error results.
|
static java.lang.String |
ATTR_TEXT |
Attribute that specifies the Expression string to be evaluated by JETT
that results in formula creation in the cell.
|
ATTR_ON_PROCESSED, SPEC_SEP
Constructor | Description |
---|---|
FormulaTag() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getName() |
Returns this
Tag's name. |
protected java.util.List<java.lang.String> |
getOptionalAttributes() |
Returns a
List of optional attribute names. |
protected java.util.List<java.lang.String> |
getRequiredAttributes() |
Returns a
List of required attribute names. |
boolean |
process() |
Evaluate the "text" attribute, and place the resultant text in an
Excel Formula.
|
void |
validateAttributes() |
Validates the attributes for this
Tag . |
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getLocation, getParentTag, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setParentTag, setWorkbookContext
public static final java.lang.String ATTR_BEAN
bean="beanName" => "${beanName}" => "formula"
.
Then the value is used as the formula expression, i.e. formula =>
"${wins} + ${losses}" => "A2 + B2"
, which is used as the formula
text. Either "bean" or "text" must be specified, but not both.public static final java.lang.String ATTR_TEXT
text="${wins} + ${losses}" => "A2 + B2"
, which is used as
the formula text. Either "bean" or "text" must be specified, but not
both.public static final java.lang.String ATTR_IF_ERROR
public java.lang.String getName()
Tag's
name.Tag's
name.protected java.util.List<java.lang.String> getRequiredAttributes()
List
of required attribute names.getRequiredAttributes
in class BaseTag
List
of required attribute names.protected java.util.List<java.lang.String> getOptionalAttributes()
List
of optional attribute names.getOptionalAttributes
in class BaseTag
List
of optional attribute names.public void validateAttributes() throws TagParseException
Tag
. This tag must be
bodiless.validateAttributes
in class BaseTag
TagParseException
- If the attribute values are illegal or
unacceptable.public boolean process()
Evaluate the "text" attribute, and place the resultant text in an Excel Formula. If the "ifError" attribute is supplied, then wrap the formula in an "IF(ISERROR(formula), ifError, formula)" formula.
Copyright © 2012–2018 Jett Team. All rights reserved.