Crystal Reports - Formula - Need to do a custom summary

Hi. I have a report formatted like this: (group within a group)


CompanyA
...........InvoiceA
......................1..................23
......................5..................23
......................3..................23
......................4..................23
...........InvoiceB
......................6..................45
......................2..................45
......................1..................45
......................1..................45
................................ ||The spot||
CompanyB
...........InvoiceC
......................1..................55
......................9..................55
......................3..................55
......................1..................55
...........InvoiceD
......................6..................88
......................3..................88
......................3..................88
......................1..................88
................................ ||The spot||


I need to create a formula that sums the numbers (23 and44) and then (55 and 88).

As you can see these numbers are unique to the invoice, not to each line under an invoice.

The areas above that I have marked ||The Spot|| should read "68" and "143" respectively

I need a formula kind of like this:

Sum of InvoiceTotals for each Invoice where CompanyID = "companyA"

The "hitch" is that the details section of the report is Invoice Line Items -- so inevitably crystal grabs the value too many times for a normal summary (one time for each invoice line item)

Any ideas?

Thanks
hamlin11Asked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
Try this using formulas a variables.

Add formulas in the specified sections
In the report header
WhilePrintingRecords;
Global NumberVar CompanyTotal := 0;
''

In the Company group header
WhilePrintingRecords;
Global NumberVar CompanyTotal;
CompanyTotal := 0;
''

In the Invoice groyp header
WhilePrintingRecords;
Global NumberVar CompanyTotal;
CompanyTotal := CompanyTotal + {InvoiceTotalField};
''

In the Company Group footer
WhilePrintingRecords;
Global NumberVar CompanyTotal;
CompanyTotal

mlmcc
0
 
hamlin11Author Commented:
I'm going on the road for a few hours - I'll attempt it as soon as I get back to the office. Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.