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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

manual running totals

Status
Not open for further replies.

Lintem

IS-IT--Management
Aug 1, 2007
5
GB
I'm trying to help a friend who is writing some reports - she doesn't have access to the internet, and I haven't had access to Crystal for 2 years!!

What she wants to do is create a formula that will display a running total on the detail line and then the total at the end - she can't just use recordnumber because there are suppressed details.

From memory, I thought you could put a formula in the header - something like count:=0;
Then a formula in the detail line for count:=count+1;
and then a formula in the footer just displaying count.
Could someone help me get this in the right syntax or tell me if I'm on the right track?

Many thanks - Emma
 
Running totals can include a test, the inverse of the test used for record suppression. Done manually, it could be
Code:
whileprintingrecords;
if {BillType} = "P" then
NumberVar MyCount:=MyCount+1

It's also possible to put similar tests in a Running Total created using Insert > Field Explorer. I'd have thought that more convenient, but it might depend on Crystal version. Always best to give the version.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Several thoughts:

1) Don't supress any records. Instead use a record selection formula to exclude the undesired records from the report. If you do this, recordnumber should work.

2) If you have to have suppressed records, and she has crystal 8 or newer, insert a running total field, evaluate based on a formula, make the formula the opposite logic of the supression formula, reset=never

3) the manual running total method: No header formula required, just put the following in the details section:

WhilePrintingRecords;
If <<insert the opposite of supression logic here>> then Numbervar Mycount:=Mycount+1

Mycount;

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top