jet.api
Class FormulaInfo

java.lang.Object
  extended by jet.api.FormulaInfo

public class FormulaInfo
extends java.lang.Object

The class defines a JReport Formula object. Formulas are objects that are computed at runtime, which allow you to manipulate field data by performing calculations on it. They control the data that will be displayed, and can even create new data not directly available from the database. A formula is a symbolic statement of the manipulations that are to be performed on certain data before it is printed onto your report. For example, if your report contains an @Sales field and an @Cost field, and you want to create an @GrossProfit formula, you can designate its value as @Sales - @Cost. @GrossProfit is a simple formula that tells JReport to subtract the value of the @Cost field from the value of the @Sales field, and then to print the result. Formulas can be used to calculate numeric values, compare one value to another and select alternative actions based on the comparison. Also, they can be used to join multiple text strings into a single string. In general, formulas can be used to:

Meanwhile, in JReport, there is a type of formulas which are refer to as constant level formulas. These kind of formulas never refer to a DBField, page level special fields (the value of the special field is ready at the time when the report result is generated), or other constant level formulas. The allowed constants that can be referred to by the formulas are: parameters, the special field User Name, constant values such as "aaa", and the combination of the above three.

Notes: