Question

I'm using Pentaho Report Designer 3.9.4 and a db2 database. I have 4 variables that I need to pass in to my Pentaho report through a stored procedure call, 3 of which are driven by the user.

CALL SCHEMA.STORED_PROCEDURE ('DATA', ${START_DATE}, ${END_DATE}, ${PARM_YEAR})

The rows of data are provided by the first variable 'DATA' which will be hard coded. I have a drop down box parameter PARM_YEAR that allows the user to choose and drill down to a specific year. I also have date picker parameters START_DATE and END_DATE that receives the start and end date values from the user retrieving the desired results from that specified date range. The PARM_YEAR and date range parameters (START/END_DATE) need to be optional. If the user selects a year with the drop down parameter PARM_YEAR then the report will produce the results and vice versa for the date picker parameters. In order to retrieve the results for the date range selected the PARM_YEAR parameter must equal zero.

CALL SCHEMA.STORED_PROCEDURE ('DATA', ${START_DATE}, ${END_DATE}, 0)

Any help would be appreciated.

Was it helpful?

Solution

I found an answer. Make the PARAM_YEAR parameter optional (not mandatory). Then add a new hidden parameter to the report and give it a post-processing formula of "=IFNA([PARAM_YEAR]; 0)" to provide a value when your year is not set. Or list the zero option as one of the selections in your PARAM_YEAR if it is a drop-down parameter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top