Sunteți pe pagina 1din 138

BI Publisher for PeopleSoft Enterprise

Overview of BI Publisher and Setting up

Objectives of this Lesson:


BI Publisher Over View
Setting Up Report Manager
Defining Report Categories
Downloading Design Plug-ins

XML Publisher
Overview
Separate data/ layout/ translation

More flexibility
Data Logic

Layout Template

Translation

Reduced maintenance

XML Publisher

Report Output

BI Components

Reporting Tools

Reporting Tools

When to consider XMLP instead:

Crystal Reports

Close in functionality.
Consider XMLP for new reports.
XML Publisher is not dependent on windows.

nVision

Consider XMLP instead of nVision tabular


layouts.
Excel is a supported output type.

SQR

Using application engine for data logic and


XMLP for publishing, you can take
advantage of bursting capabilities.

XML Publisher
Integration
Adobe Acrobat

PDF

RTF

Microsoft Word
with Plug-in

Template Manager

Template

XML

PSQuery

Email

HTML
Connected
Query

Xml file

Data
Handler

XML

XMLP
Engine

PDF
RTF

Process
Scheduler

Printer
Repository
e-commerce

XML Publisher
Phases
Set up XML Publisher

Create and Register Data Sources

Create and Upload Templates

Create XML Publisher Reports

Run and View XML Publisher Reports

Bursting
<PayChecks>
<PayCheck>
<EmpId>1000</Empld>
<DeptId>01</DeptId>
<Salary>1000</Salary>
</PayCheck>
<PayCheck>
<EmpId>1001</Empld>
<DeptId>01</DeptId>
<Salary>1000</Salary>
</PayCheck>
<PayCheck>
<EmpId>1002</Empld>
<DeptId>02</DeptId>
<Salary>1000</Salary>
</PayCheck>
</PayChecks>

Bursting by EMPLID

1001

1000

1002

Bursting by DeptID
EmpID:
1000
1001

DeptID: 01

EmpID:
1002

DeptID: 02

Translation
Report Definition
Layout 1
Template File
En 01/01/07
XLIFF de
XLIFF es
Layout 2
Template File
En 01/01/07
XLIFF jp

Setting Up Report Manager


Actvating
1) Domain: PeopleTools-> Integration Tools-> Configuration-> Quick
Configuration.
2) Service Operations PeopleTools->Integration Tools-> Integration
Setup-> Service Operations
PSFR_FOLDER_CREATE
PSRF_REPORT_CREATE
PSRF_REPORT_DATE_CHANGE
PSRF_REPORT_DELETE

Setting Up Report Categories


Report Category is a required attribute on all report definitions and
Content Library sub-templates.
By assigning a report category, you are actually applying row level security
to the data on those components.
Read only: Select to indicate that the designated ID is only able to view
the report definitions under this category and not update them.

Reporting Tools, BI Publisher, Setup, Report Category

Downloading Design Plug-ins


Reporting Tools, BI Publisher, Setup, Design Helper

During template creation, a design helper facilitates the insertion of


application data tag placeholders into your templates. A schema or sample
data file is required for using a design helper.
Two template design helpers are available: one for designing RTF reports
(MS Word Template Builder) and one for the PDF template that gets
embedded as a JavaScript inside the PDF template itself when you upload
the template to PeopleTools.
This page enables users to download a plug-in for Microsoft Word to
facilitate offline RTF template design. Two versions of the plug-in are
available: one for 32bit Word and another for 64bit Word.
Select a version that applies from the list to enable the download button.
The plug-in is downloaded as a zip file. Based on your selection, the zip file
contains either BIPublisherDesktop32.exe or BIPublisherDesktop64.exe
that should be run to install the plug-in.

Assigning BIP Permissions to Users

PTPT2600 - XMLP Report Developer - Report developers


PTPT2500 - XMLP Power User - Power users
To add Permission List see the below steps
Main Menu->PeopleTools->Security->User Profiles
Select the User (by example PS), then role .
Select the tab Permission List and add the two permission list
PTPT2600 & PTPT2500.

BIP Permissions to Users


Component

XMLP Report
Developer
(PTPT2600)

XMLP Power User


(PTPT2500)

PeopleSoft User
(PTPT1000)

Report Category

Yes

No

No

Design Helper

Yes

Yes

No

Global Properties

Yes

No

No

Data Source

Yes

No

No

Report Definition

Yes

Yes

No

Content Library

Yes

Yes

No

Query Report viewer

Yes

Yes

No

Query Report
Scheduler

Yes

Yes

No

Report Repository

Yes

Yes

Yes

Creating and Registering Data Sources

Objectives

By the end of this lesson, you will be able to:


Describing Data Sources
Creating Query-based Data Sources
Creating XML File Data Sources
Registering XML File Data Sources

