Reproducing Steps:

Use "Customer" table for the main report and insert a sub report and place the sub report in group footer.

Create a formula declare and initialize the value as shared variable in the subreport.

Formula :

Whileprintingrecords; shared numbervar total:= 100;

Create a formula in the main report and declare the same shared variable and place the formula in the group footer next to the subreport.

Formula : Whileprintingrecords; shared numbervar total;

Cause

When we use a shared variable in a particular section and pass this variable to the main report and display it in the same section, then we find that the variable does not pass the value as a shared variable.

Resolution

To rectify the problem, ie) for the proper functioning of the shared variable we have to follow the below steps..

Declare a variable as shared while writing the formula in a subreport and place the formula in the sub report

Use the same variable in main report which was declared as shared in subreport.

Insert a new section below the sub report and place the main report formula in the new section.