Vous êtes sur la page 1sur 12

XML Publisher Step by Step Multi-Level Report Template - Example

XML Publisher Step by Step


This document contains step by step instructions for setting up a Multi-Level Report Template. Templates are used by XML Publisher to define how XML data is transformed into a user presentable format. For our purposes, an XML Publisher Report Template is always in the Rich Text Format. The file extension for Rich Text Format documents is .rtf and for our purposes, we edit them with Microsoft Word.

STEP ONE Get the plug-in and install it


In order to edit an XML Publisher Report Template you will need to have the PeopleSoft delivered Plugin for Microsoft Word. We ll refer to this as the plug-in from now on. The plug-in requires version 2000 or later of Microsoft Word and Facilitates the insertion of application data tags into RTF templates. You can download the plug-in by logging into your PeopleSoft application and navigating here:
Main Menu > Reporting Tools > XML Publisher > Setup > Design Helper

The link you find there will allow you to download a zipped file (xmlp_desktop.zip) which, when unzipped, contains a file called, BIPublisherDesktop.exe . Download the file, unzip it, and install the plug-in on your local copy of Microsoft Word.

STEP TWO Create a Data Source


In order create an XML Publisher Report Template a Data Source must already be defined. The plug-in uses an XML Source Sample Data File to determine the expected fields and structures which will be coming into XML Publisher from the Data Source. In order to generate this file, you must (a) have a Data Source and (b) register the Data Source. In our example, we will use a Connected Query as the Data Source. Creating a Connected Query is beyond the scope of this document however you will find a Connected Query defined in the Development environment called Z_UDEM_CON_QUERY_DEMO . You can find it using the following navigation:
Main Menu > Reporting Tools > Connected Query > Connected Query Manager

Several types of Data Sources can be defined, including Query, Connected Query, Rowset, XMLDoc Object and XML File. For our demonstration purposes, we will use the Connected Query:
Z_UDEM_CON_QUERY_DEMO. If you are going to generate a report with multiple levels you must, of course, have a data source that provides multiple levels. A plain Query does not support multiple levels.

(NOTE: Rowset and XMLDoc Object are slated to be depreciated by Oracle. Do not use them.)

81136045.docx

Page 1 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example


STEP THREE Register the Data Source and save the XML Sample file
Ultimately, the piece we really need for creating our Multi-Level XML Report Template, is the Sample Data File from the Related Files section of the Data Source. From here on, we ll call this the XML Sample In order to obtain this, once you have created a Data Source, you must then register the Data Source. This can be accomplished here:
Main Menu > Reporting Tools > XML Publisher > Data Source

Again, in the Development environment, you will find a sample Data Source already registered. The Data Source ID, for both Query and Connected Query Data Source Types are exactly the same as the name of the Query or Connected Query they register. As a result, the sample Data Source for the Z_UDEM_CON_QUERY_DEMO Connected Query is named Z_UDEM_CON_QUERY_DEMO . Once you have registered a Data Source, at the bottom of the Data Source page in PeopleSoft, you will see a section called Related Files . If you are newly creating the Data Source, you will need to create the Sample Data File by clicking the Generate link. Once created, you can download the Sample Data File by clicking on the link in the File column. This will be our XML Sample so save the file somewhere where you can easily find it again, such as on your desktop or My Documents folder.

STEP FOUR Create a blank Rich Text Format file


Now that we have the other pieces we need to set up a XML Publisher Report Template, we can actually generate the template. Start by creating a blank Rich Text Format file. You can accomplish this by opening Microsoft Word to a blank document, then saving it in the appropriate format. (These screen shots were taken using Microsoft Office Word 2007. Your version may require a different sequence of clicks and/or look different)

81136045.docx

Page 2 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example

STEP FIVE Load the XML Sample into the Microsoft Word plug-in
Before doing any edits on your new template, load your XML Sample into the Microsoft Word plug-in. Again, your version of Microsoft Word may look and/or feel a little different, but using Microsoft Office Word 2007, click on the Add-Ins tab, drop down the Data in the Custom Toolbars section, and choose Load XML Data

(If you do not have the Add-Ins or similar tool bar options, you may not have successfully completed Step One.) Upon clicking the Load XML Data option, you will get the standard dialogue box for selecting a file. Locate the file, select it from the list, then click the Open button. You ll then have a dialogue box that indicates your file was uploaded successfully. Click OK to clear the message.

81136045.docx

Page 3 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example


