#### How to create a data-set parameter

This procedure assumes that you have already inserted a parameter marker in the SQL query.

If you create multiple data-set parameters, create them in the order in which their corresponding parameter markers appear in the WHERE clause.

1. 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.
2. Choose Parameters. Edit Data Set displays default parameter information in the first row.
3. Create a data-set parameter by specifying the following required values:

1. 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.
2. In Data type, select a data type for the parameter.
3. In Direction, choose Input. This value means that the parameter is an input parameter.
4. Select Default value and a button appears at the right of the empty field
5. Choose the ellipsis (...) button at the right. Expression Builder appears.

4. Bind the data-set parameter to the appropriate report parameter by selecting the report parameter as the data-set's default value:

1. 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
2. Double-click on the appropriate report parameter. The report parameter appears in the expression area.
3. Choose OK.

5. Repeat steps 3 and 4 to create additional data-set parameters for any other parameter markers that you inserted in your SQL query.
6. 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
7. To save the data-set parameters, choose OK.
8. Test the parameters to verify that the query is updated with user-specified values and that the report shows the results you expect:

1. Choose Preview.
2. 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
3. Specify values for the parameters, then choose OK.

If you completed all the tasks that were described earlier in this chapter, the WHERE clause of your query is updated with the specified values, and the report displays the rows that match the WHERE clause.