DBFields, or database fields, are fields directly from databases, user data sources, hierarchical data sources, or other data sources.
DBFields can be inserted in the report areas listed in Component placement.
To insert a DBField into a report, you can use either of the following two ways:
on the Insert toolbar.The Insert Fields dialog appears. See the dialog.
In the Resource View panel, select a dataset from the dataset drop-down list, then select the required DBField and drag it to the destination.
When a DBField 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:
To add a summary for a DBField:
For more information, see Inserting a summary in a report.
The display type of a DBField can be changed, that is to say, you can map the DBField to another value or image to be displayed instead.
To change the display type a DBField:
For details about display types, see Changing the display type of a label.
A DBField can be bound with some web actions. This allows you to customize a DBField to make it respond to some events, and execute corresponding actions, such as sorting and filtering.
To apply web actions to a DBField:
that appears in the text box.
in the Display Type dialog to add more web behavior lines and specify the events and actions accordingly. If a web behavior is not required, click
to remove it.
or
. Then, when an event that has been bound with more than one action happens, the upper action will be triggered first.For more information about web actions, see Applying web actions to a label.
You can make a DBField linked with another report, a location specified by a URL, an e-mail address, or a Blob data type field. 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 DBField:
For details about different link targets, see Binding a link to a label.
You can add some conditional formats to a DBField, 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 DBField:
on the Format toolbar.The Conditional Formatting dialog appears. See the dialog.
above the Condition box. The Edit Conditions dialog appears. See the dialog.
To edit a condition, select the condition from the Condition box, click
, then edit the condition in the Edit Conditions dialog.
To adjust the priority of the conditions, select a condition and click the High or Low button.
To remove a condition and the corresponding format, select the condition from the Condition box and then click
.
When a report has many DBFields, you may find it difficult to locate where a certain field is. To easily find out the field you have lost track of in your report, you can make use of the Find DBField feature.
To find a DBField in a report:
on the Standard toolbar. The Find dialog appears. See the dialog.
Tip: Besides DBFields, formula fields used in the report will also be listed in the Find What drop-down list, so you can also use this dialog to locate a formula in a report.
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 DBField component example, open <install_root>\Demo\Reports\SampleComponents\ForDBField.cls.