Formula fields are calculated from DBFields, other formulas, summaries, and parameters, so they can present information that DBFields cannot do.
A formula field can be inserted in the report areas listed in Component placement. Before you can insert a formula field into a report, you need to define it. For details about how to define formulas, see Creating a formula.
To insert a formula field into a report, you can use either of the following two ways:
The Insert Fields dialog appears. See the dialog.
Select the required formula from the Formulas node of the Resource View panel, then drag it to the destination.
When a formula field has been inserted into a report, you can customize its appearance and behavior by setting properties in the Report Inspector, which can be saved as a CSS style for future use (for details, see Creating a CSS style).
Notes:
The display type of a formula field can be changed, that is to say, you can map the formula field to another value or image to be displayed instead.
To change the display type a formula field:
For details about display types, see Changing the display type of a label.
You can make a formula field linked with another report, a location specified by a URL or an e-mail address. The link can either be a simple link or a conditional link. With conditional link, different targets can be loaded based on different conditions.
To bind a link to a formula field:
For details about different link targets, see Binding a link to a label.
You can add some conditional formats to a formula field, then when a specified condition is fulfilled, the format bound with the condition will be applied to the field values automatically for distinguishing.
To add conditional formats to a formula field:
For more details about conditional formatting, see Adding conditional formats to a DBField.
See an example: The SampleComponents catalog, included with JReport Designer, contains reports that have examples of how each component type could be used in a report. For the formula field example, open <install_root>\Demo\Reports\SampleComponents\UsingFormula.cls
.