BackPrevious Page Next PageNext

Using Dynamic Resources and Local Parameters

Creating and using dynamic formulas

Creating and using dynamic aggregations

Creating and using local parameters

When you add fields to a report or use parameters to define filter conditions in a report, sometimes you may find that the view elements that have been predefined in the business view or the given parameters in the current catalog cannot meet your requirements. In those cases, you can create dynamic resources (including formulas and aggregations) and local parameters in the report and use them to get the desired data. Then when you save the report, the dynamic resources and local parameters will be saved along with the report as its resources.

Dynamic resources and local parameters are report level resources, which means they are only available to the report for which they are created.

Creating and using dynamic formulas

You should have some knowledge of the formula syntax before you can successfully compose a formula with no errors. To learn the formula syntax, refer to Formula Syntax.

To create a dynamic formula:

  1. In the Resources panel of Web Report Studio or the Resources box of the Web Report Wizard, expand the Dynamic Resource > Formulas node, then click <Add Formula…>. The Formula Editor appears.

    Formula Editor

  2. Enter a name for the formula in the Formula Name text field.
  3. By default, JReport will decide whether the formula can be used as an aggregation object, and if not, the formula will be used as a detail object. You can specify to use the formula as a detail, group, or an aggregation object, by selecting the corresponding view element type from the Use As drop-down list on the toolbar.

    Whether a dynamic formula can be used as a certain type depends on the following rules:

  4. Compose the formula by selecting the required fields, functions and operators from the Fields, Functions and Operators boxes. You can also write the formula by yourself in the editing box.

    For details about the functions and operators, refer to Built-in Functions and Operators.

  5. Click the Check button Check button to check whether or not the syntax of your formula is correct.
  6. When done, click the OK button to create the formula.

Once a dynamic formula is created, you can then drag it from the Resources panel to the desired position in the report for data analyzing, or add it as report field when working with the report wizard.

In the Resources panel of Web Report Studio, you can make use of the shortcut menu of an existing dynamic formula to edit or delete the formula, or change the formula type as Group, Detail, or Aggregation if possible.

Notes:

Creating and using dynamic aggregations

In Web Report Studio, you can also create dynamic aggregations by mapping them to the available resources such as group objects, detail objects in the current business view and the dynamic formulas that have been created in the report.

To create a dynamic aggregation:

  1. In the Resources panel of Web Report Studio or the Resources box of the Web Report Wizard, expand the Dynamic Resource > Aggregations node, then click <Add Aggregation…>. The Add Aggregation dialog appears.

    Add Aggregation dialog

  2. In the Aggregation Name text field, specify the display name of the dynamic aggregation.
  3. Click the button Select Source next to the Mapping Name text field. In the Select Resource dialog, specify the field on which the dynamic aggregation is based.
  4. From the Aggregate Function drop-down list, specify the aggregate function.
  5. When done, click OK to create the dynamic aggregation.

Once a dynamic aggregation is created, you can then drag it from the Resources panel to the desired position in the report for data analyzing, or add it as report field when working with the report wizard. And if you want to edit any dynamic aggregation or delete it, right-click the aggregation and click Edit or Delete on the shortcut menu.

Creating and using local parameters

When you use parameters to compose the filter conditions applied to a report, if the given parameters in the current catalog cannot meet your requirements, you can create local parameters to use in the report. The local parameters created for a report can also be added to the parameter controls and parameter form controls in the report, or referenced in dynamic formulas used in the report.

To create a local parameter and use it in a filter:

  1. When filtering a business view in the Query Filter dialog, or a data component using the Filter dialog, click the button Enter Parameter Values button and select <Add Parameter…> from the Local Parameters node of the value drop-down list.

    The Add Parameter dialog appears.

    Add Parameter dialog

  2. In the Name field, input a name for the parameter.
  3. Select a parameter type from the Value Setting drop-down list. For parameters in XML connection, it can only be Type-in Parameter.
  4. In the value section, specify the parameter values as required. The section varies with the type you select from the Value Setting drop-down list.
  5. In the Options box, set options for the parameter according to your requirements.
  6. When done, click OK to create the parameter. The parameter is added to the Local Parameters node in the Parameters list.

    To further edit the parameter, right-click it in the list and select Edit from the shortcut menu. Then in the Edit Parameter dialog, edit the parameter as required.

    To remove the parameter, right-click it in the list and click Delete on the shortcut menu.

  7. Finish defining the filter condition using the parameter.
  8. Click OK to apply the settings. The parameter is then listed in the Parameters panel and you can specify the parameter value in the panel to dynamically set the filter condition.

BackPrevious Page Next PageNext