I have formulas that are not working to accum grand totals

I have this Formula for Yearly Totals

Shared NumberVar yearlyWages;
Shared NumberVar GrandWages;
GrandWages := GrandWages + yearlyWages;
It is placed in Group2 footer(there is nothing in Group1 footer)
In the report footer I have this formula for Grand Total
Global NumberVar GrandWages;

Yearly wages works fine.. it is being reset to 0 in Group header 2.
The GrandWages in the report footer is 0.  It does not have the accumulated value.
What am I doing wrong?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The variable declarations must match.

Do you have a subreport?
If not then just use GLOBAL variables

for now change the formula in the report footer to
Shared NumberVar GrandWages;

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
qbjgqbjgConsultantAuthor Commented:
Thanks, I will try that.
qbjgqbjgConsultantAuthor Commented:
That worked for mostmof the totals in my grand total line except for 1 that is a little more complicated. I have this formula in Group2 Footer
Shared NumberVar yearlyWages;
Shared NumberVar MatchAllowed;
Shared NumberVar GrandAllowed;
Shared NumberVar Yearly401K;
Shared NumberVar Yearly401KM;
If (yearlyWages * .10) <= Yearly401K then
MatchAllowed := (yearlyWages * .10) * .10
MatchAllowed := Yearly401K * .10;
GrandAllowed := MatchAllowed;

and this one in Report Footer

Shared NumberVar GrandAllowed;


It is only getting the previous total.
MatchAllowed is not being cleared anywhere. It is working fine, just not accumulating in GrandAllowed.
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

qbjgqbjgConsultantAuthor Commented:
Never mind, I think I see it.
qbjgqbjgConsultantAuthor Commented:
How do I submit it. I selected your answer as best answer.
Just click the BEST SOLUTION box in the comment
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.