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.
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.
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.
Go to Add-Ins > Insert > Table Wizard . Perform the below steps.
Click Finish. Below is the template snap.
Create Report Definition:
Navigation: Reporting Tools > XML Publisher > Report Definition. Perform the following steps.
Create Component, Page, Menu:
Create Page, Component, Menu and Register it from Online.
Write PeopleCode to Component Record field Field Change event.
/*===================================
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:
Thanks
Milan Bhattacharjee