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

Suppression on Group Line 1

Status
Not open for further replies.

MikeCopeland

Programmer
May 21, 2007
91
US
Using CR XI...
I have the following formula that produces a value that I'd like "duplicae suppression" applied. The formula is placed on Group Footer #4, and the Format Editor won't process the "Suppress If Duplicated" box when I check it. I understand that this option doesn't work well in a Group Footer, but I don't know how to do it another way (e.g. global variable that's checked within the formula, etc.). Please advise. TIA

// @Status
if({ClientPacket.PacketKey} = 42) then "Discharge"
else
if({ClientPacket.PacketKey} = 47) then "Review"
else "Unknown"

Example:
Current Output:
Bernal, Maressa
90% Review 08/05/2008
0% Review 08/05/2008
90% Review 08/05/2008
80% Review 08/05/2008
0% Review 08/05/2008
90% Discharge 08/22/2008
0% Discharge 08/22/2008
90% Discharge 08/22/2008
80% Discharge 08/22/2008
50% Discharge 08/22/2008
...........................................
Desired Output:
Bernal, Maressa
90% Review 08/05/2008
0%
90%
80%
90% Discharge 08/22/2008
0%
90%
80%
50%
............................................
 
Group by Review or Discharge?

Have a running total that counts the number with 0% and suppresses when it is greater than one? (Assuming that is what you are after.)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Create a formula like this and place it in the group #4 section and suppress it:

whileprintingrecords;
stringvar curr;
stringvar prev := curr;
curr := {@status};

Add the following formula to the group #4 header:

whileprintingrecords;
stringvar curr;
stringvar prev;
if not inrepeatedgroupheader then (
curr := 0;
prev := 0
);

Then select both {@status} and the related date field->right click->format field->suppress->x+2 and enter:

whileprintingrecords;
stringvar curr;
stringvar prev;
curr = prev //note no colon

-LB
 
LB, that is _so_close_! But it's not quite what I need (probably a lack of specification on my part...). Here's the output I get now:

Baio, Ashley
80% Review 09/28/2008
50%
70%
70%
30%
0%
Bernal, Maressa
90%
0%
90%
80%
0%
90% Discharge 08/22/2008
0%
90%
80%
50%
Callahan, Alysha
100% Review 09/05/2008
60%
100%
60%
80%
100% Discharge 09/18/2008
60%
60%
80%
Cortez, Mia
100%
90%
90%
80%

which, I suppose, is what I asked for. 8<{{ However, I need to "reset" the variables whenever the client changes, so that I get the following:

Baio, Ashley
80% Review 09/28/2008
50%
70%
70%
30%
0%

Bernal, Maressa
90% Review 08/05/2008
0%
90%
80%
0%
90% Discharge 08/22/2008
0%
90%
80%
50%

Callahan, Alysha
100% Review 09/05/2008
60%
100%
60%
80%
100% Discharge 09/18/2008
60%
60%
80%

Cortez, Mia
100% Discharge 07/08/2008
90%
90%
80%

 
Looks like you didn't add the reset formula.

-LB
 
The "reset formula"? I added the formulas you gave me, exactly as shown. Which one was the reset formula?
The fact is, the stuff you gave me is pretty far bewond my capability/understanding: it's cool-looking, but I don't know what it's really doing... 8<{{ Therefore, I don't know which one is the "reset formula". I apologize for my lack of understanding. 8<}}
 
Sorry, usuallly I label it as {@Reset}. Add the following formula to the group #4 header:

whileprintingrecords;
stringvar curr;
stringvar prev;
if not inrepeatedgroupheader then (
curr := 0;
prev := 0
);

-LB
 
I _thought_ that I had followed all instructions, but when I got in today I saw that the Reset formula _wasn't_ in the G4 Header line (even though I had coded it). So, I inserted it in the G4 Header, and that reverts to the original display: all items duplicated. This occurs whether I apply any sort of "Suppress" option: none, either one, or both.
If I remove the Reset formula from the G4 Header, it returns to the 2nd problem.
I played around with this some, and when I moved the Reset formula to the G3 Header line, it works perfectly! I don't know why that "fixes" it (because I don't understand what's being done here), but the problem is solve, and I thank you. 8<}}
 
Sorry, I see now that I should have said Group Header #3.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top