We add parameters to reports to be able to dynamically fetch very selective data from the underlying database. Sometimes parameters are used for controlling the behaviour of a report such as the visibility of certain columns etc. Let’s look at the below example where I am querying data from information schema table to display tables or views by selecting the value from a report parameter.
Right click the dataset and select Query, in the next window we are going to modify the query to accept a parameter in the where condition.
Notice how after we pressed OK the new parameter is automatically added to the Parameters folder
Right click the parameter and select Parameter Properties
Select the Available values option from the left hand side options and then select the radio button for Specifying Values. In this case we know that the values are either Base Table or View. So click Add
Notice that the Label shows only Tables (this is what the user will see) but when selected the values that will be passed by the parameter is “Base Table” Press OK
Now that we have added a parameter and have the values being passed to the Report we can preview the report.
Select the option from the drop down list in the Top bar of the report and press View Report.
Notice how the query is restricted to returning the rows where Table Type is View.