The Filters page provides powerful functionality for designing reports. On this page, you can define filters to limit data that appears in a report and to define whether a report should prompt users for input on a given filter (Report with Input Controls).
You can You can pre-filter data in the Data Chooser before launching the Ad Hoc Editor or creating a Domain Topic. Pre-filtering data limits the data choices available in a Domain Topic or the fields that ultimately appear in the Ad Hoc view. You can also define a filter on a field that you do not plan to use does not appear in the final report. The filter will is still be applied and only data that satisfies all defined filters will appear in the final report (. For example: , you can filter data to select a single country, in which case it doesn't doesn’t make sense for the Country field to appear as a row, column, or group).. You can also design reports that prompt users to input data to use as a filter.
The Pre-filters page provides powerful functionality for designing views within the server.
To define a filter:
1. In the Data Chooser, click Pre-filters.
3. Double-click to select a field in the
...
- Clicking New Condition.
- Clicking the arrow next to the field name.
- Double-clicking the name of the field.
...
Fields panel. Choices appear for filtering the selected field:
4. Choose a comparison operator.
- Text fields have both substring comparison operators such as “starts with” or “contains” and whole string matching such as “equals” or “is one of.” When you select a whole string matching operator, a list appears showing all existing values for the chosen field retrieved in real-time from the database.
- In the Filters panel, a drop-down appears containing the report status from which you can select multiple values.
5. Click each value for comparison in Available Values to move it to Selected Values. The report status values appear in Selected Values.
- If there are more than 50
...
- Available Values, click to search for the value. The maximum number of items that can be displayed in Available Values is configurable. For details, see the JasperReports Server Administrator Guide.
6. To limit the view design to the report status chosen in Selected Values, check the Locked check box.
- By default, the Locked check box is unchecked, making the filter available to end-users running the report.
- In the Report Viewer, users can click the Options button to enter a comparison value for this condition; when the user clicks Apply or OK, the report preview refreshes with data that match the condition. The condition is available as a prompt even if the filtered field does not appear in the report. For example, the final report
...
- might present data for a single country, but the country is chosen by the user. Once defined, filter prompts can be modified in the Ad Hoc Editor
...
Panel |
---|
To define a filter that compares two fields of the same datatype, select the second field using Ctrl-click, then click Create Condition. This button is only enabled when two compatible fields are selected. After you click OK, you can edit and delete it as with other conditions. Such filters cannot be presented when the report is run. |
...
- , as explained in Using Input Controls.
- Note that when the Locked check box is checked, the filter is not available to end-users running the report. The condition can be removed from the view, if needed, but not edited.
7. Click OK to create the filter.
- The Filters panel shows the filters you have defined.
8. In the Filters panel, click Change to modify the condition. Click OK to save the changes. After selecting a row, you can also click Remove to delete it from the list.
- Data rows must match all conditions. In other words, the overall filter applied to the data is the logical AND of all conditions you have defined.