Data Sources
XML Publisher supports the following data sources:

Data Source

Description

PeopleSoft Query

Queries designed to be used by another reporting


tool.

Connected Query

Connected Query enables you to create a single XML file


based on a set of queries with parent-child relationships.

XML File

The Extended Markup Language (XML) is a method


for putting structured data in a text file.
you can generate XML data using any means including
PS/Query, SQR, Application Engine, PeopleCode, File
Layout, and so forth.

Data Generation

Data Extraction

Database

Data Source

Extract
Data

PS/Query

PS/Query

Connected

Connected

Query

Query

AE
PeopleCode
File Layout

XML file

PS Query

PS

Query provides the following benefits:


Metadata-driven, easiest to maintain.
Empower business users for self-service.
Query security is enforced when the report is run.
A sample xml file and schema are automatically generated.

XML File

XML files can be generated using various means, including:


Application Engine programs
SQR Programs
File Layouts

XML File
XML declaration
Root element
Data Content

<?xml version="1.0"?>
<root>
<ITEMS>
Start tag
<ITEM_CD>001</ITEM_CD>
<DESCR>Laptop</DESCR>
<PRICE>800.00</PRICE>
</ITEMS>
<ITEMS>
End tag
<ITEM_CD>002</ITEM_CD>
<DESCR>Desktop</DESCR>
<PRICE>650</PRICE>
</ITEMS>
</root>

Well-Formed XML
Document
The XML File can be any well-formed XML file, such that:
An XML document must have one root element
An element must have matching start and end tags names, unless
they are empty elements
Elements can be nested, but can not overlap
All attributes values must be quoted
Attribute names must be unique in the start tag of an element
Comments and processing instructions do not appear inside tags
The < or & special characters cannot appear in the character data of
an element or attribute value

Data Source
A data source stores the sample XML file and optionally the schema file in
the database.

Sample
XML File
.xml
Preview Report in database

Schema
.xsd
Use PDF template

Data Source
Registration
Benefits of data source registration include the ability to:
Reuse the data source with multiple report definitions.
Perform iterative template development.
Preview the template.
Take advantage of built-in bursting functionality when the data
schema file is registered.

Generating PS Query Data Source


Use the Register Data Source page with PS Query data source to:
Generate the sample data file.
Download the sample data file to facilitate RTF template creation.
Reporting Tools, XML Publisher, Data Source, Add a New Value

Default Data
Source Type

Select existing
query

Generate Sample Data and Schema

You can generate a sample


data file and schema

Uploading Data
Source
For non-query data sources the related sample data and schema files
must be uploaded into the database.
Reporting Tools, XML Publisher, Data Source, Add a New Value, enter data
source type and name, Add

Creating Templates

BI Publisher for PeopleSoft Enterprise

Objectives

By the end of this lesson, you will be able to:


Describing Template Types
Creating RFT Templates
Using Table Wizard
Using Pivot Table
Working with PDF Files

Template Types

The following template types are supported:


RTF (Rich Text Format)
PDF
eText
XSL
PeopleSoft supplies design helpers for RTF and PDF templates.

Using Microsoft Word


Template Designer Menu

Downloading PS
Query Sample File
To create an RTF template for a PS Query sample file:

1.Add a new data source.


2.Generate the sample XML file.
3.Save the sample XML file to a local drive.
4.In Microsoft Word, create the RTF document to use as a template.
5.Load the sample XML data.
6.Insert the fields in the document.

Loading Sample XML Data

When the sample data has been loaded, you will not see the data
displayed until you select one of the Insert options.

To load the sample XML data:


1.In Microsoft Word, select Data, Load XML Data.
2.Select the XML sample data file.
3.You will receive a message that the data was successfully loaded.
4.Click OK.

Insert Menu
The plug-in provides the ability to insert data fields into your document

Insert Menu

Description

Field

Allows you to select fields from your data source and


insert them into the template.

Table/Form

Allows you to insert tables and forms into your


template.You may insert data fields to be
organized as simple or nested table or as a form
that is repeated with multiple data.

Chart

Allows you to insert a chart that is understood by


Oracle XML Publisher.

All Fields

Inserts all fields found in the XML data into your


document.

Inserting Fields
To insert fields into the Word document:
1.Select Insert, Field.
2.Position the cursor where you want to insert the field.
3.Select the field from the Field Dialog box.
4.Click Insert.

You can also double-click the field in the dialog box to insert the field.
You can either select another data field or close the dialog by clicking the
Close button

Field Dialog Box


For a large XML with
a complicated
structure, you can
use the Find
functionality to find a
specific field.

Each field from the


sample xml doc is
available

You can select the


field to be used for
calculation.

This is used only for


languages that print rightto-left, such as Arabic or
Hebrew.

