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!

Detail line formating

Status
Not open for further replies.

keo216

Technical User
Nov 26, 2002
102
US
I have set my report up so that every other line has a light grey background for easier reading. I used the formula:

if remainder (RecordNumber,2)= 0
then
Color (229,229,229)
else crNoColor

This works find until I suppress a field if it's duplicated. Then the shaded lines started getting bunched up because it is still counting the suppressed lines and including them in the formula. How can I get it to only count the displayed lines or maybe a more simple way yet?
kowen@rrwa.net
 
I think that you'll have to set up some variables and pass a variable to keep track of the lines.

In the report header:
@Init line number formula
whileprintingrecords;
global numbervar LineCnt:=1

In the Details section
@Add the line number formula
whileprintingrecords;
global numbervar LineCnt:=LineCnt+1

In your suppression formula add in the following logic:
@Add the line number formula
whileprintingrecords;
global numbervar LineCnt;
if <suppression condition> then
global numbervar LineCnt:=LineCnt-1

Use something like the following for the shading:
@Add the line number formula
whileprintingrecords;
global numbervar LineCnt;
if remainder (LineCnt,2)= 0
then
Color (229,229,229)
else crNoColor

-k
 
Ooops, this:

In your suppression formula add in the following logic:
@Add the line number formula
whileprintingrecords;
global numbervar LineCnt;
if <suppression condition> then
global numbervar LineCnt:=LineCnt-1


Should be:

In your suppression formula add in the following logic:
@Add the line number formula
whileprintingrecords;
global numbervar LineCnt;
if <suppression condition> then
LineCnt:=LineCnt-1

And the above logic is added to your existing suppression logic.

-k
 
Hi,

Or other option may be to create a running total, with count option, make sure running total displays 1,2,3 ------ sequence. Then have you formula created like this:

if remainder (RTotal0,2)= 0
then
Color (229,229,229)
else crNoColor

Thanks,

Vishal
 
Here is a typical set up I use for banded printout.. esp when wanting to band across supressions/groups etc.

In the report header color x->2 (with no color for the header.. you can use anything you want):

shared numbervar counter :=0;
nocolor

In each groupheader/detail I am showing:

shared numbervar counter;

counter := counter + 1;
if remainder(counter, 2) = 0 then color(255,254,211) else color(230,253,181)

If you have a supression formula... move all the incrementation of counter into that formula:

ie:

groupheaderone suppression x->2 (never suppressed):
shared numbervar counter;

counter := counter + 1;
false

detail suppression x->2:

shared numbervar counter;

if field = 0 then
(counter := counter + 1;
false)
else true

in color x->2 for both is:

shared numbervar counter;

if remainder(counter, 2) = 0 then color(255,254,211) else color(230,253,181)

I think you get the idea..

Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top