Extending ReportRunView – Filters hidden when reports != null: intended behavior?

Hi,

I’m customizing the standard ReportRunView (io.jmix.reportsflowui.view.run.ReportRunView) because I needed to adjust the filtering options in our application. During this process, I noticed two behaviors in the base implementation in Jmix 2.7.0 that I’d like to understand better.

:mag: Behavior 1: Filters are hidden when reports != null

In onBeforeShow() the framework hides the entire filter section if the screen was opened with an externally injected list of reports (setReports(List<Report>)).
This means the user cannot apply UI filters such as name, code, group or updated date anymore.

:mag: Behavior 2: Filters are not applied when reports != null

Inside the original reportsDlLoadDelegate() method, the logic short-circuits like this:

if (reports != null) {
    return reports;
}

This completely bypasses the filter mechanism.
Even if the filter components still had values, no filtering would happen in this case.

:heavy_check_mark: My approach

In my extension I wanted to support:

  • keeping the external report restriction
  • but still allow filtering within the provided list

To achieve this, I now always load the filtered list from the repository, and if reports != null, I intersect the result with the externally provided list. This allows standard filtering while still respecting the external restriction.

:question: My question to the Jmix team

Is it intentional that:

  1. the filter UI is automatically hidden when reports != null, and
  2. the data loader completely skips applying filters in that case?

I would like to understand whether this is a deliberate design decision (e.g. “external list = final list, no further filtering expected”), or more of an implementation detail that could be reconsidered.

Thanks!

Hi Tim!

Thank you for paying attention to the details. At first glance, it really might look like a bug. However, this is exactly how it was intended :smiley:

Let’s go through all your cases:

  1. Behavior 1. In the onBeforeShow filter, we check whether any reports were passed from the outside (in this case, when opening the dialog). Such reports are passed to ReportRunView only through two actions: RunListEntityReportAction and RunSingleEntityReportAction. The filtering by entity class or view criteria is performed in ReportActionSupport.openRunReportScreen(). Therefore, these reports are already considered “filtered”. That’s why the filter field simply doesn’t appear in RunReportView.
  2. Behavior 2. It follows directly from the logic of Behavior 1.

If you need a screen with filtering capability, you can use a different action - RunReportAction. It does provide the filtering option with all available restrictions.

image

We could also implement search in RunListEntityReportAction/RunSingleEntityReportAction to unify the look and feel with RunReportAction. We’ll be looking into implementing this feature in other actions. You can follow the discussion in the GitHub issue.