Creating XML Publisher Documents With PeopleCode WP
Creating XML Publisher Documents With PeopleCode WP
Randall Groncki
Northrop Grumman Corporation
Introduction
XML Publisher is a powerful reporting tool available with PeopleTools versions 8.48 and higher. Though
most demonstrations and training focus on Query based XML Publisher reports, the tool’s real power is
when it is embedded into the application pages where users would naturally expect the reports.
Query based XML Publisher reports are ad-hoc with better formatting than Excel spreadsheets. Multi-
user use of a report requires public queries which are open to modification by any user with PSQuery
access. Reports based upon private, protected queries can only be viewed by the query owners.
The delivered PeopleCode XML Publisher Application packages allow full control of the reports with more
options to the designer. The data source structures are protected from end users while the developer has
multiple options to invoke and deliver the reports.
This paper discusses using PeopleCode and other tools within the Application Designer to create and
deliver XML Publisher reports within the PeopleSoft application. It assumes that the user is familiar with
the fundamentals of creating and XML Publisher Report Definition:
1. Define the data source and provide sample XML data file
2. Create the XML Publisher Report template using the sample XML data file
3. Tie all parts together with security in a XML Publisher Report Definition
• XML File Creation discuses using four different tools to generate the source data file for the report
• Report Evocation and Creation shows how to use the delivered XML Publisher Application
Packages to generate the report and combine multiple reports into a single result file if needed.
• The Output section demonstrates a few ways to present the report to the user including the
Report Repository, popup window and emailing the report.
Since all versions use XML Files as a data source, this section will focus on generating XML Files using
four different methods:
1
Collaborate 10 Copyright ©2010 Northrop Grumman
Premise for all XML File Creation Examples.
In order to demonstrate the differences of the four XML File creation techniques, all demonstrations will
use the same report premise: A letter to all employees summarizing their current job and showing all
training taken through the company. This is a complex data set with a parent/child relationship. Each
employee will get a separate page in the report. For each employee, there will be zero or more training
entries. See Appendix A for the function populating this data structure. The function returns this Rowset
object:
Root
• EMPLID
• NAME
• DEPTID
• LOCATION
• JOBCODE
• COMPRATE
• CHANGE_PCT
• LOCATION_DESCR
• JOB_DESCR
• COMPANY_DESCR
• EMPLID
• COURSE_START_DT
• COURSE
• SESSION_NBR
• COURSE_TITLE
• COURSE_END_DT
• ATTENDANCE
• TRAINING_REASON
• COURSE_GRADE
• PREREQ_MET
• DEPTID
• BUSINESS_UNIT
Manually creating an XML file by concatenating strings and tags may be the most expedient method for
small data files, but also the most error prone and the most work to build and maintain. The programmer
must create and track all opening and closing tags replicating an exact structure. Any errors will most
likely cause an error in the XML parser at read time.
In the example below, the field names from each of the records are used as field tags. Notice how the
root and each record tag is closed out.
2
Collaborate 10 Copyright ©2010 Northrop Grumman
See Appendix B for the XML File created by this code.
&RS_Employee = LoadTestDataSet();
&X_TRAINING_VW_Rec = &RS_Training(&j).GetRecord(Record.X_TRAINING_VW);
&XML_String = &XML_String | "<TRAINING_DATA>";
For &f = 1 To &X_TRAINING_VW_Rec.FieldCount
&XML_String = &XML_String | "<" |
&X_TRAINING_VW_Rec.GetField(&f).Name | ">";
&XML_String = &XML_String |
String(&X_TRAINING_VW_Rec.GetField(&f).Value);
&XML_String = &XML_String | "</" |
&X_TRAINING_VW_Rec.GetField(&f).Name | ">";
End-For; /* child fields */
/* close the child rowset tags */
&XML_String = &XML_String | "</TRAINING_DATA>";
PeopleSoft’s File Layout Object allows us to quickly create XML files. Given the right conditions, this is
the fastest method to create an XML File.
4
Collaborate 10 Copyright ©2010 Northrop Grumman
The File Layout object is assigned to the file during after the GetFile statement. Then, the file object
inherits an internal Rowset Object reachable through PeopleCode.
In the example below, the data Rowset Object is copied directly into the File Layout Rowset Object since
they are intentionally identical. Then, the Rowset can be dumped to file with the “WriteRowset” method
of the File Object. Since the File Layout Type is defined as XML, PeopleSoft creates a properly formatted
XML File.
/* output files */
&RS_Employee = LoadTestDataSet();
&FILEROWSET = &XML_File.CreateRowset();
&RS_Employee.CopyTo(&FILEROWSET);
&XML_File.WriteRowset(&FILEROWSET, True);
&XML_Filename_path = &XML_File.Name;
&XML_File.Close();
5
Collaborate 10 Copyright ©2010 Northrop Grumman
Rowset method of creating an XML File
The Rowset Method uses delivered PeopleCode Application Package “PSXP_XMLGEN” to generate both
the XML File and XML Schema file (XSD). In the example below, the data Rowset is passed to the class
method “getXSDSchema” and “getXMLData”. The method result is a string containing a XML or
XSD file. Write this string to the file object with one write statement.
Important to know about the XML File generated with this method is that field tags have “fld_” appended
to the front of the field names. Example: EMPLID becomes tag “fld_EMPLID” in the XML File. This has to
be accounted for in your template mapping.
D
import PSXP_XMLGEN:*;
/* output files */
/* create xsd */
&oXML_GENERATOR = create psxp_xmlgen:RowSetDS();
&my_schema = &oXML_GENERATOR.getXSDSchema(&RS_Employee);
&XSD_File = GetFile("Rowset.xsd", "W");
&XSD_File.WriteLine(&my_schema);
6
Collaborate 10 Copyright ©2010 Northrop Grumman
XMLDoc method of creating an XML File
The XMLDoc object is PeopleTools utility to manipulate XML Files in their native format. One of these
objects methods is to generate a formatted XML string from the current XMLDoc structure. The
developer creates an XMLDoc structure and adds “Nodes” to the document to create tags and structure.
The level the node is attached to determines the structure of the XML document.
Though this code may look similar to the freehand method, realize that the object is maintaining the
structure. The developer is not concerned with end tags and completing parent child structures for the
document. As each node is added, the value of that node is set.
When all the data has been moved to the XMLDoc object, use the “GenFormattedXmlString”
method of the object to create the entire XML file in one string. Then write that string to file.
&RS_Employee = LoadTestDataSet();
&RS_Training = &RS_Employee(&i).GetRowset(Scroll.X_TRAINING_VW);
For &j = 1 To &RS_Training.ActiveRowCount
&X_TRAINING_VW_REC = &RS_Training(&j).GetRecord(Record.X_TRAINING_VW);
&midNode = &rowNode.AddElement("TRAINING_DATA");
PeopleSoft by its very nature may have multiple, different users attempting to create the same
report at the same time. Ensure that your code accounts for this probability by making the file
names unique per each instance of the report. One Idea to accomplish this is to append the User
or Employee ID to the file creating a unique file name. Another method is to append the current
date/time stamp to the filename to force uniqueness.
If your report is popular, you could be littering the file server with thousands of no longer needed
XML files which will not endear yourself to the administrators. After your XML Publisher report
has been created, delete your source data file using the “delete” method of the file object.
Schema Files
For PeopleTools version 8.48 & 8.49, XML Publisher requires XML Schema files for the correct
mapping of tags to a PDF Template. You could include these for RTF (MSWord) templates, but
they were not necessary.
The easiest way to generate correct schemas for the generated XML Files is to use an XML File
editing utility such as XML Spy or XML Fox. XML Fox is a freeware utility that works very nicely.
These utilities can generate schemas from your final XML Files.
As demonstrated earlier, the Rowset method has a utility to generate the schema file at the time
the XML File is created.
Starting with PeopleTools 8.50, XML Publisher does not require a schema file for PDF Template
mapping. Only a sample data file is required.
You must provide a Sample XML Data file when creating a new XML Publisher report. A good
idea is to execute a version of the XML File generation code using a sample or representative
employee. Another good idea is to, for the sample run, modify your code to put the XML Tag
names as values in the XML File. This will aid in mapping and formatting: do you have the right
field in the right place on your report.
House Keeping
Depending on data policies of the implementations site, it may be a good idea to delete the XML
Publisher Source files from the files directory after the report documents have been created. The
easiest way to delete the file is to re-open the file after the XML Publisher code is complete, then
use the “delete()” method instead of the “close()” method. This will remove the file from
the servers.
8
Collaborate 10 Copyright ©2010 Northrop Grumman
Report Evocation and Creation
Generating the Report
Once the XML File is generated, it’s very simple to create the report and give it to the user. The delivered
PeopleCode Application Package handles all the XML Publisher Report functions.
This example displays the report to the user in a new popup window on their display. Given the report
window, the user can print, save or do whatever they like with the result.
/* Process Report */
&oXML_PUB.ProcessReport("", "", %Date, "");
XML Publisher creates directories and files under the Application Server temp file space during operation.
The fully qualified file name can be derived using a quick PeopleCode routine and properties of the
XML_Publisher object.
In the example below, the resulting report’s fully qualified file name is placed in the
“&ReportFilePath” string variable.
[...code creating report…]
&oXML_PUB.ProcessReport("", "", %Date, "");
DoSaveNow();
In some cases, it may be best to combine two existing PDF reports or split an existing PDF report into two
separate documents for population, then recombine them before delivery. Good examples are
government forms with dependent information. Where the number of dependents exceeds the available
positions on the form, the person would just attach an additional copy of that form page to the completed
document to report all dependents. Separating the report into person information and dependent
information, creating as many dependent pages as required and then recombining the two reports into
one for delivery is a method to accomplish the task.
XML Publisher delivers a PDF Join utility to PeopleCode through an internal Java class. The code
example below combines two PDF reports into one report.
import PSXP_ENGINE:*;
&oMerger = create PSXP_ENGINE:PDFMerger();
&PDF_Merge_Error = "";
&PDF_Merge_Array = CreateArray(&FirstReportFilePath);
&PDF_Merge_Array.Push(&SecondReportFilePath);
&PDF_Merge_Result = &oMerger.mergePDFs(&PDF_Merge_Array,
&PDF_Merge_File_name, &PDF_Merge_Error);
10
Collaborate 10 Copyright ©2010 Northrop Grumman
Output
The delivered application package contains several options for presenting the report:
&MAIL_FLAGS = 0;
&MAIL_CC = "";
&MAIL_BCC = "";
&MAIL_SUBJECT = &Email_Subject;
&MAIL_FILES = &ReportFilePath;
&MAIL_TITLES = "xml_pub.PDF";
&ret = SendMail(&MAIL_FLAGS, &MAIL_TO, &MAIL_CC, &MAIL_BCC,
&MAIL_SUBJECT, &MAIL_TEXT, &MAIL_FILES, &MAIL_TITLES, &MAIL_SENDER);
11
Collaborate 10 Copyright ©2010 Northrop Grumman
Appendix A
Data set function for data source creation. This function populates and returns a complex RowSet object.
/*********************************************************/
/** Northrop Grumman **/
/** Information Technology **/
/** XML Publisher **/
/** XML File Generation Examples **/
/** Contact: [email protected] **/
/*********************************************************/
import PSXP_XMLGEN:*;
/* create records */
&JOB_REC = CreateRecord(Record.JOB);
&LOCATION_TBL_REC = CreateRecord(Record.LOCATION_TBL);
&COMPANY_TBL_REC = CreateRecord(Record.COMPANY_TBL);
&JOBCODE_TBL_REC = CreateRecord(Record.JOBCODE_TBL);
/* create rowsets */
&RS_Training = CreateRowset(Record.X_TRAINING_VW); /* child rowset */
&RS_Employee = CreateRowset(Record.X_EE_RPT_LTR_VW, &RS_Training); /*
parent rowset */
/* Fill Parent */
&RS_Employee.Fill("where emplid like 'KU000%' and exists (select 'x'
from ps_training t where t.emplid = fill.emplid)");
End-For;
Return &RS_Employee;
End-Function;
13
Collaborate 10 Copyright ©2010 Northrop Grumman
Appendix B
Freehand XML File Example
<?xml version='1.0'?>
<root>
<EMPLOYEE_DATA>
<EMPLID>KU0005</EMPLID>
<NAME>Aliverdi,Reza</NAME>
<DEPTID>10000</DEPTID>
<LOCATION>KUNY00</LOCATION>
<JOBCODE>420060</JOBCODE>
<COMPRATE>5156.666667</COMPRATE>
<CHANGE_PCT>0</CHANGE_PCT>
<LOCATION_DESCR>Corporation Headquarters</LOCATION_DESCR>
<JOB_DESCR>Director-Human Resources</JOB_DESCR>
<COMPANY_DESCR>Global Business Institute</COMPANY_DESCR>
<TRAINING_DATA>
<EMPLID>KU0005</EMPLID>
<COURSE_START_DT>2000-09-11</COURSE_START_DT>
<COURSE>K018</COURSE>
<SESSION_NBR>0004</SESSION_NBR>
<COURSE_TITLE>PeopleTools 1</COURSE_TITLE>
<COURSE_END_DT>2000-09-15</COURSE_END_DT>
<ATTENDANCE>E</ATTENDANCE>
<TRAINING_REASON></TRAINING_REASON>
<COURSE_GRADE></COURSE_GRADE>
<PREREQ_MET>N</PREREQ_MET>
<DEPTID>10000</DEPTID>
<BUSINESS_UNIT>US001</BUSINESS_UNIT>
</TRAINING_DATA>
</EMPLOYEE_DATA>
</root>
14
Collaborate 10 Copyright ©2010 Northrop Grumman
Appendix C
File Layout XML File Example
<?xml version='1.0'?>
<Start>
<X_EE_RPT_LTR_VW>
<EMPLID>KU0005</EMPLID>
<NAME>Aliverdi,Reza K</NAME>
<DEPTID>10000</DEPTID>
<LOCATION>KUNY00</LOCATION>
<JOBCODE>420060</JOBCODE>
<COMPRATE>5156.666667</COMPRATE>
<CHANGE_PCT>0.000</CHANGE_PCT>
<LOCATION_DESCR>Corporation Headquarters</LOCATION_DESCR>
<JOB_DESCR>Director-Human Resources</JOB_DESCR>
<COMPANY_DESCR>Global Business Institute</COMPANY_DESCR>
<X_TRAINING_VW>
<EMPLID>KU0005</EMPLID>
<COURSE_START_DT>09/11/2000</COURSE_START_DT>
<COURSE>K018</COURSE>
<SESSION_NBR>0004</SESSION_NBR>
<COURSE_TITLE>PeopleTools 1</COURSE_TITLE>
<COURSE_END_DT>09/15/2000</COURSE_END_DT>
<ATTENDANCE>E</ATTENDANCE>
<TRAINING_REASON> </TRAINING_REASON>
<COURSE_GRADE> </COURSE_GRADE>
<PREREQ_MET>N</PREREQ_MET>
<DEPTID>10000</DEPTID>
<BUSINESS_UNIT>US001</BUSINESS_UNIT>
</X_TRAINING_VW>
</X_EE_RPT_LTR_VW>
</Start>
15
Collaborate 10 Copyright ©2010 Northrop Grumman
Appendix D
Rowset XML File Example
<?xml version="1.0"?>
<rs_X_EE_RPT_LTR_VW numrows="1" rowsetname="X_EE_RPT_LTR_VW"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="">
<row_X_EE_RPT_LTR_VW rownumber="1">
<fld_EMPLID>KU0005</fld_EMPLID>
<fld_NAME>Aliverdi,Reza K</fld_NAME>
<fld_DEPTID>10000</fld_DEPTID>
<fld_LOCATION>KUNY00</fld_LOCATION>
<fld_JOBCODE>420060</fld_JOBCODE>
<fld_COMPRATE>5156.666667</fld_COMPRATE>
<fld_CHANGE_PCT>0</fld_CHANGE_PCT>
<fld_LOCATION_DESCR>Corporation Headquarters</fld_LOCATION_DESCR>
<fld_JOB_DESCR>Director-Human Resources</fld_JOB_DESCR>
<fld_COMPANY_DESCR>Global Business Institute</fld_COMPANY_DESCR>
<rs_X_TRAINING_VW numrows="1" rowsetname="X_TRAINING_VW">
<row_X_TRAINING_VW rownumber="1">
<fld_EMPLID>KU0005</fld_EMPLID>
<fld_COURSE_START_DT>2000-09-11</fld_COURSE_START_DT>
<fld_COURSE>K018</fld_COURSE>
<fld_SESSION_NBR>0004</fld_SESSION_NBR>
<fld_COURSE_TITLE>PeopleTools 1</fld_COURSE_TITLE>
<fld_COURSE_END_DT>2000-09-15</fld_COURSE_END_DT>
<fld_ATTENDANCE>E</fld_ATTENDANCE>
<fld_TRAINING_REASON></fld_TRAINING_REASON>
<fld_COURSE_GRADE></fld_COURSE_GRADE>
<fld_PREREQ_MET>N</fld_PREREQ_MET>
<fld_DEPTID>10000</fld_DEPTID>
<fld_BUSINESS_UNIT>US001</fld_BUSINESS_UNIT>
</row_X_TRAINING_VW>
</row_X_EE_RPT_LTR_VW>
</rs_X_EE_RPT_LTR_VW>
16
Collaborate 10 Copyright ©2010 Northrop Grumman
Appendix E
Rowset Schema (XSD) File Example
<?xml version="1.0"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:documentati
on>Schema for PeopleSoft RowSet:
X_EE_RPT_LTR_VW</xsd:documentation></xsd:annotation><xsd:element
name="rs_X_EE_RPT_LTR_VW" type="rs_X_EE_RPT_LTR_VWtype"/><xsd:complexType
name="rs_X_EE_RPT_LTR_VWtype"><xsd:sequence><xsd:element
maxOccurs="unbounded" minOccurs="0" name="row_X_EE_RPT_LTR_VW"
type="row_X_EE_RPT_LTR_VWtype"/></xsd:sequence><xsd:attribute
name="rowsetname" type="xsd:string"/><xsd:attribute name="numrows"
type="xsd:integer"/></xsd:complexType><xsd:complexType
name="row_X_EE_RPT_LTR_VWtype"><xsd:sequence><xsd:element name="fld_EMPLID"
type="fld_EMPLIDtype"/><xsd:element name="fld_NAME"
type="fld_NAMEtype"/><xsd:element name="fld_DEPTID"
type="fld_DEPTIDtype"/><xsd:element name="fld_LOCATION"
type="fld_LOCATIONtype"/><xsd:element name="fld_JOBCODE"
type="fld_JOBCODEtype"/><xsd:element name="fld_COMPRATE"
type="fld_COMPRATEtype"/><xsd:element name="fld_CHANGE_PCT"
type="fld_CHANGE_PCTtype"/><xsd:element name="fld_LOCATION_DESCR"
type="fld_LOCATION_DESCRtype"/><xsd:element name="fld_JOB_DESCR"
type="fld_JOB_DESCRtype"/><xsd:element name="fld_COMPANY_DESCR"
type="fld_COMPANY_DESCRtype"/><xsd:element name="rs_X_TRAINING_VW"
type="rs_X_TRAINING_VWtype"/></xsd:sequence><xsd:attribute name="rownumber"
type="xsd:integer"/></xsd:complexType><xsd:simpleType
name="fld_EMPLIDtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="11"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_NAMEtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="50"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_DEPTIDtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="10"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_LOCATIONtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="10"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_JOBCODEtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="6"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_COMPRATEtype"><xsd:restriction base="xsd:decimal"><xsd:totalDigits
value="19"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_CHANGE_PCTtype"><xsd:restriction
base="xsd:decimal"><xsd:totalDigits
value="8"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_LOCATION_DESCRtype"><xsd:restriction
base="xsd:string"><xsd:maxLength
value="30"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_JOB_DESCRtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="30"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_COMPANY_DESCRtype"><xsd:restriction
base="xsd:string"><xsd:maxLength
value="30"/></xsd:restriction></xsd:simpleType>
17
Collaborate 10 Copyright ©2010 Northrop Grumman
XSD File Continued
<xsd:complexType name="rs_X_TRAINING_VWtype"><xsd:sequence><xsd:element
maxOccurs="unbounded" minOccurs="0" name="row_X_TRAINING_VW"
type="row_X_TRAINING_VWtype"/></xsd:sequence><xsd:attribute name="rowsetname"
type="xsd:string"/><xsd:attribute name="numrows"
type="xsd:integer"/></xsd:complexType><xsd:complexType
name="row_X_TRAINING_VWtype"><xsd:sequence><xsd:element name="fld_EMPLID"
type="fld_EMPLIDtype"/><xsd:element name="fld_COURSE_START_DT"
type="xsd:date"/><xsd:element name="fld_COURSE"
type="fld_COURSEtype"/><xsd:element name="fld_SESSION_NBR"
type="fld_SESSION_NBRtype"/><xsd:element name="fld_COURSE_TITLE"
type="fld_COURSE_TITLEtype"/><xsd:element name="fld_COURSE_END_DT"
type="xsd:date"/><xsd:element name="fld_ATTENDANCE"
type="fld_ATTENDANCEtype"/><xsd:element name="fld_TRAINING_REASON"
type="fld_TRAINING_REASONtype"/><xsd:element name="fld_COURSE_GRADE"
type="fld_COURSE_GRADEtype"/><xsd:element name="fld_PREREQ_MET"
type="fld_PREREQ_METtype"/><xsd:element name="fld_DEPTID"
type="fld_DEPTIDtype"/><xsd:element name="fld_BUSINESS_UNIT"
type="fld_BUSINESS_UNITtype"/></xsd:sequence><xsd:attribute name="rownumber"
type="xsd:integer"/></xsd:complexType><xsd:simpleType
name="fld_COURSEtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="6"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_SESSION_NBRtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="4"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_COURSE_TITLEtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="30"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_ATTENDANCEtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="1"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_TRAINING_REASONtype"><xsd:restriction
base="xsd:string"><xsd:maxLength
value="2"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_COURSE_GRADEtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="3"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_PREREQ_METtype"><xsd:restriction base="xsd:string"><xsd:maxLength
value="1"/></xsd:restriction></xsd:simpleType><xsd:simpleType
name="fld_BUSINESS_UNITtype"><xsd:restriction
base="xsd:string"><xsd:maxLength
value="5"/></xsd:restriction></xsd:simpleType></xsd:schema>
18
Collaborate 10 Copyright ©2010 Northrop Grumman
Appendix F
XMLDoc XML File Example
<?xml version="1.0"?>
<root>
<EMPLOYEE_DATA>
<EMPLID>KU0005</EMPLID>
<NAME>Aliverdi,Reza K</NAME>
<DEPTID>10000</DEPTID>
<LOCATION>KUNY00</LOCATION>
<JOBCODE>420060</JOBCODE>
<COMPRATE>5156.666667</COMPRATE>
<CHANGE_PCT>0</CHANGE_PCT>
<LOCATION_DESCR>Corporation Headquarters</LOCATION_DESCR>
<JOB_DESCR>Director-Human Resources</JOB_DESCR>
<COMPANY_DESCR>Global Business Institute</COMPANY_DESCR>
<TRAINING_DATA>
<EMPLID>KU0005</EMPLID>
<COURSE_START_DT>2000-09-11</COURSE_START_DT>
<COURSE>K018</COURSE>
<SESSION_NBR>0004</SESSION_NBR>
<COURSE_TITLE>PeopleTools 1</COURSE_TITLE>
<COURSE_END_DT>2000-09-15</COURSE_END_DT>
<ATTENDANCE>E</ATTENDANCE>
<TRAINING_REASON></TRAINING_REASON>
<COURSE_GRADE></COURSE_GRADE>
<PREREQ_MET>N</PREREQ_MET>
<DEPTID>10000</DEPTID>
<BUSINESS_UNIT>US001</BUSINESS_UNIT>
</TRAINING_DATA>
</EMPLOYEE_DATA>
</root>
19
Collaborate 10 Copyright ©2010 Northrop Grumman
Appendix G
Combining PDF Files
import PSXP_RPTDEFNMANAGER:*;
import PSXP_ENGINE:*;
[Continued below…]
20
Collaborate 10 Copyright ©2010 Northrop Grumman
Continued…
&sDirSep = GetDirSeparator();
&FirstReportFileName = &oXML_PUB_1.ID | "." |
Lower(&oXML_PUB_1.GetOutDestFormatString(2));
&FirstReportFilePath = &oXML_PUB_1.OutDestination | &sDirSep | "RptInst" |
&sDirSep | &FirstReportFileName;
/* Merge Documents */
/* define result file location and name */
&PDF_Merge_File = GetFile("PDF_MERGE.pdf", "W");
&PDF_Merge_File_name = &PDF_Merge_File.Name;
&PDF_Merge_File.Close();
/* PeopleTools 8.48 */
&oMerger = create PSXP_ENGINE:PDFMerger();
&PDF_Merge_Error = "";
&PDF_Merge_Array = CreateArray(&FirstReportFilePath);
&PDF_Merge_Array.Push(&SecondReportFilePath);
&PDF_Merge_Result = &oMerger.mergePDFs(&PDF_Merge_Array,
&PDF_Merge_File_name, &PDF_Merge_Error);
21
Collaborate 10 Copyright ©2010 Northrop Grumman