i dont have a sample report
but start by inserting a sub report. there are some good instructions on the web. just search for that.
SHARED VARIABLE
Shared variables are used to pass values from sub report to the main report.
(if you want to summarize totals from a sub report with totals from the main report, you would use the following formulas to pass the value from the sub report to main report.
SUB REPORT
whileprintingrecords;
SHARED Numbervar
X := x + {field};
MAIN
whileprintingrecords;
SHARED Numbervar X;
X
Shared variables can not be suppressed.
Make the font white and the field very small.
They must be placed below the subreport to retrieve the value.