Translate

Thursday, 7 February 2013

How to display colour and image using HTML area




following approach i made using my colleges  ramana and santosh , i am very thankful to them by sharing this.
step 1 : define field as char 1 veg_name it as vegetables use translate value ex: carrot , ladyfinger ,orange second as descr  field and third as image field datatype as imagereference.
 step 2: insert html area into page set field as descr 




write code in fieldchage event of veg_name field. using html code we can display text color.

Evaluate SP_VEG_REC.SP_VEG.Value
When = "C"
   REM SP_VEG_REC.DESCR = "Red";
   SP_VEG_REC.DESCR = "<font = 4 color=red>" | "CARROT" | "</font>";
   rem SP_VEG_REC.DESCR = "<body bgcolor='red'>" | "</body>";
   SP_VEG_REC.SP_VEG_IMG.Value = Image.CARROT;
   rem this is html text;
   Break;
When = "L"
   REM SP_VEG_REC.DESCR = "GREEN";
   SP_VEG_REC.DESCR = "<font = 4 color=GREEN>" | "LADYSFINGER" | "</font>";
   SP_VEG_REC.SP_VEG_IMG.Value = Image.LADIESFINGER;
   Break;
When = "D"
   REM SP_VEG_REC.DESCR = "BLUE";
   SP_VEG_REC.DESCR = "<font = 4 color=BLUE>" | "DRUMSTICK" | "</font>";
   SP_VEG_REC.SP_VEG_IMG.Value = Image.DRUMSTICKS;
   Break;
When-Other
   SP_VEG_REC.DESCR = "Unknown";
End-Evaluate



step 3: insert images by clicking new image .insert image into same page using this we can display image.
out put as follows :







No comments:

Post a Comment