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

Colouring variables

Status
Not open for further replies.

redeemasp

Programmer
Jun 1, 2004
63
0
0
GB
I've a straightforward if

if isnull({ORC_get_O07MarketingLead.Description}) then
(
strMarketingindicator := "No"
)
Else
strMarketingindicator := "Yes";

Wanting to colour in Crystal according to yes or no.

I tried color (R/g/b) no luck. Is there another way?

Redeem.
 
Code:
if isnull({ORC_get_O07MarketingLead.Description}) then
(
strMarketingindicator := "No"
)
Else
strMarketingindicator := "Yes";

add this ...
Code:
if strMarketingindicator = "No" then
    Red
else
    Black;

Hope this helps,

Patrick
 

How would that work if you have a shared variable that you could not distinguish.

e.g. if you had a number that was only distinguish when you see if its a null e.g.

If isnull({ORC_get_O31NetSales.NetSales}) then
(
numRevenue := "£" & totext({AMGR_Opportunity.Forecast_Revenue});
// Black;
)
Else
(
numRevenue := {ORC_get_O31NetSales.NetSales};
// Blue;
);

?
 
You don't need to use variables here. First, you should handle nulls before applying color, since null fields cannot be formatted with color. So for example, create a formula {@netsales}:

if isnull({ORC_get_O31NetSales.NetSales}) then
{AMGR_Opportunity.Forecast_Revenue} else
{ORC_get_O31NetSales.NetSales} //assuming they are both numbers

Then right click on {@netsales}->format field->font->x+2 and enter:

if {@netsales} = {AMGR_Opportunity.Forecast_Revenue} then crBlack else crBlue

-LB



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top