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

Alternating Detail Background with a twist 1

Status
Not open for further replies.

TxForHelping

Programmer
Feb 18, 2009
1
US
As a CR XI newbie, one self-imposed challenge is to learn how to alternate the background color on simple detail lines. Here's the twist: I want to see crWhite for the first detail that appears at the top of each page and/or begins each group, not just the apparently standard modulo-2 (remainder) flip-flop based solely on RecordNumber.

In ol' MS Access (sorry, all I know), I simply had to reset my global logical toggle variable to false when my PageHeader_Format and GroupHeader_Format events fired; calling my flip-flop function in my Detail_Format event took care of the rest. I haven't quite figured out the equivalent technique in this new adventure (despite a few hours reading, testing, and searching this forum).

Many thanks in advance! (This forum is great!)
Steve
 
simply add a check for the first record:

if onfirstrecord then crwhite else

Followedby your preferred implementation of the remainder logic.

'J

CR8.5 / CRXI - Discovering the impossible
 
Create two formulas:

//{@Reset} to be placed in the page header and in the group header:

whileprintingrecords;
numbervar cnt := 0;

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

Then go into the section expert->details->color tab->background->x+2 and enter:

if remainder({@cnt},2) = 0 then
crYellow else
crWhite //or you might want to use crNoColor

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top