Anda di halaman 1dari 26

XML PUBLISHER

INTRODUCTION TO XMLP
Version .50

CEDARCRESTONE INC.

Ravi Joshi & Chris Cameron T 888.793.9606 RAVI.JOSHI@CEDARCRESTONE.COM CHRIS.CAMERON@CEDARCRESTONE.COM


Company

Table of Contents

Introduction! 1

What Is XML Publisher! 1

Comparison Between Tools ! 1

Structure of XMLP! 2

XML Source! 2

Data Source Setup! 2

RTF! 2

Report Setup! 2

File Layout! 3

File Layout Design! 3

Application Package! 6

App Package Structure! 6

App Package PeopleCode Changes! 6

Method Report Changes ! 6

Create XML Data File! 7

Understanding the Call Options! 8

Calling the Application Package! 9

Name of report! i
Company

Running the Program! 9

Installing the Design Helper! 10

Design Helper! 10

Creating an RTF! 11

Save the XML File! 11

Start Word! 11

Load the XML Data! 11

Creating a Data Source! 16

Data Source! 16

Uploading the XML! 16

Creating a Report Definition! 18

Report Definition! 18

Definition! 18

Template! 19

Output! 20

Understanding Security! 21

Roles! 21

End User Access! 21

Using the Template! 22

What it is! 22

How to use it! 22

Name of report! ii
CEDARCRESTONE INC

Introduction

What Is XML Publisher


XML Publisher is an Oracle tool that has been ported over to the PeopleSoft enterprise ERP suite. This tool is used for
creating reports. XML Publisher will be the reporting tool of choice from Oracle when Fusion Applications become
available. XML Publisher (XMLP) is similar to word merge functionality within Peoplesoft

Comparison Between Tools

Tool Pro Con

SQR Very flexible and can do calculations May not be supported in fusion, All
as well as run sql against the development must be done by
database developers

Crystal What you see is what you get. Easy Requires crystal. Everything must be
to develop in. driven via QUERY

XML Publisher What you see is what you get. Can Must have PeopleCode skills
be driven by query or peoplecode.
Can be called from the page or from
a process

XML Publisher - Introduction to XMLP! 1


CEDARCRESTONE INC

Structure of XMLP

XML Source
Publisher requires an XML source to create a report. The two most common sources are Query and an XML File. A
query may be used if there is no nesting of children within the report. A file should be used if there are children records.
The XML file can be created by a variety of processes. In most cases an Application Package will be used to create the
XML File

Data Source Setup


Publisher requires an XML source to create a report. The two most common sources are Query and an XML File. A
query may be used if there is no nesting of children within the report. A file should be used if there are children records.
The XML file can be created by a variety of processes. In most cases an Application Package will be used to create the
XML File

RTF
The Rich Text File is the template for the report. This file is merged with the source to create the XML Report. This file is
created in Microsoft Word using the Oracle XMLP addition in word.

Report Setup
Once an RTF is created it must be linked to the data source. This is done via the PIA.

XML Publisher - Introduction to XMLP! 2


CEDARCRESTONE INC

File Layout

File Layout Design


An XML file layout must exist for every data source. The Layout must show the parent child relationships within the
system for the given report. The parent child relationship could be Person information then a child of Job information.
So in the Person/Job report each person would be on a separate page and each job would be in its own table on the
page.

XML Publisher - Introduction to XMLP! 3


CEDARCRESTONE INC

Under the properties of the file layout it must also be set to XML

XML Publisher - Introduction to XMLP! 4


CEDARCRESTONE INC

XML Publisher - Introduction to XMLP! 5


CEDARCRESTONE INC

Application Package

App Package Structure


The App Package will have a Child App Class and two packages. It is recommended that you take a already developed
package and do a save as since most of the code will not have to change.

App Package PeopleCode Changes


Once a package has been cloned the people code will need to be changed to reflect the new records and new file
layout. All the PeopleCode changes take place within the Report Package. No changes are needed to the ReportUtil
package.

Method Report Changes


The &sRptId will need to be changed to your report name. You will need this name when setting up the xml data source
and template. You will also need to change the child row set name.

XML Publisher - Introduction to XMLP! 6


CEDARCRESTONE INC

Create XML Data File


This section of the code is where the majority of your changes will be needed.

XML Publisher - Introduction to XMLP! 7


CEDARCRESTONE INC

Understanding the Call Options


There are three different output methods for the application package. Depending on where the output must go
determines what call to use.

XML Publisher - Introduction to XMLP! 8


CEDARCRESTONE INC

Output Command Description

Popup Window DisplayReport This is used to print the report to the


screen. It may be used from a push
button to open a report.

Report Repository PublishReport Publishes the report to the report


repository. This must be used by an
application engine since the publish
report needs a process instance

Print Report PrintReport This will print the report on a


configured printer. The printer must
be accessible via the Application
Server

Calling the Application Package


Once you have created your application package you will need to call it from peoplecode. You will need to initiate the
instance of the package, call the report, and then publish, display or print the report. For this example we are showing
the publishing of the report. You will need to change the package name to point to your specific package.

Running the Program


If you have the package attached to an AppEngine the output XML file will be in your report repository. If you can open
this file in Internet Explorer and view the XML your file is correct. If you kicked the code off by a push button your XML
file will exist on the application server under DOMAIN\files\XMLP\RANDOM\. the DOMAIN is the App Server Domain
(ASUSADEV) and the RANDOM is a random directory path. Look for the last updated time in XMLP folder to find the
process your just ran.

XML Publisher - Introduction to XMLP! 9


CEDARCRESTONE INC

Installing the Design Helper

Design Helper
Design Helper is an Oracle tool for MS Word that helps in the development of XMLP Reports. This tool should be
installed prior to creating the report. Navigate to Reporting Tools- XML Publisher-Setup-Design Helper to find the page
with the program. Install the program by clicking the link to download and install program on a Windows PC with Word.

XML Publisher - Introduction to XMLP! 10


CEDARCRESTONE INC

Creating an RTF

Save the XML File


The first step in creating an RTF is saving the XML to you local PC. This XML will be used by the Helper to create fields
that can be used within the report.

Start Word
Start MS Word and create a template with static text. for example if you would like the word NAME: to appear on the
document you will need to type that in.

Load the XML Data


Using the new menu that was installed load the XML data. Go to Template Builder -Data - Load XML. When the Open
File Box appears select your XML file that you saved to your local PC.

Inserting Fields

Fields can be inserted onto the page for level 0 without having to create a table. From the Template Builder menu, select
Insert-Fields. this will open up the fields box. You can drag the fields from this box to the template.

XML Publisher - Introduction to XMLP! 11


CEDARCRESTONE INC

Inserting Fields Within a Table

Level 1 data can be inserted into tables so that more than one row can be printed under a parent. The Tables can be
formated by MS word. To insert the table goto Template Builder- Insert- Table. This will open the Insert Table window.
Drag the nodes from the Left to the Right to build your table. If you decide to drop single nodes, the fields will need to be
dropped on top of the node name.

XML Publisher - Introduction to XMLP! 12


CEDARCRESTONE INC

When you are done building the table click OK. the table will be inserted into the report.

The F and E are a for and end loop. To see or change their logic go to the Template Builder- Tools- Field Browser

XML Publisher - Introduction to XMLP! 13


CEDARCRESTONE INC

Editing Tags
The tags may be edited to perform loops and breaks. When creating a table the F and E tags are created. the F tage
contains <?for-Each:ROWSET?> and the E is the <?end for-each?> If a new tag needs to be created. Copy any tag in
word by selecting the gray block and doing a ctrl-c. Paste the block where the new tag is needed. Now go into the
Field browser and edit the new tag. This will need to be done if you decide to create a report that does a page break by
student. Tags may not be used in the Header or Footer of a page.

Description Type Example

Page Breaks For/End For Loop <?for-each@section:ROWS


ET?>

Table Lines For/End For Loop <?for-each:ROWSET?>

Arithmetic Sum of an Amount <?sum (FIELDNAME)?>

Testing the RTF

