Filtering objects on the Canvas
You can link a control object (combo box, list box, or text box) with a data-driven object to filter the information displayed by the data-driven object. This example is based on the Q.STAFF table from the Samples repository. In this example, we use the combo box control object for filtering.
Before you begin
Create a visual query and type the following SQL statement for it:
select * from q.staff. Name this query Query 1 and save it to your workspace.
Create another visual query and type the following SQL statement for it:
select distinct job from q.staff. Name this query Query Combo and save it to your workspace.
About this task
You can use the combo box, list box, or text box object to filter your data-driven object. If you want to provide users with a list of predefined filters, use the combo box object or the list box object. If you want your users to type the filter text manually, use the text box object. In this example, we use the combo box object for filtering.
To link objects on the Canvas, perform the following procedure:
- Create an Ad hoc report.
- Add the objects to your Ad hoc report.
- In the Canvas toolbar, click Add from Repository, select Query 1 from the tree, and click Add.
- In the Canvas toolbar, click Add Combo Box to add a combo box. Click Configure Combo Box on the combo box toolbar and select Query Combo from the tree.
- Link your combo box with your table.
- Click Create Wiring on the combo box toolbar, drag the wiring line to your table, and click the table.
- In the Create Link window, select JOB from both lists and click Add.