Jump to content
Changes to the Jaspersoft community edition download ×

REPORT_PARAMETERS_MAP not passed 2nd subreport


dcrousset

Recommended Posts

I have a report that contains 2 subreports.

 

I'm using JasperReport 1.2.5 (also tested on 1.2.7)

 

In subreports, in parameter map expression, I have "$P{REPORT_PARAMETERS_MAP}".

 

the parameter map passed to the first sub report is be correct, the subreport is correctly showed.

 

My problem is : the other subreport who contains the same parameter map expression don't receive the parameter map, all parameters are null.

 

I have tested to put the second subreport above the first subreport. The problem was resolved for this subreport, but the first subreport (now below the second) got the problem !

 

I see also this problem for the datasource expression "$P{REPORT_DATA_SOURCE}".

 

Is anybody have encounter this problem ? Anybody found a workaround ?

 

Thank you and sorry if my english is not excellent ;o)

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Never do

Code:

<parametersMapExpression>$P{REPORT_PARAMETERS_MAP}</parametersMapExpression>

The map you pass to the subreport will get altered during the subreport fill and can have all kinds of consequences.

 

If one wants to pass all the parameters of the master report to a subreport, one should do

Code:
[code]
<parametersMapExpression>new HashMap($P{REPORT_PARAMETERS_MAP})</parametersMapExpression>
instead.

 

Regards,

Lucian

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

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