Example RTF Template

The form fields are indicated by gray boxes:

File, Save, change type to RTF and name the template.

Form Field Help Text


Double-click on an inserted field and select Add Help Text

Preview Data
You can preview the report in:
PDF
HTML
Excel
RFT

EMPLID sample data


You have been confirmed in JOB_DESCR sample data
course staring 2014-01-17 at the LOCATION sample data
facility.
The address is:
STREET1 sample data
STREET2 sample data

Demo: Creating RTF


Template

In this activity, we will create a report template for Employee and Their
Address.

Table/Form Dialog Box

The insert table/form dialog box allows you to:


Create a simple or nested table with a variable number of rows.
Associate a group of data elements, such as complex invoice or a
purchase order line, with a form in the document that will be repeated
for each occurrence of the data element.
Group or re-group data.

Table Form Wizard

The wizard guides you through the process:


Step 1: Select Report Format
Step 2: Select Report Data
Step 3: Select Data Fields
Step 4: Group Report
Step 5: Sort Report
Step 6: Headers/Labels

Step 1: Select Report Format

Step 2: Select
Report Data
Select the data set to use for the table

Step 3: Select
Data Fields
Select the data fields that will be shown in your report

Step 4: Group Report


In this step, you can group the report by selected data fields.

Grouping Layout
Options

Group Left
Grouping
Header
Grouping
Field

Grouping Header

Header 1

Header 2

Header 3

Header 4

Header 5

Data 1

Data 2

Data 3

Data 4

Data 5

Group Above
Grouping Field 1
Header 1

Header 2

Header 3

Header 4

Header 5

Data 1

Data 2

Data 3

Data 4

Data 5

Step 5: Sort
Report
You can sort the data in the table by up to 4 different fields

Step 6: Headers/Labels
You can change the default labels / column headers

Table/Form
Advanced

The Advanced option uses drag and drop to select the fields to insert into your
template:

Pivot Table

Demo: Designing RTF Template with a Table


In this activity, we will use the Query data source XMLP_COURSE_LIST
that we created in an earlier demo to create a template to list courses
grouped by course type.

Designing PDF
Templates
The source of the PDF document does not matter, Possible design options
are:
Design the layout of your template using any application that
generates documents that can be converted to PDF.
Scan a paper document to use as a template.
Download a PDF document from a third-party Web site.

Form Fields on
PDF Template

PDF Guidelines
The following guidelines need to be adhered to when working with PDF
templates whether or not you are mapping PDF template fields and tags:
The PDF document must allow editing.
Files must be Adobe Acrobat 5.0 compatible.
Files must have form fields for the placement of application data, with
each field tag being unique.
Files should not have embedded javascript.

Review
In this lesson, you learned that:
XML Publisher supports RTF, PDF, eText and XSL templates.
The Template Builder plug-in is used to create RTF templates.
The Table/Form wizard allows you to easily create standard reports.
PDF templates contain form fields that will display the data from the
XML input file.

Sub-Template
Sub-templates can be created that contain formatting and data fields that
are used in multiple templates.
Within a single sub-template file, multiple sub-template components can
be available.
Start and end template indicators must exist to distinguish those various
components.

<?template:component_name?>
<?end template?>

where component_name is the name you assign sub-template.

Sample SubTemplate

For example, syntax of a sub-template file containing two components could


be:

<?template:header?>
EMPLOYEE DETAILS
<?end template?>
<?template:address?>
Pleasanton Campus
500 Oracle Lane
Pleasanton, CA 94488
<?end template?>

Define sub-template

Importing SubTemplate

<?template:header?>
XMLP Training
<?end template?>

Sub1.rtf

Define sub-template in
Content Library

Sub-Template ID: TRAINING


Sub-Template file: sub1.rtf

Import sub-template
into a template
<?import:psxmlp://TRAINING?>
<?call-template:header?>

Importing SubTemplate
To import a sub-template file that is stored in the Content Library, use
this syntax:

<?import:psxmlp://sub-template_NAME?>
Where sub-template_NAME is the registered sub-template ID in the
Content Library
To preview a sub-template in Word, use this syntax:

Note the triple slashes and the use of the actual file name instead of the
<?import:file:C:///Directory/subtemplate_file.rtf?>
template ID

Calling the
Template
Use this syntax to call the template:

<?call-template:template_name?>
Example:

Passing
Parameters
By default, PeopleTools( through the ReportDefn class ProcessReport
method) always passes the following parameters/tags:
<?$ReportID?>
<?$ReportTitle?>
<?$RunDate?>
<?$ReportID?>
<?$RunTime?>

Report Template
The declaration is defined in the Help Text

<xsl:param
name="ReportID"
xdofo:ctx="begin"/>

Declaration in primary
template

Demo: Adding a
Sub-Template
In this activity, we will create a sub-template and use it in our student letter.

Defining XML Publisher Reports

XML Publisher for PeopleSoft Enterprise

Objectives
By

the end of this lesson, you will be able to:


Describe report definitions.
Create report definitions.
Burst reports.
Use Content Library.
Maintain template translations.

Report Definitions
Report definitions are used to:
Associate a data source with a template.
Define output options.
Grant security to view report.
Define bursting options.

Report Definition
Pages
Page

Description

Definition

Identifies the data source and report name. Properties


define the report status, report category and template
type.

Template

Identifies the templates associated with the report. As well


the channels (web posting, printer, fax, and so on)
associated with the specific template.

Output

Identifies the output options that will be available when the


reports is run.

Security

Identifies by role or user ID who can view the report once


it has been run.

Bursting

Identifies busrting rules when this feature is used to


generate report results in separate output files when
bursted reports are run through Process Scheduler.

Creating a New Report Definition


PS Query
Reporting Tools, XML Publisher, Report Definition

Data Source Type = PS Query

Select an existing Query


The data source will
automatically be generated
when you save the report.

Definition Page

Status must be Active in


order to run the report

The template type can not


be changed once you save
the report definition
You can download the
sample data file for template
creation

Template Page
A report may have multiple templates

Multiple templates
can be assigned

Template name is generated

web posting,
printer, fax

Multiple effective-dated templates can


be assigned.

At lease one template must


be active in order to save a
report definition

Use this button to upload an


existing template

The preview button uses


the sample xml data file
to generate report output

Output Page

Which output types


will be available to
the user

Default
displayed at
runtime on
prompt or
run control

Output Format
Options

Based on the template type, the output options are as follows:

Template Type

Output Options

RTF

pdf, html, rtf, xls (html)

PDF

pdf

Etext

txt

XSL

pdf, html, rtf, xls (html)

Security Page
Use the Security page to:
Indicate whether the report requestor can add to the standard
Distribute To values on the Process Scheduler Request, Distribution
Detail page.
Define the roles or users who can:
View web-posted output in the Report Manager repository.
Use the XML Publisher Report Repository Search page.

Demo: Creating Report


Definitions

In this demo, we will create two report definitions one for student letter and
one for course listing.

Bursting
When you generate a bursted report, separate document files are created
for each unique data value for a specified field tag.

<row rownumber="1">
<BU>NAM01</BU>
<LOC>TEA</LOC>
</row>
<row rownumber="2">
<BU>NAM01</BU>
<LOC>PHI</LOC>
</row>
<row rownumber="3">
<BU>NAM02</>
<LOC>ATL</LOC>
</row>

NAM01

NAM02

Bursting Page
Data attribute to burst by

Template or
translation for
each burst file
assigned at
runtime

Report file
security
assigned at
runtime

Search key data values

Burst By
The reports data source must have an associated schema file. The
schema is used to:
Identify the highest level repeating group (node) in the XML source.
Identify node tags.

Schema

Highest level
repeating node

Template
This feature dynamically drives the template assignment at runtime based upon
the data value of a designated schema tag.

Field

Description

Template controlled by

Indicate the field with the template translation


preference.

Data Value

Enter a row for each data value that requires a


specific template or template translation.

Template ID

A template ID should be selected for each data


value that requires a special template.

Language

(Optional) Select a language code for the desired


translation of the template then the specified
data value is found in the XML data.

Search Keys
Delivered search keys include:
Burst By
Report Definition Name
Generated On Date
Additional search keys may be defined to provide even more specific

granularity

Content Library
Page

The Content Library is a component provided for the registration of


reusable sub-template files.
Reporting Tools, XML Publisher, Content Library

Runtime
The complete template (primary and sub-templates) is systematically
assembled by the XML Publisher engine during report generation. The
same occurs during online previewing as long as the sub-template file
exists.
The report in which the sub-template is placed must have a related data
source that supplies data for form fields on the sub-template or the data
must be passed in as runtime parameters.

Runtime parameters

Demo: Registering SubTemplate

In this demo, we will register the sub-template we created for the student
letter and update the report definition to use the template that contains the
sub-template.

Translations
Localization Interchange File Format (XLIFF) .xlf file processing is used for
translations:

Report Definition
Layout

Template file en 01/01/2006


XLIFF de
XLIFF es

Layout

Template file en 01/01/2007

XLIFF jp

Translation
Components
The Template Translation component interfaces with both report definition
templates and Content Library sub-templates.
Template translation files can be created only when a reports template
type is RTF.
Template Translation is a separate component with no row level security,
as the target user is different from the report developer, requestors, or
viewers.

Advanced Search
Reporting Tools, XML Publisher, Translations,Advanced Search

Running and Viewing Reports

