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

Needing hlep with a loop 1

Status
Not open for further replies.

skaestner

Technical User
Apr 21, 2009
35
US
Ok so here is the situation i am trying to have the font turn a color when it meets a condition. However the problem i am running into is that it only looks at the first group instead of all groups and only returns red if the first group meets the condition.

if {@Before % Glide} <= 33.00 then crRed

So what loop should i use to make it go through all the groups to turn the desired color instead of only looking at the first group?

 
you need to show contents of {@before%glide}

Also where is this evaluating, in details or group level

Ian
 
This is evaluating at a group level, but not at the group level that {@before%glide} is located.

here is the code for {@before%glide}

WhilePrintingRecords;
if {@ms to date} = 0.0 then 100.00
else if
{@ms to date} > 0.0
then
{@MS Completed}/{@ms to date} * 100
 
YOU must show all nested formula too. Please also show group order and where each formula is evaluated.

Ideally show sample data as it currently is and again how you want it to look.

Ian
 
this is the sample data


2/25/09
020752 Jerry Quarles
021210 Joshua Cooper
052417 Brian Mitchell
072228 Michael Acord
074345 Christopher Logsdon

those names are what need to turn colors dependent on the formula based on the glide percentage

020752 Jerry Quarles
CJ101 %Glide 100.00%
EN102 %Glide 11.11%

in this case with the current formula Jerry would never turn Red as the formula only looks at the first line CJ101... it never evaluates line 2 EN101 where the formula should also be looking to turn Red


Where Michael turned Red for this reason

072228 Michael Accord
EN102 %Glide 13.11%
CJ102 %Glide 89.99%
 
I take it you do not need to see details.

Move this data into group footer rather than header.

020752 Jerry Quarles
021210 Joshua Cooper
052417 Brian Mitchell
072228 Michael Acord
074345 Christopher Logsdon

In details place this formula

@FontEval
whileprintingrecords;

global booleanvar glide;

if {@Before % Glide} <= 33.00 then glide:=true

Place this in group header

@FontReset
whileprintingrecords;

global booleanvar glide:=false;

Replace your conditional font colour formula with


whileprintingrecords;

global booleanvar glide;

If Glide = true then crred else crblack

Ian







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top