Sunteți pe pagina 1din 11

Presentation in PeopleSoft – An alternate perspective

Prepared By
Venkateshwara Rao M

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
Background:

The module offer letter belongs to the “Recruit RAW” product being currently
done by us for the automation of the Team Rainbow Recruitment at Wipro Technologies.

Problem Encountered:
I had to show the preview of the offer letter for the HR Person who is filling up
the Offer Letter Template. But to do that and show the output on a PeopleSoft page with
formatted text was tedious with normal pages and style sheet objects in PeopleSoft.

Text formatting includes – making part of the text bold, italics, different fonts, colouring
the text.

Note: Normal way of doing this is to create a Style Sheet object and apply the same to
the contents on the page.

Other problem was to include the unsaved (transient) data on the page to be shown on the
preview page dynamically.

Alternatives:
Normal PeopleSoft pages can show any static text which I include during design
time and is shown on the portal page without any formatting.
As mentioned above formatting can be done by creating Style Sheets and
attaching them to the required controls.

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
My Approach to the problem:

I used HTML Object in conjunction with HTML Area to achieve the desired
functionality.

The steps I followed to get the solution to the above problem is given below:

i. Create a HTML Object.

Pic 1: HTML Object

ii. Enter the HTML content in the HTML Object along with substitution
parameters (See picture1). In my case I got the content from the e-mail offer
letter which I got from Wipro University.

iii. Save the object.

iv. Create a Derived WorkRecord with a field of length greater than the HTML
content of the HTML Object. (See Picture 2) In the example the length is
27000.

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
Pic 2: Derived Work Record (Circled)

v. On the primary page I created a push button (Preview) and linked it to the
Derived WorkRecord and loaded the secondary page through PeopleCode.

Pic 3 : Push Button Properties

vi. In the Preview Button FieldChange event write the code to fetch the HTML
Object content, while passing the substitution parameter values

vii. On the Secondary Page, draw the HTML Area control.

viii. Set the HTML Area control properties to the Derived WorkRecord Name and
Record Field.

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
Pic 4: HTML Area Control Properties

ix. At runtime the HTML content is rendered on the secondary page, the way I
wanted it to be. (See picture 9)

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
x. To get the parameters dynamically, I used bind variables in the HTML content
of the HTML Object. (See pictures 5 ,6 and 7 below)

Pic 5: The HTML Object with BIND Variable

Pic 6: Passing value to the Bind Variable through code

Pic 7: The Output with the substituted value.

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
The Originating page:

Pic 8: The Offer Letter Template Page with Preview button (circled)

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
The Output page: The Offer Letter Preview

Pic 9: The Preview Page (Formatted Output)

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
Conclusion:

This way I achieved the desired functionality with minimal effort. This is because
I already had my Offer Letter given by WIPRO in the HTML Page. I reused the HTML
Tags used in that page in the HTML Object and replaced the references to my name and
other details with BIND Variables and substituted them with the actual data through
coding.

Advantages:

By this method of presenting the content, creation of Style Sheet objects and
attaching them to the object can be avoided.

Also the HTML page can be created using HTML Editors such as Macromedia
Dreamweaver in no time. The source (tags et of the page can be used in PeopleSoft
HTML Object instead of typing the HTML tags thereby saving time and creating good
presentable formatted output .

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
Appendix

HTML Object and HTML Area in PeopleSoft


PeopleBooks Technical Documentation Links

Using HTML Definitions and the GetHTMLText Function


If you're using the same HTML text in more than one place, or if it's a large, unwieldy string, you
can create an HTML definition in PeopleSoft Application Designer, then use the GetHTMLText
function to populate an HTML area control.
The following is the HTML string to create a simple table:
<P>
<TABLE>

<TR bgColor=#008000>
<TD>
<P><FONT color=#f5f5dc face="Arial, Helvetica, sans-serif"
size=2>message 1 </FONT></P></TD></TR>
<TR bgColor=#0000cd>
<TD>
<P><FONT color=#00ffff face="Arial, Helvetica, sans-serif"
size=2>message 2</FONT></P></TD></TR>
</TABLE></P>

This HTML is saved to an HTML definition called TABLE_HTML:


This code is in the RowInit event of the record field associated with the HTML area control:
Local Field &HTMLField;

&HTMLField = GetField();
&string = GetHTMLText(HTML.TABLE_HTML);
&HTMLField.Value = &string;

GetHTMLText
Syntax

GetHTMLText(HTML.textname [, paramlist]

Where paramlist is an arbitrary-length list of values of undetermined (Any) data type in the form:

inval1 [, inval2] ...

Description

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.
The GetHTMLText function retrieves a pre-defined HTML text from an HTML definition. If any
values are included in paramlist, they are substituted into the HTML text based on positional
reference (for example, %BIND(:1) is the first parameter, %BIND(:2) is the second, and so on.)

Note. Use the GetHTMLText function only to retrieve HTML, or HTML that contains a JavaScript
program, from an HTML definition. If you have an HTML definition that contains only JavaScript,
use the GetJavaScriptURL Response object method to access it.

See GetJavaScriptURL.

Restrictions on Use
Use this function with the PeopleSoft Internet Architecture. If run from a 2-tier environment, the
parameter substitution does not take place.

Parameters

HTML. textname Specify the name of an existing HTML text from an HTML definition.

Returns
The resulting HTML text is returned as a string.

Example
The following is the text in the HTML definition TEST_HTML:
This is a %BIND(:1) and %BIND(:2) test.

The following is the PeopleCode program:


Local Field &HTMLfield;

&string = GetHTMLText(HTML.TEST_HTML, "good", "simple");


&HTMLfield = GetRecord(Record.CHART_DATA).HTMLAREA;
&HTMLfield.Value = &string;

The output from &string (displayed in an HTML area control) is:


This is a good and simple test.

Wipro Technologies EAS-PeopleSoft


CDC2 Chennai.

S-ar putea să vă placă și