0

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.

pb2q
  • 58,613
  • 19
  • 146
  • 147
Hari
  • 69
  • 3
  • 9

2 Answers2

1

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.

Jeremy Goodell
  • 18,225
  • 5
  • 35
  • 52
  • Thanks for your help. I used Hyperlink type of Report Execution and added parameters. – Hari Jun 08 '12 at 04:49
  • Glad to help Hari. On stackoverflow, if you consider an answer to be correct, you can "accept" the answer by clicking the little check mark next to the answer. This will let others know that the answer worked for you. If you appreciate someone's help with an answer, you can also click on the upvote (^) next to the answer. You may upvote any number of answers on a question, but you can only accept one. Thanks! – Jeremy Goodell Jun 08 '12 at 13:13
0

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?

CᴴᴀZ
  • 521
  • 7
  • 20