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

Supress Header and Footer

Status
Not open for further replies.

Tenloe

Programmer
Oct 21, 2005
40
US
I have read throught the threads on how to do this and I almost have mine working but not quite. I have a detail section within GH/GF5 that will return a 1 if I wan't to get rid of the GF5. Works just fine. What I want to do is get rid of GH/GF1 if all of the GH/GF5's are all supressed. I added a global variable to supress this and it works fine for the first time but the second GH/GF1 that I want to keep it is only keeping the GF and not the GH, where is the best place to reset the global variable to accomplish this, this is where I think I am going wrong. Thanks for any help.
 
If you are not using subreports, and your posyt gives no indication of that, you shouldn't use global variables at all.

Keep in mind that GH1 has ALREADY displayed before any of the GH/GF5s are displayed, so in order to suppress them you'd need some aggregate function or to run some SQL or subreport first.

This is also true of the details section, unless you're using a whilereadingrecords formula.

Take the time to post what you're using in GH5 to suppress it PRIOR to the details being read.

-k
 
Thats what I was afraid of - I am doing a group by type of situation on my gh/gf5 - its a many to one relationship. I have tried to do an aggregate function but I simply can't get one to work. Basically a claim has a list of diaries and the claim record with the max diary date is what shows in GF5. If even one of them doesn't have a date, then this claim does not show, so I have this formula finding those records...

Shared NumberVar OffDiary;
If len(CStr({XXXNOTE.DONE_DT})) = 0 Then
OffDiary := 1;
OffDiary;

I tried to do a count off of this but can't get one to work correctly without needing a formula.

The supress of GF5 is if that formula is 1.
 
You still haven't said whether you are using subreports. If not, eliminate the variable, and change your formula, let's call it {@test}, to:

if len(CStr({XXXNOTE.DONE_DT})) = 0 then 0 else 1

Then use a suppression formula like:

sum({@test},{table.group2field}) = 0

...to suppress the inner group (in the section expert you would have to use for the GH, details, and GF sections), and a formula like the following for the outer group:

sum({@test},{table.group1field}) = 0

-LB
 
Again, a shared variable is for subreports, by default Crystal uses PUBLIC variables which are available throughout the report.

The 3 variables are:

SHARED (subreports)
PUBLIC (throughout the report, doesn't require explicitly stating it, it's assumed public unless otherwise indicated)
LOCAL (this being used only in the local formula)

-k
 
No, I am not using a subreport. We have gf1 thru gf4 reserved for what the clients want to group by, so I just created a group 5. I tried your suggestion lbass but if a group had 1 claim with 5 diaries and 4 of them met the criteria but the 5th one made it so it was suppressed, then I was still getting a count of 4 and the GH/GF5 was showing up, so it didn't quite do what I needed it to but it was very close.

I tried global, shared and just numbervar but none worked.
 
Please try again to explain what you are trying to do. I thought you wanted Group 1 suppressed ONLY if all Group 2's were suppressed,and that you wanted each Group 2 instance that has no {XXXNOTE.DONE_DT} to be suppressed. That is what my suggestion above does. Does the suppression work correctly?

I don't know what count you are referring to, but counts will include suppressed records, so you have to use the same criteria in a running total or conditional formula in order to exclude suppressed records.

-LB
 
I am sucessfully suppressing GH/GF5 based on if all of the diaries are closed. I am trying to suppress GH/GF 1 based on if any showed up in GF5. I can get several things to almost work but nothing is getting it exactly as I need it. Thanks for the help.
 
What do you mean by "if all the diaries are closed"--what is the criterion? What is a diary and how does it relate to your fields or groups? What does "if any showed up in GF5 mean"? Please show the suppression formulas that you are successfully using for Group 5 and then the ones you have tried for Group 1.

And please try again to be very clear and describe the conditions under which you want the group sections suppressed. Also please try to respond to each request made. For example, you did not respond to the question about the count.

-LB
 
Diaries are just electronic notes that have a closed date on them. So you can have five diaries attached to a claim. Three of them can be closed and the other two are open, therefore it would not show up in GF5. GH5 is grouped on the claim that contains the 5 diaries in this example. I say if the done_dt is empty then 1. I then suppress GF5 by saying @formula = 1 and that suppresses it. Now if I do GH/GF1 by Adjusters. Adjusters can have many claims, if they have 3 claims that each have diaries and all of the diaries are still open on all of these 3 claims then I need to suppress GH/GF1. Sorry about the count, I was just trying something there that didn't work.
 
So you are only trying to display those claims and adjusters where there are no open diaries?

Then {@test} should be:

if len(CStr({XXXNOTE.DONE_DT})) = 0 then 1

To suppress the claims group, I think the suppression formula should be:

sum({@test},{table.claims}) > 0

For the adjuster group, it should be:

sum({@test},{table.adjuster}) > 0

-LB
 
I see where you are going but if a claim has two diaries one is closed and the other is open then that claim should be suppressed, your suppression suggestion would keep it because it would have returned a 1 on the first diary.
 
Wrong. It would suppress the claim because at least one diary was open.

-LB
 
It worked at the GF5 level but it didn't work at the adjuster level - there were lets say 100 claims under this adjuster and 3 claims had all the diaries closed. It is showing the three claims but not the GH/GF1 adjuster.
 
Is the following what you mean?

1- If any diaries are open for a claim, suppress that claim.

2- If ALL claims for an adjuster are suppressed, suppress the adjuster.

Okay, I see the issue. What version of CR are you using?

-LB

 
Think I got it - I changed the suppression formula on the adjusters to say minimum(({@test},{table.claims}) > 0

and got it - thank you so much for getting me there - much thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top