Passing parameter to subreport chart dataset

0

Hi,

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!

follower's picture
Joined: Aug 5 2011 - 12:27am
Last seen: 3 years 6 months ago

3 Answers:

2

Hi,
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?

Regards,
KKriplani 

kkriplani's picture
847
Joined: Sep 4 2015 - 2:18am
Last seen: 2 weeks 4 days ago
1

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.
 

Thanks,
Santosh.

santosh.audi19's picture
Joined: Sep 9 2015 - 9:58am
Last seen: 1 year 1 month ago
0

Hi,

Thanks both for the response, I already passed main report parameter to my subreport, had problem with dataset parameter in chart which I resolved.

Thanks!

follower's picture
Joined: Aug 5 2011 - 12:27am
Last seen: 3 years 6 months ago
Feedback