After creating the parameterized report in iReport, we are going to learn how to create an input control for a parameterized report in JasperServer.
Once you click Input Control, you will see a Create Input Control page, in this page you need to select the type of input control from drop down list, list contain so many types like Single Value, Single Select List of Values (radio), Multi Select List of Values, Single- select Query, and Multi-select Query. For the report which we developed in previous post we are going to create single-select query input control, all the query based input control such as single-select query fetch the data from database and shows as input control values in JasperServer.
Select Types- Single-select Query (radio)
Prompt Text (required) – Select Year (Prompt for parameter)
Parameter Name (required)- p_year (It’s case sensitive, it should be same as iReport parameter name )
Next, Enter Query Name then Next, select Do not link a data source and Next, In this step we have to define a query for input control.
SELECT DISTINCT year(ORDERDATE) year FROM ORDERS
Then Next and set Parameters Value:-
Value column- year (column of a query)
Visible column- year (column of a query) and click “add” and submit.