XML Publisher for PeopleSoft Enterprise

Objectives
By

the end of this lesson, you will be able to:


Run reports in Query Report Viewer.
Schedule PS Query reports.
Locate and view XML Publisher reports.
Run reports using PeopleCode.
Run reports from application engine.

Query Report
Viewer
Reporting Tools, XML Publisher, Query Report Viewer

Bursted reports are listed,


but they arent executable

select the report format

Existing Query security applies so that each user has access to run only
the reports to which he or she has qualified Query access to the data
source.

Query Report
Scheduler
Query Report Scheduler uses the existing Process Scheduler functionality
to:
Select runtime parameters for query-based reports.
Monitor the report process request.
Post and secure the results to the Report Manager, a printer, or the
Process Scheduler file directory.

Query Report
Scheduler Page
Reporting Tools, XML Publisher, Query Report Scheduler
Select the report

XML Publisher
Report Repository
The XMLP Report Search page allows you to filter criteria to search for reports.
Reporting Tools, XML Publisher, XML Report Search

XMLP Report
Search
You can use additional Search keys defined in the report definition to
narrow down the search:

Report Manager
In Report Manager, you can also search for reports using filters.
Reporting Tools, Report Manager

Demo: Running Query


Reports
In this activity, you will review the activity overview and:
View reports in the Query Report Viewer.
Schedule Query reports.
Search for reports.
View reports in Report Manager.

Running Reports Using PeopleCode

XML Publisher
Classes
Prepare Data

PSXP_XMLGEN
(XML Generation Classes)

PSXP_RPTDEFNMANAGER
(Report Definition Manager Classes)
Generate and Route
Reports
PSXP_ENGINE
(Engine Classes)

Search Reports
Repository

PSXP_REPORTMGR
(Report Search Classes)

Application
Packages

For importing the XML Publisher classes, PeopleSoft recommends that you
import all the classes in the application package

Class Category

Application Package

Report Manager definition classes

PSXP_RPTDEFNMANAGER

Report search manager classes

PSXP_REPORTMGR

XML generation classes

PSXP_XMLGEN

XML Publisher engine classes

PSXP_ENGINE

Importing Classes
An import statement names either all the classes in a package or one
particular application class.
Your import statements should look like the following:

import
import
import
import

PSXP_RPTDEFNMANAGER:*;
PSXP_REPORTMGR:*;
PSXP_XMLGEN:*;
PSXP_ENGINE:*;

Using the asterisks after the package name makes all the application
classes directly contained in the named package available. Application
classes contained in subpackages of the named package are not made
available.

Publishing a
Report

data for the report.


Process the report.
Publish the reporTo generate and publish a report, the PeopleCode will:
Import the appropriate application class.
Initialize variables.
Instantiate the report definition object and initialize it.
Specify the t.

Sample PeopleCode to
Publish
1.

Import the appropriate application class.

import PSXP_RPTDEFNMANAGER:*;
2.

Initialize the variables.

Local XMLfile &xmlfile;


Local string &rptDefnId = "Financial";
Local string &LangCode = %Language_User;
Local string &effdt = "2004-4-1";
Local string &output = "HTM";
Local String &reportPath = GetEnv("PS_SERVDIR") |
"\files\reports";
Local String &folder = "General";
Local string &serverName = "PSNT";
Local ReportDefn &rptDefn;

Sample
PeopleCode to
Publish
3. Instantiate
the report definition object and initialize it.
(continued)
&rptDefn = Create ReportDefn(&rptDefnId);
&rptDefn.Get();
4. Specify the data for the report.

&rptDefn.SetRuntimeDataXMLfile(&xmlfile);
5. Process the report.

&rptDefn.ProcessReport("", &LangCode, &effdt, &output);


6. Publish the report.

&rptDefn.Publish(&serverName, &reportPath, &folder, 0);

Set Runtime Data


Methods
Report definitions that use a data source other than a PeopleSoft query
must set the data source before generating the report using the
ProcessReport method.
Depending on your data source, you can use one of the following
methods to specify the data:

Data Source

Method syntax

PSQuery

SetPSQueryPromptRecord(&Record)

Connected Query
XML file

SetRuntimeDataXMLFile(FilePath)

ProcessReport
Use the ProcessReport method to generate a report and store the
information.
Syntax

ProcessReport(TemplateId, LangCD, AsOfDate,


OutputFormat)
For example, to process a report in htm format use:

&oRptDefn.ProcessReport("", "", %Date, "HTM");


You can use quotes to take the default value from the report definition.

Publish
Use the Publish method to publish the current report definition
Syntax

Publish(ServerName, ReportPath, FolderName,


ProcessInstanceId))
For example:

&oRptDefn.Publish("", &path, &folder, 0);

