(RPG) Using a "P" field to control other fields' appearance

Please mark posts as being for RPG or RDMLX (LANSA) developers.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
Mark_Dale
Posts: 61
Joined: Thu Apr 19, 2012 11:06 am

(RPG) Using a "P" field to control other fields' appearance

Post by Mark_Dale »

If you want to change the appearance of a group of fields with a single instruction on the server you can use a program-to-system field:


You can define a ‘program-to-system field’ in IBM i display file DDS like this:

Code: Select all

     A* Define the form view record format
     A          R FORMVIEW
     A* Variable HTML content is a type “P” field in DDS 
     A            HTMLVARTAG    50A  P
 
Then repeatedly reference it in HTML tags like this ........

Code: Select all


     A                                 9  2'Dep Rate'
     A                                 9  2HTML(&HTMLVARTAG)
     A*  
     A                                 9 20'11.75'
     A                                 9 20HTML(&HTMLVARTAG)
     A* 
     A                                 10  2'Dep Cycle'
     A                                 10  2HTML(&HTMLVARTAG)
     A* 
     A                                10 20'QUARTERLY'
     A                                10 20HTML(&HTMLVARTAG)
 
Then in your RPG code you can do this .........

Code: Select all

      If (something);
         HtmlVartag = ‘Color:Red Font.Bold:True’    
      Else;
         HtmlVartag = ‘Color:Blue’    
      Endif;
Post Reply