STEP SIX Add Headers, Static Text, and Fields to your XML Template
At this point, you can start laying out your XML Report Template. Because (in Step Five) you loaded the XML Sample you generated (in Step Four) into the Microsoft Word plug-in, the plug-in now knows what types of data to expect when the XML Publisher process is actually run (in the future), and provides these pieces of data for you to add to your template. For data, such as the report and column headings you should add the information into the document header. For messages or information that will appear only once, you can put them before or after the data fields you add through the Microsoft Word plug-in. Finally, for the placement of actual data on the report, use the Insert dropdown to insert your fields. You ll notice there are quite a few options, and you can produce very sophisticated reports. For our purposes, however, we want to create a Multi-Level report. We will use the Table Wizard to add our Top level of fields to the template, and then again, to add our second level of fields to the report within the Top level loop. So let s start with the Top level . . .

STEP SIX A Add the Top level fields for our Multi-Level Report Template
Start by selecting the Table Wizard from the Insert drop down on the Add-Ins tab in Microsoft Word.

81136045.docx

Page 4 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example

Next, you ll have a series of dialogue boxes. Select Free Form . . . then click Next

Select the top level data set from the Data Set drop down . . . then click Next

81136045.docx

Page 5 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example


Select the fields from the left box that you want to have show up on your Top level and move them to the right box by selecting the field, then clicking the single right arrow to move the field into the right box. Then click Next .

If you need to add sorting information, you can, otherwise, just click Finish .

81136045.docx

Page 6 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example


This should insert something like the following into your document:

STEP SIX B Add the Lower level fields for our Multi-Level Report Template
At this point you have your Top level in your Multi-Level XML Report Template. Next, you need to make a space for the Lower level, and add it in.

Place your cursor after the Top level data, and before the close of the Top level loop, and add in your Lower level. Follow the same steps as you did for the Top level: selecting the Table Wizard from the Insert drop down on the Add-Ins tab in Microsoft Word. As you go through the wizard, choose a few relevant Lower level fields & add them in.

81136045.docx

Page 7 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example


STEP SIX C Reformat the fields and add column & heading type of data to the header
The rest of the formatting requires standard Microsoft Word type of skills. What you need to remember, is that with the steps we ve taken to this point, the template code added by the plug-in includes loops. So any editing of text within either loop will be repeated, each time the loop is generated by the incoming data. Report headers, footers and formatting should be created according to the UdeM reporting standards. Please be familiar with the standards and follow them. NOTE: You can download any template that has been uploaded to the system. Reviewing existing created templates can be very helpful in learning how to create your own. Use the navigation in Step Seven to find existing templates, and download them by clicking on the Template File hyperlink on the Template tab. NOTE: The plug-in has a lot of very powerful functions. You can do amazing things with the template. One way to see what is going on behind the scenes is to double click on a field. It should bring up the BI Publisher Properties dialogue box, allowing you to see and even edit the fields.

81136045.docx

Page 8 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example

STEP SEVEN Create a Report Definition and upload your XML Template to it.
Once your template is created, it s time to upload it into the system. This is done starting with the following navigation:
Main Menu > Reporting Tools > XML Publisher > Report Definition

To start with, you ll be choosing: Add a New Value . You can choose an appropriate Report Name (Again, check the UdeM standards), in our case we choose Connected Query as the Data Source Type, and then search for our Data Source ID . Remember your Data Source ID will be exactly the same as the name of your Connected Query. The next few screen shots show the Definition tab and the Template tab for the Report Definition. The first tab shows the basic details page of the Report Definition. Notice that the Data Source is part of the key information for the XML Report.

81136045.docx

Page 9 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example


The second tab shows the template section of the Report Definition and allows you to upload your template into the system. You should set the Status to Active and it is a good practice to set the effective date back to 01/01/1901:

Upon pressing the Upload button, you ll be presented with a dialogue box, where you can use the standard method to find and upload your file:

81136045.docx

Page 10 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example


Once the template is uploaded, you can click on the Preview button to see a preview. Be sure and Save your Report Definition. And remember if you come back in to upload a modified template, you ll need to ensure you are in Correct History mode otherwise the system will not let you replace the template.

81136045.docx

Page 11 of 12

2012-01-12 - 1:43:25 PM

XML Publisher Step by Step Multi-Level Report Template - Example


STEP EIGHT Run your Report using the Query Report Scheduler
Once you have all the pieces in place, you can run your report using the Query Report Scheduler:
Main Menu > Reporting Tools > XML Publisher > Query Report Scheduler

Here is a screen shot of what the demonstration template looks like:

The final report then looks something similar to the following:

81136045.docx

Page 12 of 12

2012-01-12 - 1:43:25 PM