Displaying a
Report
You can display a report online using the DisplayOutput method, commit
prior to issuing the DisplayOutput.

/************* Main *************/


&Rowset = GetLevel0();
****** Instantiate report defn and initialize it*****/
&oRptDefn = create PSXP_RPTDEFNMANAGER:ReportDefn(&Rpt);
&oRptDefn.Get();
/**** Specify the data for the report *****/
&oRptDefn.SetRuntimeDataRowset(&Rowset);
/***** process report *****/
&oRptDefn.ProcessReport("", "", %Date, "");
/***** Display the output online *****/
CommitWork();
&oRptDefn.DisplayOutput();

Demo: Running Reports


from PeopleCode
In this demo, we will:
Define the customer XMLDoc-based report.
Complete the PeopleCode.
Run the XMLP reports from a page.

Application Engine
Program
Using the same XML Publisher PeopleCode classes, you can create an
application engine program to run XML Publisher reports.
To run the application engine program through the Process Scheduler, you
will need to:
Create a new Run Control page or associate the application engine
program with an existing Run Control page.
Create a Process Definition.

Example: Application Engine Program to Run XML


Publisher Report
Step: RunCtrl - SQL

%Select(PT_XRFWIN_AET.OPRID,
PT_XRFWIN_AET.RUN_CNTL_ID,
PT_XRFWIN_AET.LANGUAGE_CD)
SELECT OPRID
, RUN_CNTL_ID
, LANGUAGE_CD
FROM %Table(PRCSRUNCNTL)
WHERE OPRID = %OperatorId
AND RUN_CNTL_ID = %RunControl

Example: Application Engine Program to Run XML


Publisher Report
Step ExecRpt PeopleCode
import PSXP_RPTDEFNMANAGER:*;
/* XML Publisher report using query data source */
Local PSXP_RPTDEFNMANAGER:ReportDefn &oRptDefn;
/* create report definition */
&oRptDefn = create PSXP_RPTDEFNMANAGER:ReportDefn("XRFWIN");
&oRptDefn.Get();
/* specify output destination when output type is file */
If %OutDestType = 2 Then /* file */
&oRptDefn.OutDestination = %FilePath;
End-If;

Example: Application Engine Program to Run XML


Publisher Report
continued

/* process report */
&oRptDefn.ProcessReport("", PT_XRFWIN_AET.LANGUAGE_CD,
%Date,
&oRptDefn.GetOutDestFormatString(%OutDestFormat));
/* send output to destination */
If %OutDestType = 6 Then /* Web */
&oRptDefn.Publish("", "", "",
PT_XRFWIN_AET.PROCESS_INSTANCE);
Else
If %OutDestType = 3 Then /* Printer */
&oRptDefn.PrintOutput(%FilePath);
End-If;
End-If;

Process Definition
When you create the process definition use process type XML Publisher.

XML Publisher

Process name is same as


application engine program name

Creating File
Layouts

To create a file layout for XML output:


Create a new file layout.
Insert the records or segments.
Select File, Definition Properties, Use tab.
Select XML for the file output and enter the File Definition Tag.
For records and fields, you can change the tags if desired.
Save the file layout

Sample File
Layout
Multi-level file layout

File layout type

Tag value for root


node

Using File Layout for XML


Publisher Report
The application engine program can create the XML file and then publish
an XMLP report using that data source:

File Layout
Output format XML file

PeopleCode to write file


using File Layout

PeopleCode to publish
report based on XML File
data source

Methods to Write to Files

The File Class contains methods to write to files defined by a file layout
definition:
WriteRecord(record)
WriteRowset(rowset)

PeopleCode to Write XML


File
Local File &MYFILE;
Local Record &recl;
Local SQL &SQL1;
/*** Create an Instance of the record ***/
&recl = CreateRecord(Record.X_EE_RPT_LTR_VW);
/*Create an instance of the file and set File Layout */
&MYFILE = GetFile(" C:\PT8.53\EMPLOYEE_DETAILS.XML ", "A",
%FilePath_Absolute);
&MYFILE.SetFileLayout(FileLayout.XML_FILE_FL);
/* Create SQL object to retrieve the values */
&SQL1 = CreateSQL("%selectall(:1)", &recl);
/* Loop through the record and write the record to file */
While &SQL1.Fetch(&recl)
&MYFILE.WriteRecord(&rec1);
End-While;
/* Close the file */
&MYFILE.Close();

Demo: Running XMLP Report from Application


Engine Program
In this demo, we will:
Create a new data source.
Create a new template.
Define the report definition.
Create the application engine program.
Run XMLP report from an application engine program

