How to: Define a Report Filter
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
In Model Editor, expand the node for the report that you want to work with.
Expand the Designs node for the report.
Locate the auto design that you want to modify, and then expand the node for the auto design to view its data regions.
Locate the data region for which you want to define a filter, and then expand the node for the data region.
Right-click the Filters node, and then click Add Filter.
Select the node for the filter.
The following table shows the properties for a filter in the Properties window. Specify the following properties.
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.
The name of the filter.
An operator for the filter expression.
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.
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.
To preview the layout of the report, right-click the node for the design, and then click Preview.
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.