Adding Input Controls
Last updated
Was this helpful?
Last updated
Was this helpful?
Reports become dynamic when you add Input Controls, also referred to as Parameters, to your report. Illuminate provides three fundamental input controls that can be added to your reports. These input controls consist of:
academic_year
integer: displays date range (2014-2015) and passes the later portion of the academic year (2015)
active_sites
integer: displays the site name and passes the site_id to the report
active_users
integer: displays the user name and passes the user_id to the report
You also have the option to create two types of input controls:
Single Select List of Values: This is a static list of values you create that can be passed to your report.
Single Select Query: You can write any query that pulls data from the Illuminate database and generates results that can be passed into your report's SQL query.
After you write your SQL query, it is suggested to run the report with hard-coded values. Once your report is running locally on your computer, you can add the report to Illuminate and test in the web browser.
In the jrxml file you will add "Parameters" to make your queries dynamic. For example, if you ran the query:
This returns a list of all sites included in your database. However let's assume we want a list limited to a specified site. Add a parameter to the jrxml file by finding the report 'Outline' and right click on 'Parameters' and select 'Create Parameter.'
Notice a new parameter appears in the parameter list. Click on the new parameter and find the 'Properties' widget. Here is where you can change the Name, Class (data type), and set the expression (if any) for the parameter. Note that the Class (data type) is VERY important so the query receives the format expected so the query will properly execute. You can choose "is for prompting' if you will have the user select the value of the parameter at report run-time, or un-check this box if you want the parameter to be evaluated based on a previous parameter's value.
If you add a parameter called active_sites to the query considered above it would look like this: