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

Conditional formatting

Status
Not open for further replies.

neeko1226

MIS
Jul 24, 2003
82
US
I'm trying to change the font color of some fields on a report I built in CR XI. I'm using the format editor to the right of the font. Here's my formula:

IF
{qry_OandU_report.TotLoans} > {?TotalLoans}
and
{qry_OandU_report.TLOA} > {?PGTotalLoans}
and
tonumber
({@DM_AO}) > {?DiffOvgMean}
then
crRed


The data type of all parameter fields is number, as are the two fields being pulled from my query. The formula field {@DM_AO} is formatted as text, but as you can see, I'm converting it to a number in order to compare it to the parameter field. I even tried hard coding the parameter values (10, 4, and .05 respectively) and the font still will not change.

Any suggestions would be greatly appreciated.

 
If the conditions are met, it will change, so you need to delve into the data more.

A simple test is:

if 1=1 then
CRRED
else
CRBLACK

If that shows as red, then it works, it's your logic.

A quick way to test is to remark (use //) out part of the code until it works, then you can isolate the problem.

-k
 
You should be going to format field->font->color->x+2 and entering the formula there. Using the parameters should not be a problem. Are you getting any error message?

You might want to create a similar formula in the formula editor and then place it on the report to test whether the records are meeting the criteria:

IF
{qry_OandU_report.TotLoans} > {?TotalLoans}
and
{qry_OandU_report.TLOA} > {?PGTotalLoans}
and
tonumber({@DM_AO}) > {?DiffOvgMean}
then
true

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top