Parameters enable the final user to interact with the contents of the report, allowing the reports to present dynamically generated content and adapt to the needs of the user.
Pentaho Report Designer (PRD) allows the inclusion of parameters in its reports by means of a fairly nice UI. Parameters in PRD can be quite simple, such as the selection of a value from a list, or more complex, such as when nested parameters are created so that setting a value in one of them causes the modification of the values of others. This means that the data set obtained by the nested parameter depends on the values selected in another parameter. In the first case we could establish a list containing every year in which films were rented, and have the user select one of them:
In the second example, we could create two parameters so that one of them holds every country, and the other one holds every city available, and have them behave in a way such that when the user selects a country, the other parameter presents the cities belonging to the country previously selected:
When nesting parameters, there is no limit as to how many hierarchical levels can be created.
At the time of adding parameters to our reports we can also use one single report and make it adapt to different use cases. For example, a production report grouped by the assembly line on which every manufactured product is present could be (and it is, in fact) too much information to present on a single report. In this case the addition of parameters to select the assembly line and/or the product type not only simplifies the report but also enables this report to be used by different users with different needs for information.
Another important point to consider is the possibility of creating reports that provide an analysis of more details and focus on the need for information of the current user.
By configuring our parameters on PRD, we are able to determine the way in which these will be presented to the final users. Next, we will explain each of these selectors or display types using as an example the film's rating list, whose values can be: G
, PG
, PG-13
, R
, or NC-17
.
We will now look into the different display types available for use: