follower Posted March 24, 2016 Share Posted March 24, 2016 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! Link to comment Share on other sites More sharing options...
Solution kkriplani Posted March 24, 2016 Solution Share Posted March 24, 2016 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 Link to comment Share on other sites More sharing options...
santosh.audi19 Posted March 24, 2016 Share Posted March 24, 2016 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 reportStep -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. Link to comment Share on other sites More sharing options...
follower Posted March 24, 2016 Author Share Posted March 24, 2016 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now