In this step of the Cascading Input Controls case study, we will create an Input Control for selecting Courses that is dependent on the selected Course Categories from the previous Input Control created in the previous step. Once a value or values are selected in the Course Categories Input Control, the Cascading Courses Input Control will live-update, and only allow the user to choose from Courses within the selected Course Categories.
The process of creating this Cascading Input Control is similar to the process of creating a Standard Input Control, except for the parameter referenced in the query —here, the query will reference the parameter name of the Course Category Input Control.
In the Query String field, enter the following query:
select id, shortname, fullname from mdl_course where $X{IN, category, course_category_id_1} order by sortorder |
The where clause $X{...} means that you want to select values where mdl_course.category match course_category_id_1
click the Save button. The Save Parameters page appears:
In the Value Column field, enter "id". This enables the Input Control window to present values based on the ID fields from the mdl_course_categories table.
In the Visible Columns field, enter "fullname" and click the Add button. This enables the Input Control window to present the ID fields by their associated name. In this case, this will display the Course Categories by their proper names instead of their IDs.
Click the Submit button.
Proceed to Adding the Input Controls to the Report.