I'd like to share this common question to you guys.

First of all create a formula in the subreport like this one:

WhilePrintingRecords;
Shared NumberVar VariableName := SUM({TABLE.FIELDNAME});

Second, be sure to create a section just beneath the section where the subreport was placed. This makes sure that CR reads the formula in the subreport first before it reads the formula in the main report

Third, create a formula in the main report referencing the variable in our subreport. Follow the pattern

WhilePrintingRecords;
Shared NumberVar VariableName;
VariableName


HTH