Database Reference
In-Depth Information
There's more...
Instead of having to select a single value from a list of report parameter, parameters that al-
low the selection of multiple values can also be defined.
Allow multiple values to be selected for a parameter
You can configure a report parameter to allow multiple values to be selected by the report
consumer by performing the following steps:
1. In Report Builder, open the
Events Last 30 Days
report and make sure that you
are in the
Design
mode.
2. In the
Parameters
node, right-click on the
EventLevel
parameter and click on
Parameter Properties
.
3. Under
General
, enable the
Allow multiple values
option. Click on
OK
. SQL
Server Reporting Services will pass all the selected values as a string of comma-
separated values to the query of your dataset. This means that we need to change
the query of our
DSEvents
dataset to allow for this string to be interpreted cor-
rectly.
4. In the
Datasets
node, right-click on the
DSEvents
dataset and click on
Dataset
Properties
.
5. In the query, replace the text
E.EventLevelId = @EventLevel
with
E.EventLevelId IN (@EventLevel)
.
6. When prompted to
Enter Data Source Credentials
, select
Use the current Win-
dows user
or type the password for the service account and click on
OK
.
7. Click on
OK
. Click on
Run
from the
Home
toolbar to test the report, as shown in
the following screenshot: