When we return value from sub report to main report, we need to create a variable in the sub report to assign the field value, which we want to return.
For example if we want to return Sum, which we calculated using query in the subreport, we need to create a variable called sum, then assign variable expression as $F{sum}. Calculation, Reset type and Increment type should be set to None. Class variable should be of the type of Field.
Then we need to create a variable in the main report to pass the subreport value. Select the same variable as 'Variable Expression'. Calculation, Reset type and Increment type should be set to None. Class variable should be of the type of Field.
Select subreport in the main report, click on 'Return Values' in the properties. Click on Add. Type the Subreport Variable sum, Select the variable created in the main report as value of 'Local destination variable', Select 'Nothing' as 'Calculation type' and click on OK.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment