Creating a dynamic filter parameter
Dynamic filter parameters provide users with more control over the data they view in a report. Figure 11‑19 shows an example of the steps to create a dynamic filter parameter.
Figure 11‑19 Specifying properties for a dynamic filter parameter
In Report Studio, dynamic filter parameters modify the underlying query, so only data rows that meet the filter criteria are retrieved from the data set.
The basic properties you specify when you create a dynamic filter parameter are similar to the properties for a static filter parameter, with one exception. On Edit Parameter, you specify the operators to provide to users, and set a default operator. Figure 11‑19 shows an example of a dynamic filter parameter that includes a list of values. The display type is set to List Box. Dynamic filter parameters are always optional.
How to create a dynamic filter parameter at the report table level
1 Select and right‑click the column for which you want to create a prompt. Choose FilterFilter. Filter appears. The selected column appears in Filter By.
2 Select Dynamic, as shown in Figure 11‑20.
Figure 11‑20 Specifying filter parameter properties
3 In Prompt Text, type a description for the prompt.
4 If the report contains aggregate data, do one of the following:
*To recalculate aggregate data values across the filtered data rows, select Recalculate Totals, if necessary.
*To calculate aggregate data for the unfiltered data, deselect Recalculate Totals.
5 Choose Edit Parameter. In Edit Parameter, complete the following steps:
1 In Prompt Text, if required, modify the text you typed earlier.
2 In Help Text, optionally type a tooltip that assists the user in selecting parameter values, for which Report Studio displays data.
3 In Display Type, choose List Box.
4 In Dynamic Filter Condition, in Operator, select one or more operators from the drop‑down list to provide to the user. By default, all operators are selected. To select operators from the list, deselect All Operators. Then, press Ctrl and select each operator from the list of available operators.
5 Select a default operator from the drop‑down list.
6 In List of Values, do one of the following:
*Select Static to create a static list of values. Complete steps 6 and 7 in How to create a static filter parameter with a list of values.
*Select Dynamic to create a dynamic list of values. Complete steps 8 and 9 in How to create a static filter parameter with a list of values.
6 On Filter, choose OK.
7 To test the prompt in Report Studio, choose DataParameters. Parameters displays the prompt, as shown in Figure 11‑21.
Figure 11‑21 Parameters displaying a dynamic prompt
How to create a dynamic filter parameter at the data set level
1 In Report Studio, in Available Data, choose Filter.
2 On Advanced Filter, select Dynamic, as shown in Figure 11‑22.
Figure 11‑22 Advanced Filter displaying a dynamic filter parameter
3 In Filter By, select a column from the drop‑down list.
4 Choose Edit Parameter. In Edit Parameter, create the parameter condition by completing step 5 in How to create a dynamic filter parameter at the report table level.
In Advanced Filter, Prompt Text displays the text you entered earlier.
5 Choose Add Filter. The dynamic filter parameter condition appears in Filters, as shown in Figure 11‑22. Choose OK.
6 To test the prompt in Report Studio, choose DataParameters. Parameters displays the prompt, as shown in Figure 11‑23. The default operator specified in the example condition is In, and the default value is USA.
Figure 11‑23 Parameters displaying a dynamic prompt
When working with a dynamic prompt for a column containing numeric data that uses the Match or Not Match operators, if you use the value 1 as the string value to match, you must use double quotation marks (" ") to enclose the value. Type the value as "1" in the text box or combo box, so that Report Studio evaluates it accurately as a literal string. If you use other numbers as strings, such as 2, 3, and so on, you do not need to enclose them in double quotation marks.