colditz Posted March 12, 2012 Share Posted March 12, 2012 Hi all. I need to pass some parameters from the main report to the subReport.I've read the way to do it is within the properties the "parameters map expression" property write a name of parameter HasMap type. Ok, i have this parameter associated to this property.In the property "Parameters" is added the previous parameter.Now my problem is in the subParameter i dont know how to recovery the values. For example in a text area i have write $F{subParameters}.getValue("price"). I got an error "dont understand getValue method what is.thanks to all!! Link to comment Share on other sites More sharing options...
augarte Posted March 12, 2012 Share Posted March 12, 2012 Hi, You don't need to use any function to display the values of the parameters of your main report in the subreport. You just have to select the 'Parameters' option in the subreport properties and then select "Copy from master" option. This will create the parameters in your subreport and then you just need to drag and drop the needed parameters in the band you want to display them. I send you an attached image to check where is this option. Hope this helps. Regards. Link to comment Share on other sites More sharing options...
colditz Posted March 12, 2012 Author Share Posted March 12, 2012 Other way I've tried is as you say. Using the parameters property in the subreport area. But I think is not neccessary copy from master because I have already include the parameters I want to pass.So, If I have a parameter in the main report, included in property Parameters, and this property is dropped wherever I need it, it should show the value. But the report always show null. Post Edited by colditz at 03/12/2012 10:26 Link to comment Share on other sites More sharing options...
augarte Posted March 12, 2012 Share Posted March 12, 2012 You say "I have already include the parameters I want to pass"... where did you include these parameters? Did you create them manually in the subreport? I don't know what do you mean with that...I only used 'Copy from master' option for my subreports and the parameters of the subreport where created automatically and defined as it is shown in the picture. Link to comment Share on other sites More sharing options...
andrestrindade Posted August 20, 2012 Share Posted August 20, 2012 But If I want to acess the fields from master report, what could I do !?Because I already used a JRBeanCollectionDataSource to pass data to my Report. And I used the paramaters to pass my Subreport file (A ArrayList of type <String, JasperReport> ). 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