Jaspersoft BI Tools

iReport,Jaspersoft Design Studio,Jaspersoft Server, Schema Workbench,Analysis,Dashboards, Self Service BI, Domains,Topics,Ad-Hoc Reports, Jaspersoft ETL, Embedding BI,HTML-5 charts, Fusion Charts,JFree Charts,Drill down reports , Drill down Dashboards,Visualize.js, Performance Tuning, D3 Charts, Jaspersoft Customization

Tuesday, April 22, 2014

Drill down functionality example on HTML-5 charts in jasper iReport

Hi Guys,

Here is a work out on drill down functionality using HTML-5 charts in iReport/Jasper Studio.

Example :
iReport 5.5 jasper server 5.5 and foodmart database.
Report 1 : Pie Chart
 Report 2 : Table component 

On pie chart you'll be showing the top 10 total sales values city wise
On click on a slice(a particular city) you will be navigating to the drill down report which will display the customer details per that city.

In simple, On clicking on city slice, the report has to pass city value from main report to drill down report in next page.


Source Code of this example : Click Here : Just Import to the server and see the report preview and check out the functionality using iReport tool by opening jrxml files.


Core part of the example :
Right click on Pie chart -> Data Axes -> Advanced Properties -> Click on Add (Optional: By clicking on Hyperlink you will get 2 default parameters - Don't for this for the 1st time , once you get familiar with drill downs you can make use of it).

As shown in below figure you need to set the HyperlinkType and HyperlinkTarget with the drill down report URL using _report parameter. The other parameter is city  which will have to pass the value of city field when you click on the slice.





HyperlinkTarget

 Hyperlink Type:

Drill down report URL


Passing field value from city parameter 


Before writing this expression you need to Define City Bucket at Data Axes Categories section.
below picture gives an idea.




Out put :
See the preview, you will get the out put 1st two images in this post

Suggesting you to download and look at the JRXML's for better understanding of drill downs on HTML-5 Charts.


Reference :
http://community.jaspersoft.com/wiki/html5-charts-ireport