Review
In this lesson, you learned that:
XML Publisher reports that have a data source of PS Query can be
selected and viewed using the Query Report Viewer.
The Query Report scheduler page can be used to schedule XML
Publisher Reports with a data source of PS Query.
You can view XML Publisher reports using XMLP Report Search or
Report Manager.
The XML Publisher classes enable you to access the runtime portions
of the XML publishing process programmatically, that is, after the
templates and reports have been created.
The XML Publisher classes can be used in application engine programs
to publish XML Publisher reports.

PDF Template
Reports are pre rendered PDF forms that are populated with data at runtime.
Starting in PeopleTools 8.50 nested structures are supported..
This template type is suitable when you have existing PDF forms that you need
to use to generate reports, such as government forms.
Generally, using this template type is faster than using RTF templates because
no runtime rendering is involved.
Use PDF templates when:
You already have PDF templates that you must use (for example, government
forms).
You have simple form-based reporting requirements with no complex formatting,
that is, no charting, dynamic tables, dynamic repeated fields, and so forth.

PDF Template
PDF templates do not require an external plug-in for offline template design.
A mapping feature for XML data element tags is enabled when the PDF template
file is uploaded to the Reporting Tools, BI Publisher, Report Definition, Template
page. The BI Publisher PDF mapping functionality enables you to match existing
form fields in a PDF template with sample data field tags
.
You only need to do mapping, if the form field names in the PDF template do not
match the tag names in the XML data. This is usually the case when you are
using a third-party PDF template (such as government form) and when it is not
easy to customize the tag names in XML data to match the PDF form fields.

PDF Template
Guidelines when working with PDF templates :
The PDF document must allow editing.
Check the Security setting in the File, Document Properties, Summary page.
Files must be Adobe Acrobat 5.0-compatible.
If you are using a later version of Adobe Acrobat, select File (or Document
depending on the version of Adobe), Reduce File Size and select the Acrobat 5.0
and later value in the Make Compatible with: option.
Files must have form fields for the placement of application data, with each field
tag being unique.
If no form fields exist, use the Adobe Professional version to add field tags. If
duplicate tags or non unique tags are in forms obtained from third parties, use
Adobe Professional to update the tags.
Files should not have embedded java script.
BI Publisher removes it during the course of the Map Enablement function when
the Generate button on the Reporting Tools, BI Publisher, Report Definition,
Template page is selected.

Additional Setup in BI Publisher

Changing Default Template Font


