1269195 - Manual total adding in last value again

SAP Knowledge Base Article - Public

1269195 - Manual total adding in last value again

Symptom

When using a forumla to work as a running total in the details section the last value is duplicated when the formula is displayed as a total in the footer.

Reproducing the Issue

Have a formula that consists of a running total and a shared variable, such as:

shared numbervar mastersum;
mastersum:=mastersum+tonumber({Account.Account Number});

Cause

When placing the formula in the footer Crystal is still executing it one last time with the last known value

Resolution

Create a second variable that will run "behind" the one that adds and use that one to display, an example being:

shared numbervar mastersum;
shared numbervar finalsum;
mastersum:=mastersum+tonumber({Account.Account Number});
finalsum:=mastersum;

And then a second formula for the footer that would consist of:

shared numbervar finalsum;
finalsum;

Keywords

last value, sum, running total , KBA , BI-OD-CR , CrystalReports.com , Problem

Product

SAP Crystal Reports XI ; SAP Crystal Reports XI R2