Solved

# Crystal Reports - Formula - Need to do a custom summary

Posted on 2008-11-19
Medium Priority
230 Views
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
0
Question by:hamlin11

LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 22998139
Try this using formulas a variables.

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

WhilePrintingRecords;
Global NumberVar CompanyTotal;
CompanyTotal := 0;
''

WhilePrintingRecords;
Global NumberVar CompanyTotal;
CompanyTotal := CompanyTotal + {InvoiceTotalField};
''

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

mlmcc
0

Author Comment

ID: 22998195
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

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
###### Suggested Courses
Course of the Month17 days, 4 hours left to enroll