Procedure: Add Support for Multiple Value Selection in a Report
Parameter
The
procedure for creating a Report Parameter in Reporting Services 2005
is similar to doing so in Reporting Services 2000. Many of the following
steps will be familiar to most of us. Our specific focus in this section will
be the addition of support for multiple value selection in the parameter
picklist, which involves additional settings in the Report Parameter
dialog, as well as a change in operators, within our sample report, at the
matrix filter.
Create a New Report
Parameter with Multiple Value Selection Support
1.
Select Report
--> Report Parameters from the main menu atop the Report
Designer, as we did earlier.
The empty
Report Parameters dialog appears.
2.
Click Add.
3.
Type the
following into the Name box atop the dialog:
pX_MultiVal_ProductFamily
4.
Type the
following into the Prompt box :
Product Family(ies):
5.
Click (to
insert a check mark) the checkbox to the immediate left of the Multi-value,
one of five checkboxes appearing under the Prompt box.
This
checkbox, a new option with Reporting Services 2005, enables the support
of multiple selections in the picklist for our new Report Parameter.
6.
Ensure that
the Allow null value and Allow blank value check boxes are
cleared.
7.
Click the From
query radio button in the Available values section of the dialog.
It is
here that we align the ProductList Dataset, designed to populate the
picklist that appears to the information consumers at runtime. Clicking the From
query radio button enables the settings to its right, where we select the
following:
-
Dataset: the report Dataset from
which the values that appear in the drop-down selector are taken;
-
Value field: the Dataset field from
which the value(s) used by the report (within a filter or other component) is
taken;
-
Label field: the Dataset field from
which the values that appear to the consumer in the picklist at runtime are
taken.
8.
Select ProductList
in the Dataset selector.
9.
Select ID_Product___Product_Family___MEMBER_CAPTION_
in the Value field selector.
10.
Select ID_Product___Product_Family___MEMBER_CAPTION_
in the Label field selector.
11.
Click the From
query radio button in the Default values section of the dialog.
Once
again, we note that selectors are enabled, this time a selector for Dataset
and a selector for Value field, which serve similar functions with
regard to the default parameter values.
12.
Select ProductList
in the Dataset selector, as before.
13.
Select ID_Product___Product_Family___MEMBER_CAPTION_in
the Value field selector, again as before.
The Report
Parameters dialog appears, with our input, as depicted in Illustration 20.
Illustration 20: The
Report Parameters Dialog
14.
Click OK
to accept our input and to close the Report Parameters dialog.
The Report
Parameters dialog closes, and we are returned to the Layout view of
the report, once again.