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.
This comment has been removed by the author.
ReplyDeleteSuper .... Include for generating from AE also....
ReplyDeleteexcellent article
Thanks Mohammad
DeleteHi Deepak,
ReplyDeleteCould you explain me that, How can you create a template using multiple querries. i.e. a rtf template uses output of multiple querries (e.g. one query is from Job data, another query is from dependent beneficiary and another one from payroll table) to be shown in the report. which type of data source should we use and how to use it (with example)
Seeing you requirement.. it seems to be little complex. For this purpose I would suggest you to use XML file as data source.. It would be very much flexible in generating parent child-relationship and performance wise also its the best...you can refer creating xml file from rowset with parent child relationship and then use this xml file as datasource... please let me if you have any issues..
Deletegreat article buddy.... :) can u share ur Gmail Id so that we can connect and i can more from you if you dont mind... my ID harisharekar4@gmail.com
ReplyDeletemy id is - deepthnk2003@gmail.com
ReplyDeleteplease contact me after 10th jan..
hi Deepak..Can u plz provide article about connected queries tooo...Thanks in advance
DeleteVery nice article Deepak.
ReplyDeleteIt's much appreciated.
Its Really a Good Idea to share what we Learnt...Thanks..Deepak
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHi Deepak, Thanks for the info. I have a complex template which needs to be generated from online page push button and this template can be accessible in multiple countries in pdf format. So the values with in the template may dynamically change by country. The data that we want to show on the template resides in one view for all countries(So no child rows). Can we assign the values in the template by checking logical conditions in peoplecode using rowset? If so can you please share some sample code for that?
ReplyDeleteThanks in Advance.
Pran Kumar
Useful article.. How to use connected query as data source?
ReplyDeleteThanks Deepak
Deletehi guys, i want to know how to create a bi publisher report using Ps query as source from the scratch itself
ReplyDeleteI'm very happy to search out this information processing system. I would like to thank you for this fantastic read!!
ReplyDeleteLearn XML Publisher Reports for Beginners Actual cost of this course is 9,999/- But now Kuncham Software Solutions Pvt ltd is giving you Free access. Limited period offer Hurry-up Enroll Now at Udemy.
Hurry-Up Enroll Now and get Free Access to the Entire Course