How to: Define a Report Filter

Important

This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

This topic describes how to define set ranges to filter data on a report. Filters are used to filter or restrict the data that is displayed in a report.

The Dynamics Filter property on the dataset determines how filters are created for a report. If the Dynamics Filters property on the dataset is set to True, the end user of the report will identify the ranges when they view the report. For more information, see How to: Define a Report with Dynamic Filters. To manually define the set ranges to filter data on a report, verify the Dynamics Filters property on the dataset is set to False and follow these steps.

To define a filter for a data region

  1. In Model Editor, expand the node for the report that you want to work with.

  2. Expand the Designs node for the report.

  3. Locate the auto design that you want to modify, and then expand the node for the auto design to view its data regions.

  4. Locate the data region for which you want to define a filter, and then expand the node for the data region.

  5. Right-click the Filters node, and then click Add Filter.

  6. Select the node for the filter.

  7. The following table shows the properties for a filter in the Properties window. Specify the following properties.

    Property

    Description

    Expression

    An expression for the filter. From the drop-down list, choose a field for the filter to create a simple expression. You can also choose <Expression…> to open the Edit Expression dialog box to create a more complex expression. For information about how to create expressions, see Expression Examples in Reporting Services.

    Name

    The name of the filter.

    Operator

    An operator for the filter expression.

    Value

    A value for the expression. You can type a value or use the drop-down list. From the drop-down list, choose <Expression…> to open the Edit Expression dialog box where you can create a complex expression.

    Note

    If you type the character "10" for the Value property, by default, this evaluates to the string "10". To compare a numeric expression with the number 10, use the expression syntax which starts with an equal sign: =10. If a filter expression contains a data type mismatch, you will see a runtime error when you are previewing the report.

  8. To preview the layout of the report, right-click the node for the design, and then click Preview.

    Note

    You can use a parameter in a filter. To do this, you must first define the parameter within the Parameters node for the report. For more information, see How to: Define a Report Parameter. Once you have defined a parameter, you can use it when you define the filter expression. Parameters appear in the drop-down list for the Value and Expression properties.

See also

How to: Define a Report Parameter

Controls Used to Render Report Parameters

Walkthrough: Creating a Report with Parameters