How to pass values from subreport to main report?

Developers will often will have this necessity to send the values calculated in the sub report to the main report. This can be achieved in the following way.

1.Create a variable in the subreport (for example “mainreportvlaue”
2.Do all the manipulations and store the value finally. Upto this step developers won't find any problem. But after this they will get confused that how to send the values to the main report
3.In the main report add one varible to receive the value send from the subreport. For example”subreportreturnvalue”
4.In the main report click the sub report – properties.

5.Go to the Subreport(other) tab

6.In the Subreport Variable add variable name “mainreportvlaue”
7.In the LocalDesitinationVariable add variable name “ subreportreturnvalue”
8.The Subreport value will be returned to the main variable.

1 comment:

Anonymous said...

hi sir i fallow this process but my result is null answer i use jasper ireport 5.6.0

Post a Comment

Page copy protected against web site content infringement by Copyscape