com.crystaldecisions.sdk.occa.report.data
Class FormulaField

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.data.Field
      extended by com.crystaldecisions.sdk.occa.report.data.FormulaField
All Implemented Interfaces:
IField, IFormula, IFormulaField, IClone

public class FormulaField
extends Field
implements IFormulaField, IClone

This object implements a formula field in the report. Use the IFormulaField interface to access this object. To modify formula fields in a report, use the DataDefController.


Constructor Summary
FormulaField()
           
FormulaField(IFormulaField src)
           
 
Method Summary
 java.lang.Object clone(boolean deepClone)
           
 void copyTo(java.lang.Object destObject, boolean deepCopy)
           
 void doControllerModification(java.lang.Object newObject)
           
 void enumerateMembers(IMemberVisitor visitor)
           
 ControllableMixin getControllableMixin()
           
 FormulaNullTreatment getFormulaNullTreatment()
          Returns how to treat null values in the evaluation of a formula.
 boolean getIsPrintTime()
           
 boolean getIsRecurring()
           Returns true if the field is recurring, and false otherwise.
 FieldKind getKind()
           Returns what kind of field this is.
 int getOptions()
          For internal use only.
 java.lang.String getShortName(java.util.Locale locale)
           Returns the short name of the field.
 FormulaSyntax getSyntax()
          Returns the syntax used to write the formula.
 java.lang.String getText()
          Returns the formula string.
 boolean hasContent(java.lang.Object srcFormulaField)
           
 boolean isDirectlyControllable()
           
 void readElement(java.lang.String eleName, java.lang.String sVal, org.xml.sax.Attributes attrs, java.util.Map objState)
           For internal use only.
 void save(XMLWriter writer, java.lang.String sTag, XMLSerializationContext ctxt)
          For internal use only.
 void save(XMLWriter writer, XMLSerializationContext ctxt)
          For internal use only.
 void saveContents(XMLWriter writer, XMLSerializationContext ctxt)
          For internal use only.
 void setFormulaNullTreatment(FormulaNullTreatment treatment)
          Sets how to treat null values in the evaluation of a formula.
 void setOptions(int options)
          For internal use only.
 void setSyntax(FormulaSyntax syntax)
          Sets the syntax used to write the formula.
 void setText(java.lang.String text)
          Sets the formula string.
 
Methods inherited from class com.crystaldecisions.sdk.occa.report.data.Field
createMember, endElement, getAttributes, getDescription, getDisplayName, getFormulaForm, getHeadingText, getLength, getLongName, getName, getType, setAttributes, setDescription, setHeadingText, setLength, setName, setType, startElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.crystaldecisions.sdk.occa.report.data.IField
getDescription, getDisplayName, getFormulaForm, getHeadingText, getLength, getLongName, getName, getType, setDescription, setHeadingText, setLength, setName, setType
 

Constructor Detail

FormulaField

public FormulaField(IFormulaField src)

FormulaField

public FormulaField()
Method Detail

clone

public java.lang.Object clone(boolean deepClone)
Overrides:
clone in class Field

copyTo

public void copyTo(java.lang.Object destObject,
                   boolean deepCopy)
Overrides:
copyTo in class Field

getIsRecurring

public boolean getIsRecurring()
Description copied from interface: IField

Returns true if the field is recurring, and false otherwise. A field is recurring if its contents change during the formatting of a report. A constant field (not recurring) is one that doesn't change. The special field "Page Number," for example, is a recurring field, while the special field "Report Title" is not.

Specified by:
getIsRecurring in interface IField
Overrides:
getIsRecurring in class Field
Returns:
true if the field is recurring, and false otherwise.

getIsPrintTime

public boolean getIsPrintTime()
Overrides:
getIsPrintTime in class Field

getKind

public FieldKind getKind()
Description copied from interface: IField

Returns what kind of field this is. Do not confuse this property with Type. Kind identifies what sort of report field this is, while Type identifies what the field is composed of. For example, a bitmap, string, chart, number, date, and so on.

Specified by:
getKind in interface IField
Returns:
A String that specifies what kind of field this is.

getOptions

public int getOptions()
Description copied from interface: IFormulaField

For internal use only.

Specified by:
getOptions in interface IFormulaField

getShortName

public java.lang.String getShortName(java.util.Locale locale)
Description copied from interface: IField

Returns the short name of the field.

Specified by:
getShortName in interface IField
Overrides:
getShortName in class Field
Parameters:
locale - The locale that will be used to localize the field name.
Returns:
A String containing the short name of the field.

getSyntax

public FormulaSyntax getSyntax()
Description copied from interface: IFormula

Returns the syntax used to write the formula.

Specified by:
getSyntax in interface IFormula
Returns:
The FormulaSyntax object.

getText

public java.lang.String getText()
Description copied from interface: IFormula

Returns the formula string.

Specified by:
getText in interface IFormula
Returns:
The formula as a String.

getFormulaNullTreatment

public FormulaNullTreatment getFormulaNullTreatment()
Description copied from interface: IFormula

Returns how to treat null values in the evaluation of a formula.

By default, null values are treated as exceptions, which means that as soon as RAS encounters a null valued field in a formula, it immediately stops evaluating the formula and produces no value.

If you want to handle null field values in your formula, you must explicitly do so by adding a test function such as IsNull(). You also have the option to treat nulls as default values. The following are the default values for different types used in a formula.

Specified by:
getFormulaNullTreatment in interface IFormula
Returns:
The FormulaNullTreatment object that specifies how to treat null values in the evaluation of a formula.

hasContent

public boolean hasContent(java.lang.Object srcFormulaField)
Overrides:
hasContent in class Field

readElement

public void readElement(java.lang.String eleName,
                        java.lang.String sVal,
                        org.xml.sax.Attributes attrs,
                        java.util.Map objState)
Description copied from class: Field

For internal use only.

Overrides:
readElement in class Field

save

public void save(XMLWriter writer,
                 XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Overrides:
save in class Field
Throws:
java.io.IOException

save

public void save(XMLWriter writer,
                 java.lang.String sTag,
                 XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Overrides:
save in class Field
Throws:
java.io.IOException

saveContents

public void saveContents(XMLWriter writer,
                         XMLSerializationContext ctxt)
                  throws java.io.IOException

For internal use only.

Overrides:
saveContents in class Field
Throws:
java.io.IOException

setOptions

public void setOptions(int options)
Description copied from interface: IFormulaField

For internal use only.

Specified by:
setOptions in interface IFormulaField

setSyntax

public void setSyntax(FormulaSyntax syntax)
Description copied from interface: IFormula

Sets the syntax used to write the formula.

Specified by:
setSyntax in interface IFormula
Parameters:
syntax - The FormulaSyntax object.

setText

public void setText(java.lang.String text)
Description copied from interface: IFormula

Sets the formula string.

Specified by:
setText in interface IFormula
Parameters:
text - The formula as a String.

setFormulaNullTreatment

public void setFormulaNullTreatment(FormulaNullTreatment treatment)
Description copied from interface: IFormula

Sets how to treat null values in the evaluation of a formula.

By default, null values are treated as exceptions, which means that as soon as RAS encounters a null valued field in a formula, it immediately stops evaluating the formula and produces no value.

If you want to handle null field values in your formula, you must explicitly do so by adding a test function such as IsNull(). You also have the option to treat nulls as default values. The following are the default values for different types used in a formula.

Specified by:
setFormulaNullTreatment in interface IFormula
Parameters:
treatment - The FormulaNullTreatment object that specifies how to treat null values in the evaluation of a formula.

getControllableMixin

public ControllableMixin getControllableMixin()
Overrides:
getControllableMixin in class Field

doControllerModification

public void doControllerModification(java.lang.Object newObject)
                              throws ReportSDKException
Throws:
ReportSDKException

isDirectlyControllable

public boolean isDirectlyControllable()

enumerateMembers

public void enumerateMembers(IMemberVisitor visitor)