Skip to Content
0
Former Member
Jul 07, 2009 at 06:10 AM

How to sum a shared variable

199 Views

Hi All

I am using Crystal XI and have my shared variable displaying on my main report but can't get the total of these in the RF. Report is as follows;

details a;

@sumtotal

whileprintingrecords;

numbervar sumtotal:=0;

details b;

subreport

details c;

@sum of shared

whileprintingrecords;

numbervar sumtotal;

shared numbervar lineamt;

sumtotal:=sumtotal+lineamt; (this calculates and displays fine)

RF;

whileprintingrecords;

numbervar sumtotal; (this displays as 0)

I either have the wrong formula or it is in the wrong place.

Thanks in advance.