Jump to content
Changes to the Jaspersoft community edition download ×

Problem with $P{REPORT_PARAMETERS_MAP}


maximeg13
Go to solution Solved by C-Box,

Recommended Posts

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

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

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 + regards

C-Box

Link to comment
Share on other sites

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

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...