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!

conditional formatting with forms 1

Status
Not open for further replies.

hudo

Programmer
Dec 4, 2003
94
DE
Hello,

a forms mask displays in tabular style the contents of the table scott.dept
I'd like the values of the column deptno to be displayed red on white background if the value (deptno) >= 20 ; else it should be displayed black on white background.
Or a more common problem: all negativ numbers in a column should be displayed red while positiv numbers should have a black foreground_color.
How can I achieve this. I tried already with POST-SELECT and POST-TEXT-ITEM triggers and SET_ITEM_PROPERTY, SET_ITEM_INSTANCE_PROPERTY but I did succeed.

Thanks for advice...
 
@sem:

Thanks for your advice, I solved the problem already:

a Block Trigger "POST-QUERY" containing:

IF :DEPTNO BETWEEN 20 AND 30 THEN
SET_ITEM_INSTANCE_PROPERTY('DEPTNO',CURRENT_RECORD,VISUAL_ATTRIBUTE,'RED_DATA');

END IF;

for all deptno between 20 and 30 to be displayed red. The 'RED_DATA' must exist as VISUAL ATTRIBUTE ...

But I wonder, why you couldn't write the two lines code too, instead of refering to the online help (which I consulted before asking the question)
 
In fact I didn't know your details (block/item names, visual attribute names etc.), thus my own 3 lines of code has to be accompanied with 10 lines more of assumptions and explanations. Besides I prefer to provide an idea rather than a solution to protect this site (and myself!) from lazy people.

And after all if you've solved your problem that was enough :)


Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top