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

Counting records in Group Footer 1

Status
Not open for further replies.
Jan 30, 2002
23
US
I am using Crystal 8.5, connecting to an Oracle database. Let me state from the beginning that there are probably better ways to get at the information that I need but this is what I have. I am willing to rewrite the report from scratch or fix what I have. Any help is very welcome.

I have 3 groups
Group 1 – Case Manager
Group 2 – Claim type
Group 3 – Claim number

In Group Header 3, I have a @HeaderVar to reset the @DetailsVar back to 0
whileprintingrecords;
numbervar Counter:=0

In the Details section, I have a @DetailsVar to count each detail line
whileprintingrecords;
numbervar Counter;
Counter := Counter+1

In Group Footer 3a, I have a @FooterVar to determine if the Claim is Open or Closed
whileprintingrecords;
numbervar Counter;
if remainder(Counter,2) = 0 then
"C"
else
"O"

Group Header 3, Details and Group Footer 3a are all suppressed.

In Group Footer 3b I put the actual information that I want displayed based on whether @FooterVar = “O”

Now what I want to do is count how many claims are open. Basically I want to count each record in the Group Footer 3b section and reset it for each change of Group 3 (Claim number).

TIA

Cathy (a.k.a. Travlnbard)
 
I'm guessing that you mean that you want to know the number of claims counted at the claim type or case manager level.

Adjust the group footer 3a formula as follows:

In Group Footer 3a, I have a @FooterVar to determine if the Claim is Open or Closed
whileprintingrecords;
numbervar Counter;
stringvar output:="";
numbervar Open;
if remainder(Counter,2) = 0 then
output:="C"
else
Open:=Open+1;
output:="O";
Output

Now you have a counter called Open adding them up, at question is wher you are outputting, and including a reset variable at it's group header section for Open of:

whileprintingrecords;
numbervar Open:=0;

and displaying using:

whileprintingrecords;
numbervar Open

Obviosuly if you reset this counter at group3 then it will always be 1 or 0.

-k
 
Thank you! It worked (almost) perfectly. I had to change @FooterVar to:
whileprintingrecords;
numbervar Counter;
stringvar output:="";
numbervar Open;
if remainder(Counter,2) = 0 then
output:="C"
else
output:="O";
if output="O" then
Open:=Open+1;
Output

It didn't like have the "Open:=Open+1;" after the "else". It said it had to be a string. But with a little tweaking I made it work.

Thanks again.

Cathy (a.k.a. Travlnbard)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top