JointLantic

How to use Peoplesoft Gethtmltext in Peoplecode

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

&para1 = “Age Range”;
&para2 = “< 35”;
&para3 = “35-45”;
&para4 = “> 45”;
&para5 = “Number of Employee”;
&para6 = “25”;
&para7 = “36”;
&para8 = “8”;

TEST1_TBL.HTMLAREA = GetHTMLText(HTML.AGE_HTML, &para1, &para2, &para3, &para4, &para5, &para6, &para7, &para8);

You can past this code in anywhere by your requirement such as page activate  or component peoplecode

Show result HTML after pass parameter

 

 

Exit mobile version