Once the file has been created it must be saved as an RTF file and NOT a DOC file. Go to Template Builder- Preview -
PDF. This will create a PDF Preview. You may also do a preview within word by selecting RTF for the preview

XML Publisher - Introduction to XMLP! 14


CEDARCRESTONE INC

Once the preview looks correct you can continue on building the data source and template definitions.

XML Publisher - Introduction to XMLP! 15


CEDARCRESTONE INC

Creating a Data Source

Data Source
A Data Source is the file that feeds the merge process. Each report must have a data source. To Add a data source
goto Reporting Tools-XML Publisher- Data Sources

The Data Source Name should be the same as the report name. Since we created an XML file out we will use the XML
File as the source

Uploading the XML


The XML file needs to be uploaded as a template for the data source.

XML Publisher - Introduction to XMLP! 16


CEDARCRESTONE INC

The Schema File is used for bursting. Bursting is the ability to send parts of the report to different departments.

XML Publisher - Introduction to XMLP! 17


CEDARCRESTONE INC

Creating a Report Definition

Report Definition
The Report Definition ties the Data Source to the RTF file. This must be done prior to running the application. The
Definition name should be the same as the name specified in the code. This is located under Reporting Tools-XML
Publisher-Report Definition.

Definition
This page contains basic information about the report. The file formats are related to the template that was created. For
our example we are using RTF. The status must be Active prior to running

XML Publisher - Introduction to XMLP! 18


CEDARCRESTONE INC

Template
The Template page is where the RTF is uploaded. A report may have more than one template. The Status need to be
active prior to running

XML Publisher - Introduction to XMLP! 19


CEDARCRESTONE INC

Output
The Output page is the where the output format is set.

The Default value will be used by the program during run time.

XML Publisher - Introduction to XMLP! 20


CEDARCRESTONE INC

Understanding Security

Roles
Peoplesoft has two different roles need for XMLP development.

The Power User role allows users to add Query Data Sources and change the RTF Templates. The Report Developer
role allows for the addition of File Data Sources and RTF Development. These roles give access to the pages as well as
access to the technology.

End User Access


End User access to the technology is controlled through the Report Category. Users or Permission lists may be added
to a Category. The Category must match the category on the Report Template Definition. End Users will still need
access to the Page and Component to launch the XMLP.

XML Publisher - Introduction to XMLP! 21


CEDARCRESTONE INC

Using the Template

What it is
A template project has been created for XMLP. This template contains the code needed for a simple App Engine/App
Package XMLP Process. The Code can be used as an example on how to create your own XMLP. The Project is called
ASU_XMLP_TEMPLATE. It contains a file layout, application engine, and app package. This template will help with the
creation of the XML file.

How to use it
Clone the objects within the template. Once you have cloned objects do the following find and replaces as highlighted
within the table below. Once you have completed those steps go on to the Next Steps section. All the code that needs
to be changed is under Report. The code under the Util does not need to be touched.

Description Find Replace With

The report id is the name of REPORTID The name of your report


the report that will be used
in the Report Defn

Child record for the select ASU_XMLP_CHILD The name of your child
record

Parent Record for the ASU_XMLP_PARNT The Name of your parent


select record

XML Output File MYFILE The Output file name for


the XML. Good Idea to
keep the same as the
report name

File Layout Defn that shows ASU_XMLP_TEMPLATE_FL Your File Layout Name
Parent Child relationship

Next Steps

Once the changes have been made, criteria needs to be added to the parent and child selects. You must join the child
record to the parent record to preserve the relationship. Other criteria may be added as well. The two SQL Objects that
will need to be touched are highlighted below in the table.

XML Publisher - Introduction to XMLP! 22


CEDARCRESTONE INC

Object Name Description

&SQL_HDR The SQL is used to drive the report. The criteria used here
is to limit the rows that come back. If a row is not selected it
will not be printed on the report. In most cases this SQL will
do a select all since the App Engine does the limiting of
data.

&SQL_LINE This is the child record. It must be joined to the parent


record by the keys. This SQL Object will need to be modified
in the CREATESQL and in the EXECUTE call to pass the
appropriate bind variables.

XML Publisher - Introduction to XMLP! 23

Anda mungkin juga menyukai