In this article
The Input control available in the Visual Component toolbox enables the viewer to filter reports on an Input field.
The following is an example of how you could provide two different input controls on a report page so the viewers can filter the data. One input control is set up for numerical input (the user can type in a number) while the other is set up for open text input. The button allows the viewers to refresh the table and chart after they have changed the inputs.
- Open the Page Editor for the page on which you wish to place the Input controls.
- From the Visual Component toolbox, drag two Input controls and a Button and drop them into the desired locations on the page, then save the changes.
- Open the Properties page for each Input control in turn and set the Content Type of one to Text and the other to Integer .
- Go to the Report toolbox, and create two parameters in the Parameters folder (go to Parameters Overview for more information)
- Open the Properties page for each parameter in turn and set the Type of one to Numeric Response and the other to String Response .
- Reopen the Page Editor and drag the p_numeric parameter (or whatever you have called it) into the numeric (Interger) Input control and the p_string parameter into the Text Input control.
- On the report page, create an aggregate table based on the question containing the data you wish to allow the user to filter.
- In the Filters toolbox, create two filter expressions (go to Creating a New Filter Expression for more information).
- Rename the filters Numeric and String to simplify identification.
- In the Numeric filter, type the required expression and save the changes.
- In the String filter, type the expression q_open = PValStr("p_string") and save the changes.
- Connect the filters to the aggregated table.
- Double-click on the Button control or right-click on it and select Properties to open the button's Properties page. Leave the Target Page blank so the current page is re-displayed (refreshed) and add suitable text to the Label field, for example Refresh.
- Click Apply and Close, and then Save so save the changes.
- Go to the Report > Preview Report menu command to view and test the setup.
Figure 1 - Specifying the Content Type for an Input control
Figure 2 - Specifying the Type for a Parameter
In the example, the expression used is q_numeric > PValNum("p_numeric"). This expression will show in the table and chart all data with a value greater than the value the user types into the Input control. Note that the "p_numeric" in the expression is the name you have given to the numeric parameter, and is case-sensitive.
This expression will show in the table and chart all data corresponding to the text string the user has typed into the Input control. Note that the "p_string" in the expression is the name you have given to the text string parameter, and is case-sensitive.
To do this, go to the table and open its Properties page. On the General tab, click the ... button beside the Filters property to open the Report Filters window. In this window, select the two filters and lick OK.