Sunday, January 31, 2016

iReport-Pass a parameter value from main report's query to subreport's query



In your main report you have to "pass" all the parameters you need to the subreport.
Create required parameters in the main report by right clicking on the parameters section of main report------> add parameter

Copy parameter from master report:







Now go to XML tab:


Let's assume that in your main report you want to pass the CITY parameter to your subreport, you should have something like this code:
    <subreportParameter name="p_registration_no">
      <subreportParameterExpression><![ CDATA[$P{p_registration_no} ]] ></subreportParameterExpression>
    </subreportParameter>
In addition to this, you have to add the same parameter in your subreport (parameters-section).
Note that in the CDATA section you can have more than one parameter and you can pass parameters ($P{p_registration_no}) or fields ($F{donor_registration_no}) as well
Copy parameter & past in sub-report



Use parameter in sub-report





1 comments :

  1. There are lots of information about hadoop have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get to the next level in big data. Thanks for sharing this. Hadoop Training in Chennai | Big Data Training in Chennai

    ReplyDelete

 

Copyright @ 2014 Tech Tutorial .