maximeg13 Posted May 20, 2019 Share Posted May 20, 2019 Hello,I’m facing a problem since I updated my Jasper Library from 3.0.0 to 6.6.0.I used to use the parameter “REPORT_PARAMETERS_MAP” in order to generate my summary. The main report contained subreport which filled this map and at the end of the generation, the summary used this parameter to create each title linked to its associated page.Now the problem is the following: The changes made on the parameter “REPORT_PARAMETERS_MAP” cannot be seen in the parent report. For example, if I do “$P{REPORT_PARAMETERS_MAP}.put (“Object1”, “Text”)” in a subreport, I won’t be able to get the value of the “Object1” elsewhere but in this report and its subreport. I use the REPORT_PARAMETERS_MAP as a parametersMapExpression in each call to a subreport.I read that the way to pass a map to a subreport changed in the 3.0.1 version but I still can’t find how to make it work.Do you have any ideas?Thanks. Link to comment Share on other sites More sharing options...
Solution C-Box Posted May 20, 2019 Solution Share Posted May 20, 2019 When I remember rigtht, the default ReportParametersMap is CLONED when it's passed to a SubReport. I think you should create an own "TopLevel parameter" of type HashMap and pass this own map as single SubReportParameter from MasterReport to each SubReport. Not sure if each SubReportParameter was cloned also when it's passed to the called SubReport. But worth to give it a try.The other idea would just be a simple ScriptletClass that you could use for collecting such things over several report levels.hth + regardsC-Box Link to comment Share on other sites More sharing options...
maximeg13 Posted May 21, 2019 Author Share Posted May 21, 2019 Hello,Thank you for your answer, I'll try to create my own HashMap and use it like I need.I'll also try the ScriptletClass if I can't make it work.Regards Link to comment Share on other sites More sharing options...
maximeg13 Posted May 24, 2019 Author Share Posted May 24, 2019 Hello,My problem is solved, I created my own HashMap parameter and it worked like a charm, I didn't even need to pass it as a subreport parameter, just to create it in main and sub reports and instanciate it in main.Thanks for your help !Regards 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