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

Group section suppression problem

Status
Not open for further replies.

reidtw

MIS
Feb 10, 2004
74
GB
Hi,

How would the formula look if I wanted to suppress a section based on there being at least one distinct value in a set of values under each group?

e.g. For GroupName {Account.Name} I have three accounts; ABCD, BCDE and CDEF. Each has transactions where a particular field has either a value of 0 or 1.

Previous suppression of detail has resulted in me not being able to sum this field and suppress BCDE, which has no records showing due to this previous suppression.

What I want to do is say "If at least one value in this account field is "1" then suppress the GroupName {Account.Name} section.

T
 
I think that what you will need to do is right click in the grey area to the left of the group header you wish to suppress. When the context menu appears, select 'Format Section'. This will open the 'Section Expert' form and the section you selected will be highlighted in the list box. On the right of this screen are a set of tick boxes and next to most of them you will find a button marked 'X+2'. Click the button next to the 'Suppress (No Drill-Down' tick box. This will open the formula builder. Here you will set the conditions that will cause the section to suppress.

In your formula put something like this;

if {yourfield} > 0 then true else false

You are checking to see what the value of the transaction field is. If it is greater than zero then the condition is true, so suppress the section. If it is not greater than zero then the condition is not met, so don't suppress the section.

You will have to copy this code into each section you want to suppress.
 
Thanks for your reply, unfortunately the other conditional suppression negates the way you have suggested.

What I need to do is say if at least one of the values in the field, in the group, is greater than zero, then all the values are true and the group name can be suppressed.

The field cannot be summarised because it is sitting in a group section and this doe not allow the running total to be created.

T
 
not really a lot of info on what your report looks like but there are a couple of problems here.

1. Suppressing results does not suppress their formula operations...ie. sums will still be done. (more info required for solution)

2. if all results are displayed in the Group footer then there is little problem...suppress the header and details and then simply set a flag in the header for the group

//@SetFlag (suppressed)
WhilePrintingRecords;
booleanVar Flag := FALSE;

in the Detail section

//@Suppresstest (suppressed - could be used in manual sums)
WhilePrintingRecords;
booleanVar Flag ;

if {Table.particularField} = "1" then
Flag := TRUE;

Then we put the following in the group footer conditional suppress.

WhilePrintingRecords;
booleanVar Flag ;

Flag ;


that shud work





then in the group footer

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Alternatively, you could do a group selection. Go to report->edit selection formula->GROUP and enter:

sum({@0or1formula},{Account.Name}) = 0
//where {@0or1formula} is whatever field/formula that is returning a 0
//or a 1

This would return only those groups with no 1 values.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top