Jump to content

Go to solution Solved by kkriplani,

Recommended Posts


I have a report with 5 subreports, 1 of them containing charts. Charts generated from datasets (there are 4 datasets and 8 charts), I want to pass my main report's parameter to charts in this subreport, how can that be done?

Also please confirm if this is the right way of doing, I have 5 different queries so created 4 subreports and a fifth for charts only with all 4 queries as datasets.

Thanks in advance!

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

Passing main report parameters to subreport: left click on subreport and in the properties tab you will find a property named "Parameters". That is where you link the parameters. A better explaination is given here.

However can you give a better explaination of the second question? What I understand is that you have 5 queries but you are rerunning a few queries for the chart elsewhere in a subreport. Am I right?


Link to comment
Share on other sites

Hi, we can Achieve what you are looking for . I have also Did this before :-
Suppose A is main Report and B is Chart as Sub report
Step -1 :- create a1 as parameter with  same Class(java.lanag.Integer) in both A(main report) and B(Chart ass sub report)

Step-2 :- After you create the Dataset there you can see Parameter section there you can Copy paste the Parameter what you created for A(Main report)

Step-3 :-Drag and Drop the Sub report Component from Palette then when you click on Sub report right On the right side in your Jasper studio under Properties Tab open the Sub report and there will be Parameters button click on it and Add the Parameter name(a1) and Expression as($P{a1})

Step-4:- Save your report, and compile it .

When you run the Report A(Main report) then the Value which you give in a1 Parameter the same would be seent to B(Chart as Sub report) and it will be picked up by the Data set you have created in the Sub report.

Hope this Works.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...