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!

every second record with another background color 1

Status
Not open for further replies.

hudo

Programmer
Dec 4, 2003
94
0
0
DE
Hello,

to improve legibility, I would like to display always the second row with another (lets say green) background_color.
Therefore I created a BLOCK - Post-Query Trigger containing the following lines:

--IF :)EMP.COMM IS NULL) THEN
IF (MOD (TO_NUMBER:)SYSTEM.CURSOR_RECORD), 2) = 0 ) THEN
SET_ITEM_INSTANCE_PROPERTY('EMP.ENAME', CURRENT_RECORD, VISUAL_ATTRIBUTE ,'GREEN_BACKGROUND');
END IF;

NULL;

My first problem: I do not know how to the determine the whole record, therefore I just used EMP.ENAME
Second problem: The green background starts at record number 7 (if the first record is number 1, (is this so, or does it start with zero ??)), and then number 9, 11, 13 (from scott.emp) has a green background-color.

Please give me some advice
 
Change your code

IF (MOD (TO_NUMBER:)SYSTEM.CURSOR_RECORD), 2) = 0 ) THEN

to

Code:
IF (MOD (TO_NUMBER(:SYSTEM.TRIGGER_RECORD), 2) = 0 ) THEN
 
Thanks for your your hint. Now the other problem: how can I refer to the whole record ?? Or do I have to enumerate each displayed item :

SET_ITEM_INSTANCE_PROPERTY('EMP.Empno', CURRENT_RECORD, VISUAL_ATTRIBUTE ,'GREEN_BACKGROUND');
SET_ITEM_INSTANCE_PROPERTY('EMP.ENAME', CURRENT_RECORD, VISUAL_ATTRIBUTE ,'GREEN_BACKGROUND');
SET_ITEM_INSTANCE_PROPERTY('EMP.job', CURRENT_RECORD, VISUAL_ATTRIBUTE ,'GREEN_BACKGROUND');

.....

Thanks for your attention
 
Hudo,
The answer lies in the code written by you.
As you see that the built-in which you have used is
SET_ITEM_INSTANCE_PROPERTY, then how can you set a record Property using it.

So, you have to change the colour of Item & not the record.

HTH
Regards
Himanshu
 
So, there is no possibility to refer to the whole record ?

The SET_RECORD_PROPERTY has only STATUS as property, there is no "VISUAL_ATTRIBUTE". Hm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top