(RPG) Using a "P" field to control other fields' appearance
Posted: Fri Aug 24, 2012 4:02 pm
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:
Then repeatedly reference it in HTML tags like this ........
Then in your RPG code you can do this .........
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
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)
Code: Select all
If (something);
HtmlVartag = ‘Color:Red Font.Bold:True’
Else;
HtmlVartag = ‘Color:Blue’
Endif;