Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summarize on Formula?

Status
Not open for further replies.

Roni1

Programmer
Dec 4, 2001
36
US
I have a formula that evaluates for every Group Footer.
How can I summarize the results of that formula on the Report Footer?

I tried everything I know with no success.

Please help!!!

Roni
 
Re-create the formula at report level.

You're up against a basic feature of Crystal, processing in a distinct sequence. Unlike a conventional programming language, values may not yet have been calculated at the time you want to use them. Madawc Williams
East Anglia
Great Britain
 
You could also create a variable to do your summary then display that variable's value at the end of your report. Here's an example:

Assume the formula you want to summarize is MyFormula

We'll name the variable SumOfMyFormula

You need to create another formula that will reside in the same band of the report as MyFormula. In that new formula, you need the following:

<Begin Formula Text>
Shared Numbervar SumOfMyFormula;
SumOfMyFormula := SumOfMyFormula + MyFormula
<End Formula Text>

Then at the end of your report, you'd create another formula with the following text:

<Begin Formula Text>
Shared Numbervar SumOfMyFormula;
<End Formula Text>

Some may question my use of Shared vs Global, I've had difficulties using Global and Shared has always worked, hence my use of Shared ;P

Hope this helps

dw
 
Thank you DW ... it works very well.

Now I just need one more thing ... if possible:

I also need to have a subtotal for another group like:

Group 2 - 25 (formula)
Group 2 - 10 (formula)
Group 2 - 5 (formula)
Group 3 - 40 (summ of Group 2).

How can I do that?

Thanks in advance!

Roni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top