Home » Developer & Programmer » Forms » :blush: how to create display font color is red into the negative value
icon9.gif  :blush: how to create display font color is red into the negative value [message #120387] Thu, 19 May 2005 07:36 Go to next message
bupu
Messages: 5
Registered: May 2005
Location: thailand
Junior Member
please help me Embarassed
the problem is i want to display item that if it is negative
value then show font color are red for each item but i don't know about the process to do it. please tell me step by step
that would be nice ka. Laughing
Re: :blush: how to create display font color is red into the negative value [message #120500 is a reply to message #120387] Fri, 20 May 2005 04:27 Go to previous messageGo to next message
A Ikramur Rahman
Messages: 81
Registered: May 2004
Member
Use SET_ITEM_INSTANCE_PROPERTY on WNRI Trigger to change the background colur for negative values
Re: :blush: how to create display font color is red into the negative value [message #120629 is a reply to message #120500] Sat, 21 May 2005 02:04 Go to previous messageGo to next message
bupu
Messages: 5
Registered: May 2005
Location: thailand
Junior Member
THANK YOU, VERY MUCH FOR REPLY ME KA.Cool
BUT I STILL A LITTLE CONFUSE ABOUT THE PROCESS TO DO IT ,
THE PROCESS THAT I TRY TO DO IT THAT
1. CREATE VIRTUAL ATTRIBUTE NAME IS 'VA_RED' AND ASSIGN PROPERTY FOREGROUDCOLOR IS RED INTO IT
2. AM CREATED TRIGGER
2.1 WNRI AND WRITE THIS SYNTAX
IF :BONUS.COMM < 0 THEN
set_item_instance_property ('bonus.comm',FOREGROUND_COLOR,'va_red');
end if;

2.2 Post query WRITE THIS SYNTAX
cur_itm VARCHAR2(80);
cur_block VARCHAR2(80) := :System.Cursor_Block;
BEGIN
cur_itm := Get_block_Property( cur_block, FIRST_ITEM );
WHILE ( cur_itm IS NOT NULL ) LOOP
IF :bonus.comm < 0 AND :SYSTEM.LAST_RECORD<> 'TRUE' then
Display_Item( cur_itm, 'VA_RED');
END IF;
cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
END LOOP;
END;

Embarassed BUT IT STILL NOT WORK ka
WHAT CAN I DO

Re: :blush: how to create display font color is red into the negative value [message #120637 is a reply to message #120387] Sat, 21 May 2005 04:25 Go to previous messageGo to next message
hudo
Messages: 165
Registered: May 2004
Senior Member
1. Define Visual Attribute RED_BACKGROUND
===========================================

2. POST-QUERY Trigger
======================

DECLARE

BEGIN

IF ( :BONUS.COMM < 0 ) THEN
SET_ITEM_INSTANCE_PROPERTY('BONUS.COMM', CURRENT_RECORD, VISUAL_ATTRIBUTE,'RED_BACKGROUND');
END IF;


-- other example, every third row with different background color
IF ( MOD (TO_NUMBER(:SYSTEM.TRIGGER_RECORD), 3) = 0 ) THEN
SET_ITEM_INSTANCE_PROPERTY('BONUS.COMM', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'DIFF_BACKGROUND');
SET_ITEM_INSTANCE_PROPERTY('BONUS.OTHER_ITEM_OF_BLOCK', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'DIFF_BACKGROUND');
END IF;

END;
Re: :blush: how to create display font color is red into the negative value [message #120662 is a reply to message #120637] Sun, 22 May 2005 03:08 Go to previous message
bupu
Messages: 5
Registered: May 2005
Location: thailand
Junior Member
THANK KHUN HUDO VER MUCH KA Cool
Previous Topic: how to making log file in form????
Next Topic: How to find the network Printer name
Goto Forum:
  


Current Time: Thu Sep 19 16:05:40 CDT 2024