XML Publisher in PeopleSoft
XML Publisher
What is XML Publisher?
XML publisher is a reporting tool.
How does it works?
Data logic is different is separated from layout, so that the same set of data is used in different ways.
Steps
i. Set up XML Publisher
ii. Provide security
iii. Register data sources
iv. Create Templates
v. Create Reports and attach templates
vi. Run and view the reports
Setup XML Publisher
i. First, install the design helper from Reporting Tools àXML Publisher àSetup à Design Helper
This will help in creating rtf templates to be attached with report.
Pre requisite – jre 6.21 32 bit (minimum version)
Once the design helper is installed we can view it under the Add Ins in Word.
ii. Before creating any report, create a report category to provide security to the report.
For example, if we want to create compensation reports, then we can create category compensation
and assign the role / users to it that can view or run the report.
Register Data Sources
The next step is to register the data sources. Data sources are entities that will hold the logic to retrieve the data to be displayed on the report.
There are three types of data sources that are available in PeopleTools 8.51 viz. XML File, Connected Query and PS Query. Prior to 8.50 the available data sources were – PS Query, XML File, XML Docset, Rowset. Rowset and XMLDocset are deprecated now and are available only for backward compatibility.
Create Layout
Now, we will create report layout which will define how our report will look like. We can design the templates through rtf in MS Word, PDF and XSL.
Create Report
Now, we will define the report where we will attach the data source, template and output.
1. Create PS Query
We have created a simple PS Query DR_XMLPUB_QRY which prompts for an employee id and displays the output from NAMES table.
2. Create Data Source
Now, we will create a data source.
Navigate to Reporting Tools à XML Publisher à Data Source
Generate the Sample Data File.
Save the changes.
What ever data source we use it gets converted into xml format internally. So, best performance use the xml file as data source.
3. Create Template
Save the above generated XML.
Now, open MS Word.
Go To Add-Ins à Data à Load XML Data
Select the above XML File and we will get the following message.
Now, we will generate the template using uploaded xml file.
Select all the columns except @rownumber.
Here, we have select EMPLID as the field on which grouping will be done.
Enter valid column labels.
Finally the template is generated.
Save the template.
4. Create Report
Now, we will create the report where we will attach the above create template and we will provide the output options.
Navigate to Reporting Tools à XML Publisher à Report Definition
Add a new value
Click on the Template Tab and upload the above created template.
Click the Output tab and select PDF as output.
Now, save the report.
5. Run the Report
There are two ways to run XML Publisher report which is based on PS Query. They can be run through PIA (Query Report Viewer) as shown below or can be through PeopleCode.
a. Through Query Report Viewer
Navigate to Reporting Tools à XML Publisher à Query Report Viewer
Open the above create report.
Now, click on view report.
b. Through PeopleCode
On the PIA, create a page with a text box and a push button.
On the FieldChange event write the following peoplecode.
Enter the employee id and click on Generate Report.
Using XML File as Data Source
Create Data Source
Create Template
Before template creation we need to have a xml file unlike case of PS Query as data source where we can generate the PIA from PIA itself.
Following is the code to generate the xml file from rowset.
We can see that under C:\temp both the xml and xsd files have been generated.
Now, create the template by uploading the above generated xml file.
Create Report
Create a new report and select XML file as data source.
Save the changes.
Run the Report
Since this a XML file based report so it can’t be viewed from Query Report Viewer as it was case with PS Query.
So, we have to write peoplecode to view the xmlp reports based on xml file as data source.
View the report on PIA.
Performance wise using XML file data source is better option. It is also helpful to easily develop reports based on parent-child relationship or to implement complex logic to fetch the data.
No comments:
Post a Comment