- In the data explorer, choose the data set for which you want to create parameters. Edit Data Set displays the query for the data set.
- Choose Parameters. Edit Data Set displays default parameter information in the first row.
- Create a data-set parameter by specifying the following required values:
- In the first row, in Name, type a name for the parameter. It is good practice to prefix the name you select with DSP for data-set parameter to to help distinguish the parameter from other parameter types, such as report parameters. For example, a data-set parameter used to filter quantityinstock might be named DSP_quantityinstock.
- In Data type, select a data type for the parameter.
- In Direction, choose Input. This value means that the parameter is an input parameter.
- Select Default value and a button appears at the right of the empty field
- Choose the ellipsis (...) button at the right. Expression Builder appears.
- Bind the data-set parameter to the appropriate report parameter by selecting the report parameter as the data-set's default value:
- Under Category choose Report Parameters, then choose All under Sub-Category. The report parameters that you created appear, as shown in Figure 12-3.
Figure 12-3 Binding a data-set parameter to a report parameter
- Double-click on the appropriate report parameter. The report parameter appears in the expression area.
- Choose OK.
- Repeat steps 3 and 4 to create additional data-set parameters for any other parameter markers that you inserted in your SQL query.
- Assuming you have entered a Default value for your report parameter(s), you can choose Preview Results to verify that the query returns rows that match your WHERE condition.
Figure 12-4 shows the results of the previous example where a default value of 999 was entered for the report parameter RP_quantityinstock. It shows all rows for products in stock with a quantity of less than 999.
Figure 12-4 Preview Results, with rows that match the WHERE condition
- To save the data-set parameters, choose OK.
- Test the parameters to verify that the query is updated with user-specified values and that the report shows the results you expect:
- Choose Preview.
- If Enter Parameters does not appear, choose Show Report Parameters.
Enter Parameters displays all the report parameters that you created.
Figure 12-5 shows the simple report parameter RP_quantityinstock.
Figure 12-5 Enter Parameters
- Specify values for the parameters, then choose OK.