×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Conditional Styling

Conditional Styling

Conditional Styling

(OP)
Hello,

I'd like to color some fields in my report. The cells of one column (MYFIELD in the example below) should be green, yellow, red depening on the value they contain:

value <= 5 : green
value > 5.01 and < 7.5 : yellow
value >= 7.5 : red

I did the red and green like this:


DEFMACRO=COND0001, MACTYPE=RULE, WHEN=MYFIELD LE 5, $   
DEFMACRO=COND0003, MACTYPE=RULE, WHEN=MYFIELD GE 7.5, $

TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0001, COLUMN=MYFIELD, BACKCOLOR=GREEN, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0003, COLUMN=MYFIELD, BACKCOLOR=RED, $


This works fine. Yet I have a problem with the yellow condition. I want the value of MYFIELD to be between two numbers. I tried to simply add


DEFMACRO=COND0002, MACTYPE=RULE, WHEN=ARCKST GT 5.01, $

TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0002, COLUMN=MYFIELD, BACKCOLOR=YELLOW, $


or this:


DEFMACRO=COND0002, MACTYPE=RULE, WHEN=ARCKST GT 5.01 AND LT 7.5, $

TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0002, COLUMN=MYFIELD, BACKCOLOR=YELLOW, $



But neither worked. Can anybody tell me how to do it right?

Thanx a lot,
Eva

RE: Conditional Styling

Actually, a range can be done by specifying a conditional phrase for BOTH ends of the range separately. In the manual, there's an example:

CODE

TYPE=DATA, BACKCOLOR=AQUA, STYLE=BOLD+ITALIC,
WHEN=LINEPRICE GT 500000,$

TYPE=DATA, BACKCOLOR=YELLOW, STYLE=BOLD,
WHEN=LINEPRICE GT 400000,$

which says, in the note:

The first conditional declaration formats any rows whose order total is greater than 500,000.

The second conditional declaration formats any rows whose order toal is greater than 400,000 and less than or equal to 500,000.

This is on page 24-8 of the 7.1 WebFOCUS Creating Reports manual.

RE: Conditional Styling

(OP)
Thanx, works! I simply overlooked the order of the statements.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close