Saturday, 28 March 2020

Drill down from Parent report to Child report in Jaspersoft Studio reports - Pie chart to tabular data drill down video tutorial

Software : 
----------------
1) J. Studio 7.2 pro
2) Jasperreports server 7.5 Enterprise


Requirement :
-----------------
Drill down to customer detailed report from customer total number of cars by occupation
i.e., Pie graph to tabular data.

Watch 10 min video tutorial: 


Click on image to get best view of content: 

SQL query :
--------------
Parent report :
-----------------
select occupation, sum(num_cars_owned) cars  from customer
group by occupation
order by occupation

Child report:
-----------------
select * from customer where occupation= $P{paramOccupation}

Steps :
-----------
1. Design Parent report with Pie graph.
2. Design Child report with tabular data having "paramOccupation" parameter.
3. Publish Parent report and unit test the output.
4. Publish Child report and unit test the output with various input values for the parameter.

Hyperlinking/Drill down to the Child report from Parent report
----------------------------------------------------------------
1. Edit the Pie vizz. of Parent report.

2. For Categories Levels, create "Bucket Properties" i.e., paramOccupation=$F{occupation}

3. For Measures, click on "Edit Hyperlink" -> check "Use Hyperlink"

4. Click on _report[SeriesItemHyperlink] -> Use Constant value i.e.,_report=/Praveen/Child

5. Clcik on Add to link the parameter
 
   PropertyName=paramOccupation
   UseBucketValue=Level1.paramOccupation

Click on image to get best view of content:  


Post linking steps:
----------------------
1. Re-publish the Parent report.
2. In the server, edit the child report --> navigate to "Controls and Resources"
3. Change : Display Mode= In Page and un-check "Always prompt"

NOTE:
---------
1. In the Child report JRXML, for the parameter, check the "Is For Prompting" property.




No comments:

Post a Comment