Categories
PeopleCode XML Publisher

Create a Report Using XML Publisher – PeopleSoft

To create a PS Query Based XML Publisher Report we have to do the below steps:

Create a PS Query:

Navigation : Reporting Tool > Query > Query Manager.

PS-Query1

 

 

 

 

 

 

 

 

 

PS-Query2

 

 

 

 

 

Create Data Source:

Navigation: Reporting Tools > XML Publisher > Data Source.

Choose Data Source type as PS-Query and choose Data Source ID from the prompt.

datasource_1

 

 

 

 

 

 

datasource_2

 

 

 

 

 

 

 

 

 

 

Generate XML and XSD files, and save the page.

Create RTF Template:

  • Download the XML file from the newly created data source.
  • Open Microsoft Word, go to Add-Ins > Data > Load XML Data.

word1

 

 

 

 

Go to Add-Ins > Insert > Table Wizard . Perform the below steps.

word2

 

 

 

 

 

 

word3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

word4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Click Finish. Below is the template snap.

rtf_temp

 

 

 

 

Create Report Definition:

Navigation: Reporting Tools > XML Publisher > Report Definition. Perform the following steps.

rpt_defn1

 

 

 

 

 

 

 

 

rpt_defn2

 

 

 

 

 

 

rpt_defn3

 

 

 

 

 

 

 

Create Component, Page, Menu:

Create Page, Component, Menu and Register it from Online.

page1

 

 

 

 

 

 

comp1

 

 

 

menu

 

 

 

 

 

Write PeopleCode to Component Record field Field Change event.

pc

 

 

 

 

 

/*===================================
Description:
———————————————————-
Sample XML Publisher Report Where DataSource is a PS-Query.
=====================================*/

import PSXP_RPTDEFNMANAGER:*;

Local string &reportDefnId;
Local string &languageCode, &outputFormat, &templateName, &reportName;
Local date &AsOfDate;

&reportDefnId = “UD_XMLP_DMO1”;
&languageCode = “ENG”;
&outputFormat = “PDF”;
&reportName = “UD_XMLP_DMO1”;
&templateName = “UD_XMLP_DMO1_1”;
&AsOfDate = %Date;

/* Initializing Report Def class Object */
Local PSXP_RPTDEFNMANAGER:ReportDefn &rptDefn = create PSXP_RPTDEFNMANAGER:ReportDefn(&reportDefnId);
&rptDefn.Get();
&rptDefn.ProcessReport(&templateName, &languageCode, &AsOfDate, &outputFormat);
CommitWork();
&rptDefn.DisplayOutput();

Run The Report:

r1

 

 

 

 

 

 

R2

 

 

 

 

 

 

R3

 

 

 

 

 

 

 

 

 

Thanks

Milan Bhattacharjee