Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Counting" the group breaks in a datawindow

626 views
Skip to first unread message

Harrison Rigby

unread,
Mar 11, 1999, 3:00:00 AM3/11/99
to
I need a way of "counting" the group breaks in a datawindow. What I want is
to increment a variable, or a computed field value, each time a group break
occurs. In this particular case there would be only 1 group defined in the
datawindow.

The goal here is to provide grey-bar type shading on alternate groups. The
variable, or computed field, will be referenced in the detail band
expression for the color property using the Mod function to look for the
even/odd transistions of the count.

If anyone can point me in a good direction on this, I would appreciate it.

Thanks

Harrison Rigby

DawnBrownEyes[TeamPS]

unread,
Mar 11, 1999, 3:00:00 AM3/11/99
to

This is what I do:

1. Create a computed field in the dw detail row & call it tone: code:
if(getrow() = first( getrow() for group 1), 1, 0)

2. Create a computed field in the trailer call it ttot. Code
cumulativeSum( tone for all )

3. in the detail row property code:
if(mod(ttot,2) = 0, 255, 0) //use your own colors

HTH

--
Dawn T Brown Eyes (TeamPS)

Harrison Rigby <Discov...@Mindspring.com> wrote in article
<JY6AfBAb#GA....@forums.powersoft.com>...

Harrison Rigby

unread,
Mar 12, 1999, 3:00:00 AM3/12/99
to
Dear Dawn:

I like your method of counting groups; it is very sharp. It seems, however,
that the color expression for the detail row is executed before the
CumulativeSum computed field in the group trailer, so there is no change in
the detail row color. I am continuing to work on this, but wondered if you
have any thoughts on the sequencing of the expressions.

Thanks again,

Harrison Rigby


Paul A. Horan

unread,
Mar 13, 1999, 3:00:00 AM3/13/99
to
Try throwing a GroupCalc() after the Retrieve(). Sometimes the order of
calculation is out of sync, and GroupCalc causes all expressions to get
recalculated.
Might work...

Paul Horan
VCI
Springfield, MA

Harrison Rigby wrote in message ...

Paul A. Horan

unread,
Mar 13, 1999, 3:00:00 AM3/13/99
to
Harrison,
I played around with the color expression of the detail band, and I got
this:
If( Mod( CumulativeSum( If( col1 = col1[-1], 0, 1) ), 2) = 0,
RGB(192,192,192), RGB(255,255,255))

This sets alternating grey/white backgrounds when a change in a specific
column (col1) is detected. With this, you don't even need groups defined.

Paul

0 new messages