The output report from RTF template uses template-level default fonts for empty
report spaces and empty table cells. If the default font size does not match the
font height used in a template, a final report could look different from user
expectations. In this case, the user can change the template default font either in
design time or runtime:
Design time
Set the xdo.cfg for the font. For example, set the default font for a specific report
to be
Helvetica, size 8:
<property name="rtf-output-default-font">Helvetica:8</property>
Runtime
Use PeopleCode to set the font. For example, set the default font for a specific report to be
Times New Roman with height 10:
&asPropName = CreateArrayRept("", 0);
&asPropValue = CreateArrayRept("", 0);
&asPropName.Push(""rtf-output-default-font");
&asPropValue.Push(""Times New Roman:10");
&oRptDefn.SetRuntimeProperties(&asPropName, &asPropValue);

BI Publisher Security
Activity

Security
Settings

Query-based
reports
(Non-Bursted)

Query-based
reports
(Bursted)

Non-Querybased reports
(Non-Bursted)

Non-Querybased reports
(Bursted)

Running
Reports

Query Security X

NA

NA

Running
Reports

Application
Security

Running
Reports

Process
Scheduler
Security

Report
Viewing Report
Definition,
Definitions
Security page

Report
Viewing Report
Definition,
Definitions
Bursting page

NA

NA

Using Additional RTF Techniques

Using Drilling URL in RTF Template


Drilling URLs are supported in BI Publisher reports with a data source of
PS Query or Connected Query.
Create the query with the drilling URL defined as a field.
Create an RTF template.
In the RTF template map one or more fields to the fields that contain drilling URL.
Highlight the field where you want to place the drilling URL.
Select Insert (from the Word menu), Hyperlink or use Ctrl+K.
In the Insert Hyperlink dialog box, enter the URL link in Address field.
Each URL link should be defined as {URL_FIELD}, where URL_FIELD is the
unique field name for the expression that contains a specific drilling URL.
Use the Target Frame push button to select how this URL link will be opened,
either in the same window or in the new window

Using Drilling URL in RTF Template


If the BI Publisher report is run in Process Scheduler using an application engine
program, you will need to add additional code to identify the process instance for
the application engine program before processing the report. The process
instance can be retrieved from the state record PSXPQRYRPT_AET. This call is
needed to set a drilling URL during Query or Connected Query execution.
&ProcessInstance=PSXPQRYRPT_AET.PROCESS_INSTANCE;
&oRptDefn.ProcessInstance = &ProcessInstance; &oRptDefn.ProcessReport("",
"", %Date, "");
When you click the drilling URL in the report depending on the drilling URL type,
one of the following occurs:
For Query URL, the Query results are displayed.
For Component URL, the appropriate PeopleSoft page is opened.
For External URL, the external page is opened

Incorporating Data Created with Rich


Text Editor (RTE) into Template
The data entered in an RTE (Rich Text Enabled) long edit field is stored
in the PeopleSoft database as formatted HTML data. BI Publisher
reports are now capable of displaying this HTML formatted data in the
output report without requiring any special conversion, as had been
required in previous PeopleTools releases 8.52/8.53. The Oracle BI
Publisher core engine now natively supports the use of HTML formatted
data fields in an RTF report template.

Requirements for Reports Using RTE


Fields
1. User data must be input using the RTE Tool supplied by PeopleSoft.
2. Report needs to use an RTF template.
3. The following form field syntax should be applied for all RTE formatted
data fields in the RTF template:
<?html2fo:elementname?>
where elementname is the XML element that contains the RTE field data.
4. The RTE formatted data field should be enclosed in a CDATA section in
the XML file.
In an XML file generated from Query/Connected data source, the character
fields are always enclosed in CDATA..
5. Images are not supported in the HTML data..

Configuring RTE on Page for BI Reporting


In order to use rich text in a BI Report, the rich text must be entered from a
Rich Text long edit box on a PeopleSoft page.
PeopleSoft delivers a configuration file PT_RTE_CFG_PTXP that hides the
Image buttons in the RTE toolbar.
To enable rich text editor functionality for the long edit box:
1. Add the long edit box to a page.
2. Double-click the control.
Alternatively, you can highlight the control and select Page Field Properties
from the Edit menu or the pop-up menu, which is activated by right clicking
the control.
3. Access the Options tab and select Enable Rich Text Editor.
4. Select the Configuration Setting Id PT_RTE_CFG_PTXP or any other
configuration file that hides the Image buttons.

To enable rich text editor functionality for the


long edit box:
1. Add the long edit box to a page.
2. Double-click the control.
3. Access the Options tab and select Enable Rich Text Editor.
4. Select the Configuration Setting Id PT_RTE_CFG_PTXP or any other
configuration file that hides Special Character and Image buttons.

Using CDATA in an XML File Generated Through XML


File Layout
Utilizing BI Publishers built-in support for Rich Text data (using html2fo function in form field) requires the use of CDATA
sections for RTE data elements in an XML file. However, when using XML File Layout to create the XML file, there is
currently no native support for creating these CDATA sections. As a result, the CDATA sections should be added manually
prior to writing the XML file.
For illustrates how to manually add the CDATA sections, Bellow is the Sample People Code :
Local Record &Rec;
Local File &fXML;
Local SQL &SQL;
&fXML = GetFile("c:\temp\QE_APPLICANT2.xml", "W", "UTF-8", %FilePath_Absolute);
If &fXML.IsOpen Then
If &fXML.SetFileLayout(FileLayout.QE_APPLICANT) Then
&Rec = CreateRecord(Record.QE_APPL_RESUME);
&SQL = CreateSQL("%Selectall(:1)", &Rec);
While &SQL.Fetch(&Rec)
rem &fXML.WriteRecord(&Rec);
&fXML.WriteLine("<QE_APPL_RESUME>");
&fXML.WriteString("<IDENTIFIER>");
&fXML.WriteString(&Rec.IDENTIFIER.Value);
&fXML.WriteString("</IDENTIFIER>");
&fXML.WriteString("<QE_RESUME_TEXT><![CDATA[");
&fXML.WriteString(&Rec.QE_RESUME_TEXT.Value);
&fXML.WriteString("]]></QE_RESUME_TEXT>");
&fXML.WriteLine("</QE_APPL_RESUME>");
End-While;
End-If;
End-If;

Migrating BIP Definitions


The following definition types can be added to projects in Application
Designer:
BIP Data Source Definitions
BIP File Definitions
BIP Report Definitions
BIP Template Definitions
If the data source for the BIP report is PS Query or Connected Query, then
the query or connected query definition should also be included in the
project.

Cleaning Up BI Publisher Metadata


To ensure the integrity of the BI Publisher files, run the application
engine program PSXPCLEAN.
This application engine program finds:
Unreferenced objects in PSFILEDEFN.
Template definitions and template translations for which file objects are
missing.
Inconsistencies between PSFILEDEFN and PSFILEDATA.
This application engine program is delivered in Report and Delete mode.
To run the program in Report Only mode, open the application engine
program PSXPCLEAN in Application Designer and remove the comment
in the following statement in PSXPCLEAN:Main:Start PeopleCode
action:
rem PSXPFILECLN_AET.REPORT_ONLY_FLAG = "Y"

S-ar putea să vă placă și