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 strongm 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.

Rena

Programmer
May 24, 2000
69
US
I have a report that contains two subreports. The subreports retrieve dollar amounts that are stored in shared variables. One is a received dollar amount and the other is an invoiced dollar amount. I take the shared variables and in the main report, subtract one from the other to determine the difference. If the difference is zero then I don't want to print the information. I have two groups: job number and po number. I call the subreports in the group header for po number. Nothing is in the detail and it is suppressed. The calculated difference is displayed in the group footer for po number. How can I suppress the group headers when the difference is zero?

As always TIA!
Rena
 
right click on the group header and select format section. To the right of the Suppress checkbox is a button labeled X-1. This is for conditional formatting. Click on this button and enter a valid formula and it the section will be supressed if when the group meets the condition. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
I have tried that. If I put in the Suppress format section for the group header 2 (po number) the following: {@Difference} = 0.00 then it suppresses everything! I figured it has to do with when the @Difference formula is calculated so I tried WhilePrintingRecords which didn't work and the EvaluateAfter(@Difference) which didn't work either. And I tried putting the @Difference in the group header 2 but that didn't help either.
 
Just a thought.
I think the problem might be with the formula @difference. Since u r referring the variables from the subreport did u qualify it properly?
 
the problem is not the formula .....the problem is that you are deciding this after the main report data is collected and grouped

My suggestion is rather than suppress the group section, suppress the fields themselves, "whilePrintingRecords" in the conditional field suppress....then have the section "suppress blank section"...this might work for you
 
I tried this and it worked for me:

ct subreport 1 shared variable
gt subreport 2 shared variable

I used this formula to condtionally suppress the group header section:

shared numbervar ct - shared numbervar gt = 0
 
In the Received subreport I have a formula called TotalRcvdAmt which is:

WhilePrintingRecords;
Shared numberVar TotRcvdAmt := Sum ({bbinvsus.value}, {@POLine})

In the Invoiced subreport I have a formula called TotalInvAmt which is:

WhilePrintingRecords;
Shared numberVar TotInvAmt := Sum ({apinvhst.price}, {@POLine})

In the main report I have a formula called TotalRcvdAmt which is:

WhilePrintingRecords;
Shared numberVar TotRcvdAmt

and a formula called TotalInvAmt which is:

WhilePrintingRecords;
Shared numberVar TotInvAmt

Then the formula difference is:

numberVar diff ;
diff := {@TotalRcvdAmt} - {@TotalInvAmt} ;

It appears the difference is calculating correctly.
 
Thanks for all your input but I still don't have the answer.

Ngolem - when I put a conditional suppress on the fields. It suppressed based on the value of difference one group back. IE.
line a difference = 0.00 - it suppressed it
line b difference = 25.88 - it suppressed it
line c difference = 0.00 - it didn't suppress it.

alley211 - this gave the same results as when I suppressed on difference = 0.00. It suppressed everything!

I am convinced it has to do with when values are calculated but I can't figure out how to force it to check at the right time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top