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

Conditionally suppress Group Headers

Status
Not open for further replies.

aelsn

Technical User
Dec 17, 2004
17
0
0
US
crystal 9

I have a report that is grouped by salesperson then by account number. GH1a displays the salesperson's name, the total value of all the accounts they cover, the total commission generated from those accounts and a calculation showing total commission as a percentage of total assets.

GH1b contains my column headings (text boxes).

GH2 is set up similar to GH1a but at the account level. It contains account number, total assets, total commission and a calculation for commissions charged as a percentage of account assets.

I am conditionally suppressing GH2 as follows: {@Comm Rate} < 5 or Sum ({table_comm}, {table_acct}) < 501. This displays only those accounts that were charged at a rate greater than 5% of assets where the commissions were at least $500.

Here is my issue. Several salespeople don't have any accounts that meet this criteria so there are no values shown in GH2. How do I suppress GH1a and GH1b when there are no values displayed in GH2? I'm only intersted in showing salespeople that have at least one account that meets this criteria.
 
Dear Aelsn,

could it be possible if you are using section expert and put formula in supress (no drill down)

isnull(GH2)
 
right click on the section and select suppress.
click on the formular button next to it and try:

if condition Then
True
else
False ;
 
I think you would have to save the report under another name and reinsert it as a subreport in a new GH1_a section (move other GH1 sections down one). Link the sub to the main report on the GH1 group field, but not on the other groups.

Then in the sub, create a formula like this and place it in the GH2 section:

whileprintingrecords;
shared numbervar x;
if {@Comm Rate} < 5 or
Sum ({table_comm}, {table_acct}) < 501 then
x := x else
x := x + 1;

In the main report in place a resetformula in the report header AND in GF1:

whileprintingrecords;
shared numbervar x := 0;

Then in the main report section expert, format GH1b and GH1c with the following formula in the suppress->x+2 area:

whileprintingrecords;
shared numbervar x;
x = 0; //note no colon

To make the subreport disappear, suppress all sections WITHIN the subreport, format the sub to "suppress if blank" (main report->format subreport->subreport tab), and also format GH1a in the section expert of the main report to "suppress blank section". Do not suppress or hide GH1a or suppress the subreport object itself.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top