Using Multi-select parameter in Jasper


Using Multi-select parameter in Jasper

Parameters can be the filter conditions which can be applied in the data-visualizations. This bog gives steps wise description of creating a multi-select parameter while developing report.

There are 2 different types of Parameters
1. Single select
2. Multi-Select

creating Parameter in Jasper Studio:

For Example there are employees in a department and a report generates the employee details department-wise. If the user wants to view employees from more than 1 department user can create multi-select parameter in that case.

Following are steps to create a parameter

step1: In the outline to the left side of the jasper studio we can find parameters. Right-clcik and create a new parameter.for eg: lets create a parameter with name “dept” and in the class definition we must give “java.util.Collection”, we can also give default values it is optional.

Capture1

step2: In case we are using sub-report or the table component we need to pass the same paraeter with same name to the sub-report/table. In the above example we are using table. Click on table in the table component and in the properties pane select dataset table u will find the following

Capture2

step3: Then add the parameter from main report to the table/subreport.
and click on finish.
Capture3

step4: Using the parameter in the query. following is the syntax for using multi-select parameter in a query.

where $X{IN,d.department_id,dept}
Capture4

Thanks
Asha Bidiyasar

Passing parameters from parent job to sub job/transformation in Pentaho Data Integration (Kettle) -Part 2

Passing parameters from parent job to sub job/transformation in Pentaho Data Integration (Kettle) -Part 2

In part 1, I have mentioned about passing parameter values down to sub-job/transformation using setter/getter methods.

Please refer my previous post for part 1 Passing parameters from parent job to sub job/transformation in Pentaho Data Integration (Kettle) -Part 1

But in this part we will use executor steps to do the same process.

Part 2 : Using job/transformation executor steps :

In order to pass the parameters from the main job to sub-job/transformation,we will use job/transformation executor steps depends upon the requirement.

Following are the steps :

1.Define variables in job properties section
2.Define variables in tranformation properties section
3.Configure job/transformation executor step

1.Define variables in job properties section :

Right-click any where on your job and select settings and go to parameters section.Define all the variables and assign some default values to each.

job_properties_pdi

2.Define variables in transformation properties section :

Right-click any where on your sub job/transformation and select settings and go to parameters section.
Use the same variables that you have defined in your parent job (i.e.Step1) and assign some default values to each.
transform_proeprties_pdi
3.Configure job/transformation executor step :

In this step,we have to configure sub job/transformation path details and need to pass the same parameters in job entry details section like below.

Double click on job/transformation executor step and provide transformation file path details.

transform_executor_config

Go to parameters section and make sure you have checked the Pass all parameter values down to the sub-transformation check box.

transform_executor_params

So now you can utilize same variables in your sub-transformation.

 

Thanks,

Sayagoud