Background:
This article discusses how to add a multi-value parameter.
Steps to Complete:
-
In the Report Explorer, right-click the Data Source and select Add Data Set.
-
In the DataSet dialog, select the Query
-
Enter an SQL query in the Querytext box like below:
SELECT DISTINCT ProductName FROM Products
-
Click OK
-
In the Report Explorer, right-click Parameters and select Add Parameter.
-
In the Report - Parameters dialog, add a name for the parameter. Ex: ReportParameter1.
-
Ensure that the Data type matches that of the field. In this case we would use String for ProductName.
-
Enter some text in the Text for prompting users for a value field. Ex: Select the product names
-
Select the checkbox next to Multivalue to allow users to select more than one item from the list.
-
In the Value for 'Select All'option, enter '1'.
-
Go to the Available Values tab and select the From query radio button.
-
Under the Dataset field, select the dataset that was created.
-
Under the Value and Label fields, select the field productName.
-
Click OK
-
In the Report Explorer, right-click the added Data Source and select Add Data Set
-
In the DataSet Dialog, goto Parameters and click the Add button,
-
Add the following values to the new Parameter:
Name: ReportParameter1
Value: Parameters!ReportParameter1.Value
-
Click the add button again and enter the following:
Name: Parameter1
Value: Parameters!ReportParameter1.Value
-
Go to the Query page and enter the following:
SELECT * FROM products where ProductName in (?) OR ‘1’ in (?)
-
Select the Validate DataSet icon to validate the query
-
Click Ok and then select the Preview tab to preview the report
Resources:
https://global-cdn.grapecity.com/kb/activereports/ard/C1NWind.mdb
https://global-cdn.grapecity.com/kb/activereports/ard/ARD-How_to_add_a_Multi-Value_Parameter.rdlx
Tags:
Evan Warren