We are creating a custom drill down function using java script code , we will explain drill down for pie chart as well as
Tabular report. Follow below steps in order to creating custom drill down functionality with child dashboard.
Step 1: – Create a Parent Report and apply a filter as per your requirements.
Step 2: – Create a Child Report1 and apply a filter as per your requirements
Step 3: – Create a Child Report2 and apply a filter as per your requirements
Step 4: – Now Create Dashboard using that two Child reports
#Save this Dashboard and open it again in a new window Please copy this Child dashboard URL.
Step 5: – In parent report we need to inject JS script .
We are providing drill down scripts for Pie char as well as tabular report :
A. Use below script for Pie chart :
hi_container.set("preExecution",function(c){ var viz_Options = c.get("viz_Options"); viz_Options.chartOptions.data = { selection: { enabled: true }, onclick: function(d,element) { var drilDownValue=d.name; var b = c.get("requestData"); var paramValue=b.filters[0].values[0]; window.open('http://216.48.177.235:8085/hi-ee/hi.html?dir=1655180158371&file=d2b0844b-2b98-4d63-9c44-ac0fb2f18402.efw&mode=open&travel_medium='+drilDownValue+'&destination='+paramValue,'_blank') } }; c.set("viz_Options",viz_Options); });
B. If Parent report is tabular report apply below JS script
hi_container.set('postExecution', function(a){ var b = a.get("requestData"); var paramValue=b.filters[0].values[0];//parameter value var iframee = $('table tbody tr').on('click', 'td:nth-child(1)', function () { var rowdata = this; var drilDownValue=$(this).html();//clicking the drilDownValue window.open('http://216.48.177.235:8085/hi-ee/hi.html?dir=1655180158371&file=d2b0844b-2b98-4d63-9c44-ac0fb2f18402.efw&mode=open&destination='+paramValue+'&travel_medium='+drilDownValue,'_blank') }); })
And paste the URL that you had copied in place of Window open (‘http://——) and copy the entire JS script
Step 6:- Need to go back again for Parent Report and open in a new window
Now you can redirect the child dashboard as per your filter is selected EX. (travel_medium=” Bus”) .
Now used the filter as you want to apply
Now you can see the Child Dashboard is reflecting respect to Parent Report.
Thank You,
Shreshtha Shil
Helical Insight