Wednesday, 20 February 2013

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.

 Creating XML Publisher Report using PS Query through

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.





                

Saturday, 26 January 2013

Consume Third Party Web Service in PeopleSoft


Consuming 3rd Party Web Service in PeopleSoft

In this example we will consume a 3rd party web service in our peoplesoft system. The web service we have used is a simple calculator program having four operations – Add, Subtract, Multiply & Divide.


We are on PeopleTools 8.51.15
Before performing the steps please make sure that Integration Broker is configured - Integration Broker Setup

Step 1 – Setup Node


We have to setup a node in PeopleSoft System which will communicate with the external system.
Open the existing node WSDL_NODE.






Copy the node to be used for integration.




Step 2 – Get a Public Web Service

There are many available on the net. We will use this as an example.

http://www.dneonline.com/calculator.asmx?WSDL




It is having four operations – Add, Multiply, Subtract and Divide. We will use these four operations.

Step 2 – Consume the Web Service



Navigate to PeopleTools  Integration Broker  Web Services  Consume Web Service



Check the WSDL URL radio button and enter the WSDL.





Select the Operations that you want to use.





Give some friendly message names.






Enter the new node that we have created in the first step.








Step 4 – Enter Connection Information



Again, open the node DR_WEB_SERVICE and enter the connector id and Primary URL.




The Primary URL will be - http://www.dneonline.com/calculator.asmx


Now, ping the node to confirm that the setup is correct.






Step 5 – Provide Security

Now, search for the service operations that we have created above.





Give a permission list which is assigned to your user profile.




Similarly, provide the security for other service operations.

Step 5 – PeopleCode to Use Web Service


Review the request and response message and accordingly we will create in peoplecode.
Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Add xmlns="http://tempuri.org/">
<intA>int</intA>
<intB>int</intB>
</Add>
</soap:Body>
</soap:Envelope>

Response

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddResponse xmlns="http://tempuri.org/">
<AddResult>int</AddResult>
</AddResponse>
</soap:Body>
</soap:Envelope>



Create a simple page –






On the FieldChange event of Calculate button write the following peoplecode. In this example we are using ADD service operation.








Click on the Calculate button.

Request




Response




Integrating Microsoft Azure Document Intelligence Receipt Model with PeopleSoft

  Integrating Microsoft Azure Document Intelligence Receipt Model with PeopleSoft As the digital transformation wave continues to sweep acro...