Skip to main content
All docs
V26.1
  • Filter Report Data

    • 6 minutes to read

    Report parameters allow users to generate different reports using the same underlying template without changes. For example, users can apply a country parameter to populate the report only with records from that specified region.

    Filter Report Data

    A parameter can filter report data at the following levels:

    Report-level filter
    The report engine filters data once all records are loaded from a data source. Report-level filtering is data source agnostic and supports complex expressions and calculated fields.
    Data source-level filter
    The data source filters records before they reach the report. Data source-level data filtering improves performance and reduces app memory footprints for large datasets but requires support for SQL queries and stored procedures (available only for relational databases).
    URL-level filter
    The report passes parameter values to a web service through the request URL or headers. The web service filters report data on the server to reduce network traffic. URL-level data filtering is available only for web-hosted JSON data sources.

    Report-Level Filter

    Follow the steps below to filter report data by the Country parameter value:

    Step 1 — Open the Filter Editor

    1. In the Report Designer, open the PROPERTIES section.
    2. Select the root report element (marked (Report)) from the drop-down list.
    3. Click the ellipsis button in the Filter String field to open the Filter Editor dialog.

    Report Designer - Report Properties Filter String

    Tip

    You can type a filter expression directly in the Filter String field.

    Step 2 — Build a Filter

    In the Filter Editor dialog, add a condition that compares the ShipCountry report field to the countryParameter parameter value:

    1. Hover the And group, click the Plus button, and select Add condition from the drop-down menu:

      Report Filter String - Add Filter Condition

      Tip

      Enable Advanced Mode to enter a raw text query rather than navigate through menus. To reference a report parameter, prefix the parameter name with ? (for example, ?countryParameter).

      Query Builder - Advanced Mode

    2. Click the left operand and select the report field from the drop-down menu:

      Report Filter String - Filter Operand

    3. If you need a different comparison operator (for example, to compare against a multi-value parameter), click the central part of the filter condition and select an operator from the drop-down menu:

      Report Filter String - Filter Operator

    4. Click the arrow icon next to the right operand and select Parameter from the drop-down menu:

      Report Filter String - Filter Criteria

    5. Click the parameter name in the right operand and select countryParameter from the drop-down menu:

      Report Filter String - Filter Parameter

    6. Click the OK button to save the filter:

      Report Filter String - Save Filter Criteria

    Data Source-Level Filter

    Reference a parameter in the report’s query or a stored procedure to filter records before the data source loads report records.

    Note

    Data source-level filters only support SQL data sources. For other data sources, filter records at the report level.

    Follow the steps below to configure a data source to return only records for the selected country (countryParameter):

    Step 1 — Create a Query Parameter

    A query parameter is a placeholder that receives a dynamic value (such as a calculated expression or user input) when the query is executed. In this tutorial, the query parameter receives its value from the countryParameter report parameter and uses it to filter records by country.

    1. Open report fields in the Report Designer:

      Report Designer - Report Fields

    2. Locate the report data source and click the Pencil button to open the Data Source Wizard:

      Report Designer - Data Source

    3. Run the Query Builder:

      Report Designer - Query Builder

    4. Create a query parameter. Expand the PARAMETERS section and click the Plus button:

      Query Builder - Query Parameters

    5. Expand the query parameter and bind it to the countryParameter report parameter:

      Query Builder - Query Parameter Configuration

      Name (1)
      Specify a unique name to reference the parameter in the query.
      Type (2)
      Select Expression to calculate the parameter value each time the query runs.
      Result Type (3)
      Specify the value type returned from the query parameter expression.
      Value (4)

      Click the ellipsis button and create an expression that calculates the query parameter value from report parameter values.

      Query Builder - Expression Builder

    Step 2 — Add a Query Filter

    In the Filter Editor dialog, add a condition that compares the ShipCountry data source field to the countryParameter parameter value:

    1. Expand Query Properties and click the ellipsis button in the Filter field to open the Filter Editor dialog:

      Query Builder - Filter

      Tip

      Enable Advanced Mode to enter a raw text query rather than navigate through menus. To reference a query parameter, prefix the parameter name with ? (for example, ?countryQueryParameter).

      Query Builder - Advanced Mode

    2. Hover the And group, click the Plus button, and select Add condition from the drop-down menu:

      Query Builder - Add Filter Condition

    3. Click the left operand and select the data source field from the drop-down menu:

      Query Builder - Filter Left Operand

    4. If you need a different comparison operator (for example, to compare against a multi-value parameter), click the central part of the filter condition and select an operator from the drop-down menu:

      Query Builder - Filter Operator

    5. Click the arrow next to the right operand and select Parameter from the drop-down menu:

      Query Builder - Filter Criteria

      Tip

      The first query parameter is selected automatically. To use another parameter, click the parameter name in the right operand and select the parameter from the drop-down menu.

    6. Click the OK button in the Filter Editor dialog to save the filter condition.

    7. Click the OK button in the Query Builder to apply changes to the query.
    8. Click the Finish button to close the Data Source Wizard:

      Query Builder - Bind the Query Parameter to the Report Parameter

    Filter Web Service Data at the Source

    If your report connects to a web service endpoint, you can filter data server-side. The report component passes report parameter values to the API through a URL path, query string, or HTTP header. Server-side data filtering reduces network traffic and speeds up report generation because the web service returns only explicitly requested records.

    Note

    The report only sends parameter values and does not affect remote web service behavior. The web service must accept request parameters/headers and process/apply filter criteria on the server.

    Follow the steps below to build an endpoint URL based on report parameter values:

    1. Add a JSON data source and configure the web service endpoint:

      Data Source Settings - Endpoint

    2. Expand the PARAMETERS section and click the Plus button to create a parameter binding:

      Data Source Settings - Add Parameter

    3. Select how to pass the parameter to the web service:

      Path Parameter
      Inserts the parameter value into the endpoint URL path.
      Query Parameter
      Appends the parameter value to the URL query string.
      Header
      Sends the parameter value in an HTTP request header.

      Data Source Settings - Parameter Method

    4. Click the Function button (1) next to the parameter value and then click the ellipsis button (2) to create an expression that fetches the report parameter value:

      Data Source Settings - Parameter Expression

    5. Expand the Parameters node and double-click the parameter name to add it to the expression. Use operators and functions to combine or compare parameter references with other data:

      Data Source Settings - Expression

    6. Click Finish to save the connection.