> Task 10: | Provide the option to select all vendors

> The query and the design of the report parameters require the user to specify a minimum stock quantity and a specific vendor. The report displays only products with the specified minimum stock quantity and for the selected vendor. In this procedure, you provide the user with the option of selecting all vendors, so that the report displays all products—supplied by any vendor—with the specified minimum quantity. To provide this option, you modify the RP_productvendor report parameter to display an All Vendors value, and to send the appropriate value to the query.

> 1 | In Data Explorer, expand Report Parameters, right-click RP_productvendor, then choose Edit.

> 2 | On Edit Parameter, under List of value, choose Static. This option lets you create user-defined values, whereas the dynamic option does not.

> The properties under List of Value change to reflect the change from dynamic to static values.

> 3 | Specify the values to display in the list box.

> 1 | Choose Import Values. Import Values displays the first data set in the report, Products, and the values of the first field in the data set, PRODUCTNAME.

> 2 | In Select Data Set, select Vendors.

> 3 | In Select Column, select PRODUCTVENDOR. Import Values displays the values for the field.

> 4 | Choose >> to import all values from the field.

> Figure 12‑24 shows the selections you make in Import Values.

> Figure 12-24 | Import Values showing the data set field values to import

> 5 | Choose OK. Edit Parameter displays the imported values in the Selection values table, as shown in Figure 12‑25.

> Figure 12-25 | Edit Parameter displaying the values that appear in the list box

> 4 | Add a new value to display in the list box.

> 1 | Choose New next to the Selection values table.

> 2 | On New Selection Choice, as shown in Figure 12‑26:

> 1 | In Display Text, type the following text:

> All Vendors

> 2 | In Value, type the following character:

> %

> Figure 12-26 | Definition of a new value

> In SQL, % is a wildcard character that matches any sequence of characters. When the user selects All Vendors, the WHERE clause in the Products query is updated as:
> WHERE ...
> and productvendor Like %
> This query returns all rows with any productvendor value.

> 3 | Choose OK to save the new value definition.

> On Edit Parameter, the new value appears at the bottom of the Selection values table.

> 5 | Designate the new value as the default value.

> 1 | In the Selection values table, scroll to the bottom of the list.

> 2 | Select the % value.

> 3 | Choose Set as Default.

> 6 | Specify how the values should be sorted when presented to the user.

> 1 | Under Sort, in Sort by, select Value Column. This sort displays All Vendors at the top of the list in the list box because the value % appears before A.

> 2 | In Sort direction, select Ascending.

> 3 | Deselect Allow Duplicate Values.

> 7 | Choose OK to save your changes to the report parameter.

> 8 | Test the report parameter.

> 1 | Choose Preview. Enter Parameters appears, as shown in Figure 12‑27. All Vendors is the first value in the list, and this value is selected by default.

> Figure 12-27 | Enter Parameters displaying the updated vendor parameter

> 2 | Provide values for the parameters.

> o | For the first parameter, type the following number:

> 500

> o | For the second parameter, use All Vendors.

> Choose OK.
> The generated report should look like the one shown in Figure 12‑28. The report displays products, supplied by any vendor, where the quantity in stock is less than or equal to 500.

> Figure 12-28 | Report displays rows that match the specified report parameter values

(c) Copyright Actuate Corporation 2008