How to use Peoplesoft Gethtmltext in Peoplecode
You use GetHTMLText function about get html area and pass parameters to html dynamic html area by peoplecode
Requirement : Show the number of employees by age range
Step 1: Create HTML Template
Step 2 : Create HTML in Application Designer
Navigate : File > New > HTML
and copy & past code HTML and save name HTML = AGE_HTML
<table style=”width: 474px;” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tbody>
<tr>
<td style=”width: 159px;”>
<table style=”line-height: 20.8px; width: 190px;” border=”1″ cellspacing=”1″ cellpadding=”1″>
<tbody>
<tr>
<td><span style=”font-size: 12px;”><strong>%bind(:1)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #33ccff;”><span style=”font-size: 12px;”><strong>%bind(:2)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #33ccff;”><span style=”font-size: 12px;”><strong>%bind(:3)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #ff99cc;”><span style=”font-size: 12px;”><strong>%bind(:4)</strong></span></td>
</tr>
</tbody>
</table>
</td>
<td style=”width: 74px;”>
<table style=”line-height: 20.8px; width: 280px;” border=”1″ cellspacing=”1″ cellpadding=”1″>
<tbody>
<tr>
<td style=”background-color: #33ccff; width: 20px; text-align: left;” colspan=”2″><span style=”font-size: 12px;”><strong>%bind(:5)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #33ccff; width: 20px; text-align: left;” colspan=”2″><span style=”font-size: 12px;”><strong>%bind(:6)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #33ccff; width: 20px; text-align: left;” colspan=”2″><span style=”font-size: 12px;”><strong>%bind(:7)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #ff99cc; width: 20px; text-align: left;” colspan=”2″><span style=”font-size: 12px;”><strong>%bind(:8)</strong></span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Step 3 : Call HTML by use GetHTMLText for call AGE_HTML by Peoplecode
Define Parameters for pass value to html code
¶1 = “Age Range”;
¶2 = “< 35”;
¶3 = “35-45”;
¶4 = “> 45”;
¶5 = “Number of Employee”;
¶6 = “25”;
¶7 = “36”;
¶8 = “8”;TEST1_TBL.HTMLAREA = GetHTMLText(HTML.AGE_HTML, ¶1, ¶2, ¶3, ¶4, ¶5, ¶6, ¶7, ¶8);
You can past this code in anywhere by your requirement such as page activate or component peoplecode
Show result HTML after pass parameter