Enabling the User to Filter Data  : Enabling user filtering at query run time : Creating a report parameter
 
Creating a report parameter
Report parameters provide a mechanism for passing values into a report. You can create a report parameter to prompt the report user to specify a value for a particular field. Alternatively, you can use a hidden report parameter to pass a value into the report on a programmatic basis. For instance, a hidden parameter can be used to pass a customer’s account code into a report if you do not want a customer to look at any account data but her own.
Report parameters have global scope, which means they are available to the entire report and any report element can access a report parameter’s value. To enable user filtering, bind the report parameter to a corresponding data set parameter.
When creating a report parameter, you perform two main tasks:
*Define the basic properties of the parameter: its name and data type.
*Design the presentation of the parameter to the user. Consider the following tasks:
*Specifying whether users type a value or select a value from a list box or radio buttons
*Providing a default value
*Displaying a descriptive text prompt
*Organizing report parameters in logical groups
How to create a basic report parameter
1 In Data Explorer, right-click Report Parameters, and choose New Parameter.
New Parameter appears, as shown in Figure 13‑2.
Figure 13‑2 New Parameter
2 Specify the following basic properties:
1 In Name, type a name for the parameter. It is good practice to use a prefix, such as RP, in the name to help distinguish report parameters from other parameter types, such as data set parameters. For example, a report parameter used to filter on a quantityinstock field might be named RP_quantityinstock. The value you specify in Name appears as the prompt to the report user if you do not specify a value for the next property, Prompt text. Rather than specify only a Name value for the parameter, you should use a technically descriptive value in Name, and provide a user-friendly value in Prompt text.
2 In Data type, select a data type for the parameter.
The data type that you select for the report parameter determines the formatting options that are available if you choose to provide a default value or a list of values for the report parameter. The data type of the parameter does not have to match the data type of the field in the data source. Values in an orderID field, for example, can be stored as integers in the data source, but the report parameter that is associated with this field can be of string type.
3 Choose OK.
The parameter appears under Report Parameters in Data Explorer.