0
votes

I have created a report (Crystal Reports 2011) that displays payment Data in details section, with Invoice Date as Group. Detail Fields are InvoiceNo, Amount and PaymentCode. The latter is “1” for Cash, “2” for VISA and “3” for MC. The Group and total footer now has a count field for number of Invoices, and a Sum for Amounts. I need to add Counts as well as Sum per PaymentCode here as well. How to proceed?

1
can you show design, unable to understandSiva

1 Answers

0
votes

My solution (probably not the optimal) would be to create as many global variables as needed, 6 this time (3 for each SumPaymentCode and 3 for each Count). Set them to 0 in the Header and put a field in Details with a condition to sum the proper value. If i'm not mistaken should be something like this:

Declaration of the global variables:

Global numbervar countCash;
Global numbervar countVISA;
Global numbervar countMC;
countCash:=0;
countVISA:=0;
countMC:=0;

Conditional statement:

Global numbervar countCash;
Global numbervar countVISA;
Global numbervar countMC;

if{fieldPaymentCode = 1} then countCash := countCash+1 
else if{fieldPaymentCode = 2} then countVISA:= countVISA+1 
else countMC := countMC+1;

Do the same for the other field.

Hope it helps!