BackPrevious Page Next PageNext

DBFields

Inserting a DBField in a report

Adding a summary for a DBField

Changing the display type of a DBField

Applying web actions to a DBField

Binding a link to a DBField

Adding conditional formats to a DBField

Searching for a specific DBField in a report

In a query based report, the DBFields or database fields refer to fields directly from databases, user data sources, hierarchical data sources, or other data sources; in a business view based report, they are the group and details objects in the business view.

Inserting a DBField in a report

DBFields can be inserted in the report areas listed in Component placement.

Notes:

Adding a summary for a DBField

In a query based report, you can add a summary for a DBField as follows:

  1. Select the DBField, then do one of the following:

    The Insert Summary dialog appears.

    Insert Summary dialog

  1. From the Aggregate Function drop-down list, specify the function of the summary.
  2. If the report is grouped, select to which group level the summary will be applied from the Group By drop-down list. If None is select, the summary will be added based on the whole report.
  3. Click the Insert button.

    A summary with the default name Function_DBFieldName is then created in the same catalog data source as the query and is available under the Summaries node in the Data panel. You can drag it to use in the report.

Changing the display type of a DBField

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 of a DBField:

  1. Right-click the DBField and select Display Type from the shortcut menu.
  2. In the Display Type dialog, specify the required display type in the Display As box, and set the options for the selected type in the Web Options panel.
  3. Upon finishing, click the OK button to close the dialog.

For details about display types, see Changing the Display Type of a Label.

Applying web actions to a DBField

A DBField can be bound with web actions. This allows you to customize a DBField to make it respond to interactive events, and execute corresponding actions, such as sorting and filtering.

To apply web actions to a DBField:

  1. Right-click the DBField and select Display Type from the shortcut menu.
  2. In the Web Behaviors box of the Display Type dialog, choose an event from the Events column, then click in the Actions column and click Choose button that appears in the text box.
  3. In the Web Action List dialog, select a web action and define the action as required.
  4. Click Add button 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 Delete button to remove it.
  5. Adjust the order of the added web actions by clicking Move Up button or Move Down button. Then, when an event that has been bound with more than one action happens, the upper action will be triggered first.
  6. When done , click OK to accept the settings.

For more information about web actions, see Applying Web Actions to a Label.

Binding a link to a DBField

You can make a DBField link to 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 links, different targets can be loaded based on different conditions.

To bind a link to a DBField:

  1. Right-click the DBField and click Link on the shortcut menu.
  2. In the Insert Link dialog, specify whether it is a conditional link or a simple link, then select the link target and set the options for the link target as required.
  3. When done, click OK.

For details about different link targets, see Binding a Link to a Label.

Adding conditional formats to a DBField

You can add 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. This is very useful to highlight values that might need to be acted on by the end user.

To add conditional formats to a DBField:

  1. Select the DBField and then do one of the following:

    The Conditional Formatting dialog appears.

    Conditional Formatting dialog

  2. Click Add button above the Condition box. The Edit Conditions dialog appears.

    Edit Conditions dialog

  3. Click the Add Condition button to add a condition line.
  4. From the field drop-down list, select the field on which the condition will be based. You can also select the special field User Name or Page Number to compose the condition. If Page Number is selected, the format will be applied to the field values on the pages meet the condition at runtime.
  5. Choose the operator with which to compose the condition expression from the operator drop-down list.
  6. From the value drop-down list, specify the value of how to build the condition. You can also type in the value manually.
  7. Click Add Condition to add more condition lines and define the logic between the condition lines.

    To make some condition lines grouped, select them and click the Group button, then the selected condition lines will be added in one group and work as one line of filter expression. Conditions and groups together can be further grouped. To take any condition or group in a group out, select it and click Ungroup.

    To adjust the priority of the condition lines, select it and click the Up or Down button.

    To delete a condition line, select it and click the Delete button.

  8. Click OK to save the condition.

    The newly added condition is then displayed and highlighted in the Condition box in the Conditional Formatting dialog.

  9. In the Format box, set the format which will be applied to values of the DBField when the specified condition is fulfilled, such as the font face, font size, font color and so on.
  10. Repeat the above steps to add more conditions and define the format for each condition.

    To edit a condition, select the condition from the Condition box, click Edit button, 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 Delete button.

  11. When done, click OK to save the settings.

Searching for a specific DBField in a report

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:

  1. Click Home> Find. The Find dialog appears.

    Find dialog

  2. Select the field you want to locate from the Find What drop-down list.

    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.

  3. Specifies the criteria with which to find the field.
  4. Click the Find Next button and the specified field will be selected in the 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.

BackPrevious Page Next PageNext