crystal-reportscrystal-reports-2008

How can we get a correct running total when we are suppressing a field if the check No's are duplicated?


We have a report which is grouped by contract/job, then by Invoice. Within the invoice section, there are details per check No. regarding how much the customer paid towards their invoice with that check. We don't want multiple lines per check, even though there can be multiple lines from the same check. In other words, we have suppressed the section based on:

{ARTL.Amount}=0 OR {ARTH.CheckNo}=Previous({ARTH.CheckNo})

The problem is, if there are multiple lines per check, the amount is only pulling in the first amount in the list. For example, we have check 1234 that was for a total of $10,000. But, there may be one line worth $123 applied and the next line worth $500 applied. We want the first line to display the total amount, in this case, $623.

How can we do this? Running total does not seem to work and I have tried using a formula (see below) which also did not work.

IF NEXT({ARTH.CheckNo})={ARTH.CheckNo} THEN ({ARTL.Amount}+{ARTL.Amount}) ELSE {ARTL.Amount}

I also tried this formula:

IF {ARTH.CheckNo}=PREVIOUS({ARTH.CheckNo} THEN ({ARTL.Amount+ARTL.Amount}) ELSE {ARTL.Amount}

Any help is greatly appreciated!

Thanks.


Solution

  • Add a group on check #. Suppress the details (the customer's remittances against each check). Add a summarized field on the amount field. Include all relevant check details in the check #'s group header. Move the summarized field to the header and suppress the footer.