dcrousset Posted October 6, 2006 Share Posted October 6, 2006 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 More sharing options...
rcracel Posted October 6, 2006 Share Posted October 6, 2006 I can answer your question as far as the datasource is concerned. Once you iterate over a datasource, and it reaches the end, it will always behave as empty. Datasources do not get reset between subreports. Hope this helps,RC Link to comment Share on other sites More sharing options...
dcrousset Posted October 6, 2006 Author Share Posted October 6, 2006 Thank you, I think you are right, it's a normal feature with REPORT_DATA_SOURCE. But with REPORT_PARAMETERS_MAP, is it normal too ? Link to comment Share on other sites More sharing options...
rcracel Posted October 9, 2006 Share Posted October 9, 2006 Not that I know. I pass my parameter map to all my subreports and never had a problem with it. Remember that you do need to redefine your parameters in the subreports if you want to use them. Link to comment Share on other sites More sharing options...
lucianc Posted October 9, 2006 Share Posted October 9, 2006 Never doCode:<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 doCode:[code]<parametersMapExpression>new HashMap($P{REPORT_PARAMETERS_MAP})</parametersMapExpression> instead. Regards,Lucian Link to comment Share on other sites More sharing options...
pg2000 Posted December 5, 2006 Share Posted December 5, 2006 hi dcrousset, did you manage your problem? I'm asking becauseI have the same problem now. Link to comment Share on other sites More sharing options...
Peetzer Posted January 11, 2007 Share Posted January 11, 2007 :silly: That did the trick! I don't know why. The parameters of the first subreport were given to the next that is what caused the error. The datasource is the same (scriptlet wise) but is correctly set. Thx, Peter 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