To share a variable in crystal reports between a subreport and the main report you can do the following.
In the sub report create a formula and add this:
Shared NumberVar TheAnswer := 41;
Then in the main report you just add this in a formula:
Shared NumberVar TheAnswer; TheAnswer
This will print out 41 in the main report.
Bur remember that the sub report must be executed before the formula in the main report, else the answer is 0 or null.