0
votes

I am new to jasper and I'm creating a drill down report.

I followed these steps:

  1. Created the main report which has a pie chart.
  2. Added _report and TITLE_ID parameters in the hyperlink section.
  3. Created a sub-report and added the parameter TITLE_ID.
  4. Added the sub-report to the main report.
  5. Uploaded the reports into the jasper server and added input controls.

When running the report, the main report is rendering properly. When I click on one slice in the pie chart of the main report the sub-report is rendering with empty data.

Any ideas of what I can do to resolve this issue?

Thanks in advance.

2

2 Answers

1
votes

You would need to pass data parameters to your subreport in order to get it to retrieve data. What are the parameters for the subreport? Those need to be specified in the hyperlink.

For my subreports, I use a Hyperlink target of Blank, a Hyperlink type of Reference, and a Reference Expression like this:

"./ReportController?reportName=ValidationDetailsChart&hasCSV=true&reportTitle=Validation%20Details&nParms=4&parmName_1=ORD_NUMBER&parmValue_1=" + $F{ORDER_NUMBER} + "&parmName_2=USER_NAME&parmValue_2=" + $F{USERNAME} + "&parmName_3=START_TIME_MS&parmValue_3=" + $F{START_TIME_MS} + "&parmName_4=END_TIME_MS&parmValue_4=" + $F{START_TIME_MS}"

Of course, your scenario may be significantly different, but however you do it, you'll need to pass data parameters to the subreport.

0
votes

Drilling through from one report to another is handled via the ReportExecution Hyperlink type, when going from a report to a dashboard you will use the Hyperlink type Reference.

Reference: Jasper Wiki: How do I drill through to a dashboard?