Applying filters to business/report cubes

When creating reports in JReport Viewer, you can choose to apply some filter to the specified business/report cube to narrow down the data scope of the business/report cube. Filters for business/report cubes are defined into two categories in JReport Viewer: predefined filters and user defined filters. As the name suggests, predefined filters are defined on business/report cubes in advance in JReport Designer, and user defined filters are created on business/report cubes while they are used in JReport Viewer.

Filters can be applied to business/report cubes in JReport Viewer in the following ways:

Applying a filter to a business/report cube while creating a report

  1. In a JReport Viewer window, click Menu > File > New Page Report to display the New Page Report dialog.
  2. Specify the title of the report as required in the Report Title text box.
  3. In the Choose Report Layout box, select the layout as Banded, Crosstab, Table or Chart and then click OK.

  4. In the corresponding report wizard, select the required business/report cube for the report, and the fields you want to display in the report.
  5. Click the Query Filter screen.

    All the predefined filters of the selected business/report cube are listed in the Query Filter drop-down list. Choose the one you want to apply. If you want to further edit the filter, click the Edit button and then redefine the filter as required. The edited filter will then be saved as a user defined filter to the business/report cube.

    If you prefer to define a filter on your own, select User Defined from the Query Filter drop-down list, then define the filter according to your requirements.

    There are the basic and advanced modes of the screen for you to define either simple or complex filter expressions. See Filtering report data for details about how to define a filter.

  6. Click Finish in the report wizard and the specified filter will be applied to the business/report cube, so that your report will get data that meets the filter condition only.

Applying a filter to a business/report cube while inserting a data component

  1. In a JReport Viewer window, do either of the following:
  2. In the corresponding report wizard, select the required business/report cube for the component, and the fields you want to display in the component.
  3. In the Query Filter screen, specify the filter you want to apply to the business/report cube from the Query Filter drop-down list, or define a filter according to your requirement.
  4. Click Finish to create the component and the specified filter will be applied to the business/report cube.

Applying a filter to a business/report cube after a report is built

  1. Select the component in a report which was created on a business/report cube by clicking anywhere in it, and then clicking the icon at the upper left corner of the component.
  2. Click Menu > Report > Query Filter, or right-click the component and select Query Filter from the shortcut menu to display the Query Filter dialog.
  3. From the Query Filter drop-down list, select the filter you want to apply to the business/report cube used by the component, or define a filter according to your requirement.
  4. Click OK to apply the filter to the business/report cube.

Notes: