prasadvel Posted March 6, 2021 Share Posted March 6, 2021 How can we use the variables from main to sub report? or should we use the same sql again in sub report as i need to get the summary from mainreport Link to comment Share on other sites More sharing options...
jabrown Posted March 11, 2021 Share Posted March 11, 2021 Hello,You can pass parameters, fields, and variables from the master report to a parameter defined in the sub report.Add a parameter in the sub report to accept the value from the master report.Add the sub report component to your master report. Point it to your sub report to be used.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 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