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

group number skipping suppressed groups 2

Status
Not open for further replies.

highsmith

MIS
Jan 30, 2008
18
US
Hi Gents, what's the easiest way to run a count of groups printed?

I need the following numbering scheme to make my alternating colors work properly.


GH1 1
GH2 - (suppressed)
GH2 2
GH1 3
GH2 4
GH1 5
GH2 6
GH1 7

using groupnumber, my results would be

GH1 1
GH2 2 (suppressed group)
GH2 3
GH1 4
GH2 5
GH1 6
GH2 7
GH1 8

which screws up my alternating colors...

thanks for the help


cheers
--
See and search my pics at willhighsmith.com
 
Create a formula instead:

whileprintingrecords;
numbervar cnt;
if {table.field} <> "X" then //add the opposite of your suppression criteria here
cnt := cnt + 1;

Place this in each section (GH1 and GH2) you want counted. Then add a color formula like this in the background formula area for the GH1 and GH2:

whileprintingrecords;
numbervar cnt;
if remainder(cnt,2) = 0 then
cryellow else
crnocolor

-LB
 
Ok you are thinking along the same lines I did originally.

But my suppression formula is specific to group 2. No groups from group 1 are suppressed so it's not going to work.

My suppression formula = {@sup_cust}.
The suppress properties of GH2 is set to: {@test suppress cust}=true

{@sup_cust} =
Code:
Sum ({@Sales - Today}, {Command.Customer No_})
<10000

and

(
isnull(Sum ({@Invoices - Today}, {Command.Customer No_}))
or
Sum ({@Invoices - Today}, {Command.Customer No_})
<10000
)

So if I set that as a condition to increment numbervar cnt, it won't work for GH1.

cheers
--
See and search my pics at willhighsmith.com
 
Create these two formulas:

//{@cntx} to be placed in the GH1:
whileprintingrecords;
numbervar cnt;
numbervar cntx := cntx + 1;
cnt + cntx

//{@cnt} to be placed in the GH2:
whileprintingrecords;
numbervar cnt;
numbervar cntx;

if Sum ({@Sales - Today}, {Command.Customer No_})
>= 10000 or
Sum ({@Invoices - Today}, {Command.Customer No_})
>=10000 then
cnt := cnt + 1;
cnt + cntx;

Then color GH1 using:

if remainder({@cntx},2) = 0 then
cryellow else
crnocolor

...and GH2 using:

if remainder({@cnt},2) = 0 then
cryellow else
crnocolor


-LB
 
With a little tweaking I got it working!
thanks LB

I should have known this, I just wanted to avoid referencing the suppress formula if possible because it's more complicated than I have explained here. I was hoping there was some magic trick I didn't know about to the effect of 'if printed crX...'

Oh well, this works though.

Thanks again.

cheers
--
See and search my pics at willhighsmith.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top