Need a special offer?Find out if your project fits.
+
All documentation
  • Introduction
  • Connecting to data source
  • Browser compatibility
  • Documentation for older versions
  • Report filters

    Report filters are fields used for filtering data in the report. Members of such fields are not displayed on the grid and charts, which is useful if you want the report to look neat and uncluttered.

    About report filters

    Report filters can be added only via the compact form, the classic (tabular) form, and the chart view. In the drill-through view and the flat form, the existing report filters are displayed in columns.

    To use report filters for showing different data subsets, apply the conditional or selection filters to fields in report filters. Otherwise, report filters do not affect which data is displayed, so there is no point in using them.

    Note Value filter is not compatible with the report filters.

    Availability for data sources

    Report filters are available for all data sources.

    Note For the custom data source API, the conditional or the selection filter must be implemented on your server in order to be applied to report filters. For more details, refer to the Implementing filters guide.

    Adding report filters

    Report filters can be:

    • Added via UI
    • Preset in the report
    • Added using API calls

    Via UI

    Step 1. Open the Field List using the diagonal arrow in the upper-right corner of the grid or the charts. If you have the Toolbar embedded, you can also use the Fields Toolbar tab.

    Step 2. Drag the required fields to the Report filters box. Click APPLY once you are finished.

    Step 3. Apply the conditional or the selection filter to the selected fields. You can find the fields:

    • On the grid — in the upper-left corner.
    • On the charts — in the upper-right corner.

    In the report

    Step 1. Specify fields for report filters in the slice.reportFilters property:

    slice: {
      reportFilters: [{
        uniqueName: "Color"
      }],
      // Slice configuration
    }

    Step 2. Apply the conditional or the selection filter to the specified fields:

    slice: {
      reportFilters: [{
        uniqueName: "Color",
        filter: {
          members: [
            "color.[yellow]",
            "color.[white]"
          ]
        }
      }],
      // Slice configuration
    }

    See the full code on JSFiddle.

    Using API calls

    To add or change report filters at runtime, use the runQuery() API call:

    let slice = {
      reportFilters: [{ 
        uniqueName: "Color",
        filter: { members: ["color.[green]"] }
      }],
      // Slice configuration
    };
    flexmonster.runQuery(slice);

    You can view fields from report filters using the getReportFilters() and getReportFiltersAsync() API calls.

    See the full code on JSFiddle.

    Note To prevent changes to filter configurations in the report filters, use the grid.showReportFiltersArea and chart.showFilter options. 

    See also