Jump to content
We've recently updated our Privacy Statement, available here ×

Subreport-using variables from main


prasadvel

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello,

You can pass parameters, fields, and variables from the master report to a parameter defined in the sub report.

  1. Add a parameter in the sub report to accept the value from the master report.
  2. Add the sub report component to your master report.  Point it to your sub report to be used.
  3. You can map the variable from the master report to the sub report's parameter through the UI wizard in Jaspersoft Studio when you create a new sub report.  You could also modify your existing sub report component XML in the source view by adding the mapping with the below example.

<subreportParameter name="SubReportSampleParameter">

<subreportParameterExpression><![CDATA[$V{MasterReportVariable}]]></subreportParameterExpression>

</subreportParameter>

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