You can "share" the subreport field with the main report by setting it up as a shared variable. In the subreport, create a formula {@sharedvar}:
whileprintingrecords;
shared numbervar amt := {subreport.field};
You must place this formula somewhere on your subreport canvas. Then in the main report, you can reference this field and do calculations with it, as in the following which sums the subreport amount in the main report:
whileprintingrecords;
shared numbervar amt;
numbervar grtot := grtot + amt;
The shared variable must be used in a section of the main report lower than the one in which the subreport is located.
To display the grand total of the shared variable, you would use a formula like the following in the main report footer:
whileprintingrecords;
numbervar grtot;
-LB