Pega filter report definition results using custom section

The filters that come with a Report Definition are functional but plain. If you want a friendlier search panel above the results, for example a date range, a dropdown and a search button laid out your way, you can replace them with your own custom filter section.

Steps

  1. Create a section that holds the filter fields. Use the same class as the report and lay it out with your preferred layout.
  2. Open the Report Definition and go to the Report Viewer tab.
  3. Tick Display filters using custom sections.
  4. Enter the name of your section in the field that appears.
  5. Save, then run the report. Your section appears above the results in place of the standard filter bar.

How the filters connect to the report

The fields in your section are bound to the report's parameters or to the filter conditions on the Query tab. Mark the conditions as Prompt or Ask at run time so the values you type are picked up when the report runs.

A worked example

A bank has an OpenLoans report. The team wants a panel with a date range, a status dropdown and a branch picker.

  1. Build the section OpenLoansFilters with two date fields, a status dropdown and a branch autocomplete.
  2. On the Query tab, set the filter conditions for date, status and branch to be prompted at run time.
  3. On the Report Viewer tab, tick Display filters using custom sections and enter OpenLoansFilters.
  4. Open the report in the report viewer. The custom panel appears, and clicking the refresh button reruns the report with the new values.

Why do this?

  • A cleaner, branded search experience.
  • Control over field order, labels and controls such as autocomplete or date pickers.
  • Fewer support questions because the report looks like the rest of the application.

Tips

  • Keep the filter list short. Users ignore panels with more than five or six fields.
  • Give every filter a sensible default so the report loads with data.
  • Do not forget to check the report on a small screen.

More in the Report Definition label.

No comments:

Post a Comment