D54122

450
Oracle BI Publisher 10g R3: Fundamentals Student Guide D53147GC10 Edition 1.0 February 2008 D54122 ®

Transcript of D54122

Page 1: D54122

Oracle BI Publisher 10g R3: Fundamentals

Student Guide

D53147GC10

Edition 1.0

February 2008

D54122

®

Page 2: D54122

Copyright © 2008, Oracle. All rights reserved.

Disclaimer

This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle.

The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free.

Restricted Rights Notice

If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTSThe U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.

Trademark Notice

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

AuthorsPadmaja MitravindaBrian Pottle

Technical Contributors and ReviewersLeta DavisTim DexterMike DonahueTim McGlueNickos PsomasPradeep SharmaKasturi ShekharJason Stoddart

EditorsDaniel MilneSusan MoxleyNita Pavitran

Graphic DesignersSatish BettegowdaRajiv Chandrabhanu

PublishersSrividya RameshkumarGiri Venugopal

Page 3: D54122

iii

Contents Preface

1 Introduction to Oracle BI Publisher

Course Objectives 1-2 Lesson Objectives 1-3 Course Agenda: Day 1 1-4 Course Agenda: Day 2 1-5 Course Agenda: Day 3 1-6 Oracle BI Publisher: Business Document Requirements 1-7 Functions of Reporting Systems 1-8 Classic Reporting Tools Paradigm 1-9 Oracle BI Publisher Paradigm 1-10 End-to-End View of BI Publisher 1-11 Salient Features of BI Publisher 1-12 Summary 1-13

2 Oracle BI Publisher: Technology and Architecture Objectives 2-2 Oracle BI Publisher 2-3 Batch Processing 2-4 Distributed Delivery 2-5 Report Bursting 2-6 Inbound Document Capture 2-7 Government Forms 2-8 BI Publisher Multitier Architecture 2-9 BI Publisher Desktop 2-10 BI Publisher Layout Templates 2-11 BI Publisher Enterprise Server Architecture 2-12 BI Publisher Process Architecture 2-13 Data Sources 2-14 BI Publisher Data Engine 2-15 Oracle BI Publisher Underlying Technology 2-16 Performance and Scalability 2-17 Security 2-18 Internationalization and Language Support 2-19 Translation 2-20

Page 4: D54122

iv

Output Formats 2-21 Flexible Deployment Options 2-22 Oracle BI Publisher for Applications 2-23 Summary 2-24

3 Introduction to XML Standards Objectives 3-2 XML Standards 3-3 Extensible Markup Language 3-4 Advantages of Using XML 3-5 Oracle XML Support 3-6 Example: A Simple XML Page 3-7 XML Document Structure 3-8 XML Declaration 3-9 Components of an XML Document 3-10 XML Elements 3-11 Markup Rules for Elements 3-12 XML Attributes 3-13 Using Elements Versus Attributes 3-14 XML Entities 3-15 XML Comments 3-16 A Well-Formed XML Document 3-17 Class Activity 3-18 Comparing XML and HTML 3-19 XML Development 3-20 XML Namespaces 3-21 XML Namespace Declarations: Example 3-23 Why Validate an XML Document? 3-24 Document Type Definition 3-25 Simple DTD Declaration: Example 3-26 XML Schema 3-27 XML Schema Document: Example 3-29 XML Schema Versus DTD 3-30 XML Path Language 3-31 XPath Model 3-32 XSLT and XPath 3-33 XSL 3-34 XSLT 3-35 XSLT Style Sheet 3-36 XSLT Style Sheet: Example 3-37 Viewing the Transformed Document 3-38

Page 5: D54122

v

Summary 3-39 Practice 3: Overview 3-40

4 Getting Started with BI Publisher: Creating a Simple Report Objectives 4-2 Sample Schemas in Oracle Database 4-3 Human Resources (HR) Data Model 4-4 Order Entry (OE) Data Model 4-5 Logging In to Oracle BI Publisher 4-7 Opening a Predefined Report 4-8 Viewing a Predefined Report 4-9 Setting Preferences 4-10 Creating a BI Publisher Report Based on Oracle Database 4-12 Defining a JDBC Connection 4-13 Creating a New Folder in BI Publisher 4-15 Creating a Report 4-16 Editing the Properties of a Report 4-17 Defining the Data Model 4-18 Using Query Builder 4-19 Viewing Report Data 4-21 Uploading an Existing Template 4-22 Exporting or Downloading a Report 4-24 Summary 4-25 Practice 4: Overview 4-26

5 Creating Simple RTF Templates Objectives 5-2 Introduction to Oracle BI Publisher Desktop 5-3 Installing Oracle BI Publisher Desktop 5-4 BI Publisher Desktop User Interface (UI) 5-6 BI Publisher Toolbar 5-8 BI Publisher Toolbar: Tools 5-10 Setting Build Preferences 5-11 Build Options 5-12 BI Publisher Toolbar: Wizards 5-13 Creating an RTF Template from a Sample 5-15 Creating an RTF Template: Loading the Sample XML Data 5-16 Creating an RTF Template: Inserting Fields 5-17 Creating an RTF Template: Previewing Data 5-19 Creating an RTF Template: Inserting a Table 5-20 Selecting Data Fields 5-21

Page 6: D54122

vi

Removing Selected Fields 5-22 Completing the Table 5-23 Resulting Table 5-25 Changing Field Properties 5-26 Previewing the Table Data 5-27 Practice 5-1: Overview 5-28 BI Publisher Charts 5-29 Creating an RTF Template: Inserting a Chart 5-30 Defining a Chart 5-32 Previewing the Chart 5-33 Practice 5-2: Overview 5-34 Designing an RTF Template for a BI Publisher Report 5-35 Step 1: Open MS Word and Log In to BI Publisher 5-36 Step 2: Open the BI Publisher Report 5-37 Step 3: Define the RTF Template: Add a Table 5-38 Form Fields in RTF Templates 5-39 Step 3: Define the RTF Template: Add a Chart 5-40 Step 4: Preview the Data by Using the Template 5-41 Step 5: Upload the Template and View Data 5-42 Practice 5-5: Overview 5-43 Methods for Creating RTF Templates 5-44 Basic Method: Example 5-45 Form Field Method: Example 5-46 Form Field Method: Creating a Data Table 5-47 Completed Template 5-48 Previewing the Report 5-49 Practices 5-3, 5-4: Overview 5-50 Summary 5-51 Practice 5: Overview 5-52

6 Advanced RTF Template Techniques Objectives 6-2 Know Your Data 6-3 Looking at Raw XML Data 6-4 Looking at the Data Structure in Oracle BI Publisher Desktop 6-5 Underlying Tags 6-6 Form Field Method Tags 6-7 Additional Tag Space 6-8 RTF Template: Design Considerations 6-9 Supported MS Word Native Formatting Features 6-10 Adding Markup 6-11

Page 7: D54122

vii

Images and Charts 6-14 Adding a Chart 6-16 Support for Drawings and Shapes 6-17 Other Graphic Features 6-18 Data-Driven Shape Support 6-19 Background and Watermark Support 6-22 Using More Advanced Template Features 6-23 Some More Advanced Template Features 6-27 Conditional Formatting 6-28 Conditional Formats in BI Publisher Desktop 6-32 Page-Level Calculations 6-33 Data Handling 6-36 Variables, Parameters, and Properties 6-37 Advanced Design Options 6-40 Cross-Tab Wizard in BI Publisher Desktop 6-43 Summary 6-44 Practice 6: Overview 6-45

7 Creating Parameters, List of Values (LOVs), and Hyperlinks Objectives 7-2 Reports with Parameters and a List of Values (LOVs) 7-3 Adding a Parameter to a BI Publisher Report 7-5 Modifying a Report to Include the Parameter 7-6 Viewing the Report Data 7-7 Creating a List of Values and Associating It with a Parameter 7-8 Cascading Parameters 7-10 BI Publisher Reports with Hyperlinks 7-11 Creating a Report with a Hyperlink: Example 7-12 Creating a Master Report 7-13 Creating an RTF Template for the Master Report 7-14 Creating and Editing a Detail Report 7-15 Defining a Hyperlink 7-17 Defining a Dynamic Hyperlink 7-18 Viewing the Report Data 7-19 Summary 7-20 Practice 7: Overview 7-21

8 Working with PDF and eText Templates Objectives 8-2 PDF Template Overview 8-3 Supported Modes 8-4

Page 8: D54122

viii

Adding Markup to the Template Layout for Adobe Acrobat Users 8-5 Accessing the Text Field Tool in Adobe Acrobat 8-6 Creating a Text Field in Adobe Acrobat 8-7 Supported Field Properties Options 8-8 Creating a Check Box 8-9 Creating a Radio Button Group 8-10 Defining Groups of Repeating Fields 8-11 Adding Page Numbers 8-13 Adding Page Breaks 8-14 Performing Calculations 8-15 Run-Time Behavior 8-16 Downloaded PDFs 8-17 Using Downloaded PDFs with Form Fields 8-18 Running Reports with PDF Templates: Define Data Model 8-19 Running Reports with PDF Templates: Upload Template 8-20 Running Reports with PDF Templates: View Report 8-21 eText Templates 8-22 Structure of eText Templates 8-24 Row Types 8-25 Setup Command Tables 8-26 Constructing Data Tables 8-27 Command Rows 8-28 Structure of Data Rows 8-30 Using Template Viewer 8-32 Viewing an eText Template 8-33 Viewing the Output 8-34 Summarizing eText Templates 8-35 Summary 8-36

9 Oracle BI Publisher Server: Administration Objectives 9-2 Administration Options 9-3 Logging In to BI Publisher Server 9-4 BI Publisher Home Page 9-5 Administration Settings 9-6 Data Sources 9-7 Setting Data Sources: JDBC 9-8 Testing the JDBC Connection 9-9 Setting Data Sources: JNDI 9-10 Setting Data Sources: Files 9-11 Viewing or Updating a Data Source 9-12

Page 9: D54122

ix

BI Publisher: Supported Security Models 9-13 BI Publisher Security Model: Security Center 9-14 Users and Roles 9-15 Functional Roles 9-16 Setting Up Users, Roles, and Permissions 9-17 Setting Up Roles and Permissions 9-18 Delivery Options 9-20 Setting Up Delivery Options: Configuration 9-21 Setting Up Delivery Options: Printer 9-22 Setting Up Delivery Options: Fax 9-24 Setting Up Delivery Options: WebDAV 9-25 Setting Up Delivery Options: Email or FTP 9-26 System Maintenance 9-27 Defining Report Repository 9-28 Server Configuration 9-29 Scheduler Configuration 9-31 Refreshing the Metadata 9-32 Integration with BI Products 9-33 Summary 9-34 Practice 9: Overview 9-35

10 Scheduling Reports and Analyzing Data Objectives 10-2 Scheduling BI Publisher Reports 10-3 Configuring BI Publisher Scheduler 10-4 Scheduling a Report 10-5 Viewing the Saved Output and History 10-7 Managing Scheduled Reports 10-8 Scheduling Reports with Advanced Options 10-9 Scheduling a Report to be Delivered as an Email Attachment 10-10 Bursting a Report 10-12 Scheduling a Report to Burst to a File Location 10-13 Step1: Creating a Report with Appropriate Fields 10-14 Step 2: Uploading an RTF Template for the Report 10-16 Step 3: Defining Bursting Properties for the Report 10-17 Step 4: Scheduling the Report to Burst to a File Location 10-19 Step 5: Viewing the Schedule and the Report 10-20 Scheduling a Report to Be Burst as Email 10-21 Analyzing Data in Reports 10-23 Using Online Analyzer 10-24 Excel Analyzer 10-25

Page 10: D54122

x

Using Excel Analyzer 10-26 Using Excel Analyzer: BI Publisher Menu and Toolbar 10-27 Summary 10-29 Practice 10: Overview 10-30

11 Translating Reports Objectives 11-2 Translations: Types and Options 11-3 Localized Template Option 11-4 XLIFF File Option 11-5 Structure of the XLIFF File 11-6 Updating the XLIFF File 11-7 Naming Standards 11-8 Locale Selection Logic 11-10 Translating Templates in BI Publisher Desktop 11-12 Report File Translations 11-13 Generating XLIFF in BI Publisher Enterprise 11-14 Saving the XLIFF File 11-15 Uploading the XLIFF File 11-16 Summary 11-17

12 Creating Reports by Defining XML Data Templates Objectives 12-2 XML Data Template 12-3 Data Extraction Engine 12-4 What Functionality Is Supported? 12-5 Supported Functionality 12-6 Report Migration 12-7 Data Template Definition 12-8 Data Template Structure Diagram 12-9 Data Template Declaration 12-11 Defining Parameters 12-12 Defining Queries 12-14 Data Query 12-15 Example: Data Query 12-17 Defining a Data Link Between Queries 12-18 Query Linking Options 12-19 Query Linking: Bind Variable Example 12-20 Query Linking: <link> Tag Example 12-21 Distributed Queries 12-22 Data Triggers 12-23

Page 11: D54122

xi

Using Data Triggers 12-24 Data Structure Section 12-25 Data Structure: Example 12-26 Creating an XML Data Template 12-27 Viewing the XML Data 12-28 Associating the XML Data Template With an RTF Template 12-29 Viewing the Report 12-30 Summary 12-31 Practice 12: Overview 12-32

13 Oracle BI Publisher Integration Features Objectives 13-2 Oracle BI Publisher Integration 13-3 Creating a BI Publisher Report from an Answers Request by Using BI

Publisher Enterprise 13-4 1. Creating a BI Publisher Report 13-5 2. Specifying a BI Answers Data Set for the Report 13-6 3. Associating an Existing Template with the Report 13-7 4. Viewing the Report 13-8 Creating a BI Publisher Report from an Answers Request by Using BI Publisher

Desktop 13-9 1. Logging In to BI Publisher from the Template Builder for Word 13-10 2. Selecting an Answers Request as the Data Source and Saving It as a

BI Publisher Report 13-11 3. Creating a Template 13-12 4. Uploading the Template 13-13 5. Viewing the Report 13-14 Creating a BI Publisher Report from the BI Server 13-15 1. Creating a Report that Queries the BI Server Metadata 13-16 2. Building the Query by Using the Query Builder 13-17 3. Associating an Existing Template with the Request and Viewing the Report 13-20 Creating a BI Publisher Report from the Discoverer Worksheet Content 13-21 Discoverer Worksheet 13-22 1. Logging In to BI Publisher 13-23 2a. Selecting Discoverer and a Public Connection 13-24 2b. Selecting a Discoverer Worksheet 13-25 2c. Saving the Worksheet as a BI Publisher Report 13-26 3a. Creating a Template for the Report 13-27 3b. Modifying the Template 13-28 4. Previewing the Report Output 13-29 5. Uploading the Template 13-30

Page 12: D54122

xii

Viewing the Report in BI Publisher Enterprise 13-31 Adding BI Publisher Reports to Interactive Dashboards 13-32 Summary 13-33 Practice 13: Overview 13-34

14 Creating Reports Based on Other Data Sources Objectives 14-2 Data Sources Supported by BI Publisher 14-3 Introduction to Web Services 14-4 XML/RSS Feeds 14-5 Proxy Settings 14-6 Creating a BI Publisher Report Based on Web Services 14-7 Step 1: Creating a Report and Defining the Data Set 14-8 Step 2: Defining a Parameter and Adding It to the Data Set 14-9 Step 3: Viewing the Report XML Data 14-10 Step 4: Viewing the Data by Using a Predefined Template 14-11 Creating a BI Publisher Report Based on RSS Feeds 14-12 Step 1: Creating a Report and Defining the Data Set 14-13 Step 2: Viewing the Report XML Data 14-14 Step 3: Using a Predefined Template to View the Data 14-15 Creating a Report Based on a File 14-16 Step 1: Checking the Demo Files Data Source 14-17 Step 2: Creating a Report and Defining the Data Set 14-18 Step 3: Viewing the XML Data 14-19 Step 4: Using a Sample Template to View the Data 14-20 Summary 14-21 Practice 14: Overview 14-22

Page 13: D54122

Preface

Page 14: D54122
Page 15: D54122

Preface - 3

ProfileHow This Course Is Organized

Oracle BI Publisher 10g R3: Fundamentals is an instructor-led course featuring lectures and hands-on exercises. Online demonstrations and written practice sessions reinforce the concepts and skills.

Page 16: D54122

Preface - 4

Related PublicationsOracle Publications

Title Part NumberOracle Business Intelligence Publisher User's Guide B40017-01(Release 10.1.3.2)

Page 17: D54122

Preface - 5

Typographic ConventionsThe following table lists the typographical conventions that are used in text and code.Typographic Conventions in Text

Convention Object or Term Example

Uppercase Commands, Use the SELECT command to viewfunctions, information stored in the LAST_NAMEcolumn names, column of the EMPLOYEES table.table names,PL/SQL objects,schemas

Lowercase, Filenames, where: role is the name of the role italic syntax variables, to be created.

usernames,passwords

Initial cap Trigger and Assign a When-Validate-Item trigger tobutton names the ORD block.

Select Cancel.

Italic Books, names of For more information on the subject seecourses and Oracle SQL Referencemanuals, and Manualemphasized words or phrases Do not save changes to the database.

Quotation marks Lesson module This subject is covered in Lesson 3,titles referenced “Working with Objects.”within a course

Page 18: D54122

Preface - 6

Typographic Conventions (continued)Typographic Conventions in Code

Convention Object or Term Example

Uppercase Commands, SELECT employee_idfunctions FROM employees;

Lowercase, Syntax variables CREATE ROLE role;italic

Initial cap Forms triggers Form module: ORDTrigger level: S_ITEM.QUANTITYitemTrigger name: When-Validate-Item. . .

Lowercase Column names, . . .table names, OG_ACTIVATE_LAYERfilenames, (OG_GET_LAYER ('prod_pie_layer'))PL/SQL objects . . .

SELECT last_nameFROM employees;

Bold Text that must CREATE USER scottbe entered by a IDENTIFIED BY tiger;user

Page 19: D54122

Copyright © 2008, Oracle. All rights reserved.

Introduction toOracle BI Publisher

Page 20: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 2

Copyright © 2008, Oracle. All rights reserved.

Course Objectives

After completing this course, you should be able to do the following:• Explain the uses of Oracle BI Publisher• Create and use a rich text format (RTF) template• Explain the use of a portable document format (PDF)

template• Set up, configure, and use Oracle BI Publisher Enterprise• Create reports using Extensible Markup Language (XML)• Explore advanced features such as bursting, scheduling,

and email• Explain integration points with other Oracle products

Page 21: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 3

Copyright © 2008, Oracle. All rights reserved.

Lesson Objectives

After completing this lesson, you should be able to do the following:• Understand the course agenda• Explain business document requirements and limitations of

classic reporting tools• Describe the uses of Oracle BI Publisher and its advantages

over classic reporting tools• List the key features of BI Publisher

Page 22: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 4

Copyright © 2008, Oracle. All rights reserved.

Course Agenda: Day 1

1. Introduction to Oracle BI Publisher2. Oracle BI Publisher: Technology and Architecture3. Introduction to XML Standards 4. Creating Simple BI Publisher Reports Based on Oracle

Database 5. Creating RTF Templates Using BI Publisher Desktop

Page 23: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 5

Copyright © 2008, Oracle. All rights reserved.

Course Agenda: Day 2

6. Advanced RTF Template Techniques7. Creating BI Publisher Reports with Parameters, List of

Values (LOVs), and Hyperlinks8. Working with PDF and eText Templates9. Oracle BI Publisher Server: Administration10. Scheduling Reports and Analyzing Data

Page 24: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 6

Copyright © 2008, Oracle. All rights reserved.

Course Agenda: Day 3

11. Translating Reports12. Creating Reports by Defining XML Data Templates13. Oracle BI Publisher Integration Features

(BI Publisher with Oracle BI EE and BI Discoverer)14. Creating BI Publisher Reports Based on Various Data

Sources

Page 25: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 7

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher:Business Document Requirements

• Rich formatted reports• Partner reports• Financial statements• Government forms• Marketing materials• Contracts• Checks• Labels• XML/EFT/EDI• Multiple destinations

Labels

Checks

Reports

Destinations

Invoices

XML/EFT/EDI

Oracle BI Publisher: Business Document RequirementsOracle BI Publisher supports the spectrum of business requirements in the reporting area.

• High fidelity reports: Reports rich in images, charts, multiple fonts, and color are important when reports are to be distributed within and outside the company.

• Partner reports: Invoices, purchase orders, and checks require “rich” content and are currently highly customized.

• Financial statements: Your financial statements need to be presented to shareholders and upper management in a high-fidelity format.

• Government forms: Many government agencies now demand that you interact with themin a specific format (for example, tax forms).

• Marketing materials: Marketing materials generated by companies require rich personalized content.

• Contracts: Interacting with your customers and suppliers often requires written contracts that need to be presented in a high-fidelity format.

• Checks: The checks that you send to employees and suppliers require a specific format (and even ink) so that their banks are able to process them.

• Labels: Companies that make products need to label them (often including a barcode).• XML: B2B interaction requires XML as the format. This may require a transformation

from one XML format to another.• EFT and EDI: Electronic funds transfer (EFT) and electronic data interchange (EDI) are

formats used to communicate with your banks and partners.• Multiple destinations: All these documents then need to be delivered to a report consumer

(via email, fax, or printer).

Page 26: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 8

Copyright © 2008, Oracle. All rights reserved.

Functions of Reporting Systems

Reporting systems share three primary functions:• Author reports

– Business requirements definition– Data logic definition– Layout design

• Manage reports– Translation requirements– Customization needs

• Deliver reports– Publishing requirements (printed, email, Web page)

Functions of Reporting SystemsWhen investing in a reporting system, a company must consider both the capabilities and costs associated with authoring, managing, and delivering required reports.As will be illustrated in the next few slides, classic reporting tools commonly require both an initial high cost in terms of technical resources and training, and ongoing maintenance costs that may not be initially obvious.BI Publisher meets your business needs directly out of the box. You can rapidly deploy it into your environments; it reduces your total cost of ownership and increases the return on your investment as you use the system.

Page 27: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 9

Copyright © 2008, Oracle. All rights reserved.

Classic Reporting Tools Paradigm

Requirements changes

Report files( Each file = Data logic + layout + translation )

Report output

High development costHigh maintenance cost

Classic Reporting Tools ParadigmThe primary disadvantage of classic reporting tools is the high cost of ongoing maintenance.Classic reporting approaches combine data definition (query), layout format, and translation in a single source file. Because of the nature of this file structure, the report developer must create and maintain a separate report definition file for each combination. As the data logic and report format requirements evolve, this leads to large numbers of report files. When you add the required translation, the number of report definitions becomes extremely large.In addition to new reports requirements, companies commonly require customizations to existing reports. In this case, the only option is to take a copy of the base report definition, make the required changes, and add the modified report to the collection of report files. However, if the report development organization upgrades a base report, changes must be propagated through to the customized reports.Finally, the tools used to create these reports are typically complex and require a high level of technical training to be used effectively.These factors lead to ever-increasing complexity, and escalating maintenance and customization costs.

Page 28: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 10

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher Paradigm

Separate data, layout, and UI translation• Flexibility• Reduced maintenance

Data logic

Layout

Translation

Oracle BI Publisher Reportoutput

Oracle BI Publisher ParadigmBI Publisher breaks apart the three report-design components and treats them separately at design time. At run time, the three components are brought together by BI Publisher to generate the final formatted and translated output. There is an immediate gain because this model is far more flexible. That is, a single data definition can support multiple layouts, and multiple translations can be applied at run time to generate translated output. This leads to a reduction in maintenance costs.

Page 29: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 11

Copyright © 2008, Oracle. All rights reserved.

End-to-End View of BI Publisher

BI Publisher

Report templates fordifferent output formats XML

EFT

Excel

HTML

PDF

B2B

Government

CEO

Controller

Banking

EFT

Data sources anda distribution plan

Multiple data sources

End-to-End View of BI PublisherMultiple Data SourcesSupported data sources include any database (or multiple databases), any XML Web service, any XML data server, RSS feeds, and external files.Easy Template CreationReport templates are easily created in familiar desktop tools. With the use of different layout templates, BI Publisher simplifies the reporting architecture for customers. These templates can be used to generate multiple output formats.Extract Once, Publish Multiple TimesBI Publisher has the ability to publish multiple times using the same data source. For instance, a company can generate its payment data in a single data extraction program. From that program, the following can be generated:

• Electronic funds transfer (EFT): They are used to communicate to banks to make payments.

• Excel: Accountants and controllers can enter payment data into Excel for further analysis.• HTML: Payment data can be published to a company portal via HTML.• PDF: Government reporting requires the PDF format for communication.• XML: For B2B communication, XML is quickly becoming the de facto standard.

Page 30: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 12

Copyright © 2008, Oracle. All rights reserved.

Salient Features of BI Publisher

• Offers support for multiple data sources• Enables rapid deployment

– Business consultants use familiar desktop tools for layout customization.

– This increases developer productivity.• Offers support for multiple output formats• Reduces complexity• Reduces total cost, including maintenance• Enables flexible customization• Follows Oracle development standards• Enables ease of use

Page 31: D54122

Oracle BI Publisher 10g R3: Fundamentals 1 - 13

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned to:• Describe business document requirements and limitations of

classic reporting tools• Describe the uses of Oracle BI Publisher and its advantages

over classic reporting tools• Describe the key features of BI Publisher

Page 32: D54122
Page 33: D54122

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher:Technology and Architecture

Page 34: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to describe thefollowing elements of Oracle BI Publisher:• Components• Architecture• Technology

Page 35: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 3

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher

Oracle BI Publisher is a Java-based product that is available with:• Oracle BI Server• Oracle Applications products, including E-Business Suite,

PeopleSoft, and JD EdwardsBI Publisher provides users with: • A template-based, easy-to-use publishing solution• A tool to rapidly develop and maintain report formats

Oracle BI PublisherOracle BI Publisher is a new Java-based product that is available with both Oracle BI Server and Oracle Applications products. It is an easy-to-use, template-based publishing solution that enables customers to rapidly develop and maintain report formats.BI Publisher is built on standard, well-known technologies such as XML, and enables customers to take advantage of familiar tools such as Microsoft Word and Adobe Acrobat.Oracle BI Publisher consists of:

• A library of APIs• An integrated architecture with Oracle Applications products, Oracle BI EE, and Oracle BI

Discoverer • A reporting tool providing “rich” output options • A user-friendly solution that provides control of the report design layout to the customer to

decrease the overall costs associated with customization and maintenance

Page 36: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 4

Copyright © 2008, Oracle. All rights reserved.

Web Services

PeopleSoft,SAP, Siebel

Batch Processing

EDI

EFT

PDF

RTF

HTML

ExcelBI Publisher

Data sources

Templates

• Word• Excel• Acrobat

Layout tools

• XML Spy• JDeveloper• Scriptura

Email

Printer

Fax

WebDAV

E-commerceXML

Output Destinations

Batch ProcessingBI Publisher can process batch jobs of data from extraction to delivery.A single file format can describe the data, the template, and the destination of individual jobs. This information is passed to the BI Publisher batch processor, and documents are generated and delivered.

Page 37: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 5

Copyright © 2008, Oracle. All rights reserved.

Distributed Delivery

Firewall

Printer

Email WebDAV

Printer

SupportedProtocolsIPP, HTTP,

SMTP, WebDAV,FTP, AS2

Oracle BI PublisherDelivery Manager

Printer

Linux/NTServer

Linux/NTServer

Printer

Fax

Distributed DeliveryThe master delivery manager can dispatch delivery requests to remote delivery servers via IPP and Web services.

Page 38: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 6

Copyright © 2008, Oracle. All rights reserved.

Report Bursting

Multiple data sources anda distribution planin one XML file

Oracle BI Publisher

Templates

XML

EDIHTML

PDF

PDF

Report BurstingBursting is an important and useful feature of BI Publisher. It enables you to split a single report based on a key in the report data and deliver the report based on a second key in the report data.For example, the salary report of employees can be split by department, but can be delivered to employees by using the delivery key of employee ID. Driven by the delivery key, you can apply a different template, output format, delivery method, and locale to each split segment of your report.

Page 39: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 7

Copyright © 2008, Oracle. All rights reserved.

Inbound Document Capture

BI Publisher

XML

EFT

Excel

MSWord

PDF

B2B

Government

Controller

Banking

EFT

Supplier

Application data

Inbound documents converted to XML and fed back to the database

Inbound Document CaptureIn addition to report creation and delivery, BI Publisher can receive inbound documents and convert them to XML, which is fed back to the database.

Page 40: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 8

Copyright © 2008, Oracle. All rights reserved.

Government Forms

Download PDF forms from the government Web site.Return the exact form filled with data.

Business data:• Human Resources • Procurement

Government

Oracle BI Publisher

Human Resources:• W2, W4• 1099

Procurement:• sf26, sf33, sf1449• OF347

PDF

Government

Government FormsBI Publisher provides a closed-loop process for downloading government forms and delivering the required information to the appropriate agency.

Page 41: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 9

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Multitier Architecture

BrowserOracle BI Publisher Desktop• MS Word• MS Excel• Adobe Acrobat

Oracle BI Publisher Enterprise

Client Middle tier Database

Oracle DatabaseOthers:• SQL Server• DB2• MySQL• Sybase

BI Publisher Multitier ArchitectureClient software:

• JAVA-enabled browser• Oracle BI Publisher desktop• MS Word• Ms Excel• Adobe Acrobat

Middle-tier software:Report management provided by Oracle BI Publisher Enterprise, which is integrated with:

• Oracle BI Enterprise Edition• Oracle Applications products, including E-Business Suite, PeopleSoft, and JD Edwards

Database software:BI Publisher supports Oracle database and other types of databases.

Page 42: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 10

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Desktop

Functional user’s tools:Users can create reports and preview results by using familiar desktop applications:• Oracle BI Publisher for Word• Oracle BI Publisher for Excel• PDF editors

BI Publisher DesktopOracle BI Publisher provides add-ins to two familiar desktop applications: Word and Excel.BI Publisher report formats can be designed by using tools that most users are already familiar with. Templates for BI Publisher reports are created by using Microsoft Word or Adobe Acrobat. There are no proprietary design studio components required; that is, no extra cost and no extra learning curve. BI Publisher content can also be viewed and analyzed in Excel.Preview Report OutputAfter a report template is created, you can preview the report output from within the desktop application to determine whether the report is ready for upload to BI Publisher Enterprise.

Page 43: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 11

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Layout Templates

R T F

P D F

X L S

X S L

• Industry-standard templates• Desktop applications:

– Adobe Acrobat– MS Word– MS Excel– XSL editors

• Oracle BI Publisher Desktop Template Builder add-ins

BI Publisher Layout TemplatesAs mentioned previously, users can design layout templates by using familiar desktop applications such as Adobe Acrobat and Microsoft Word. A Template Builder toolbar, which is added to the desktop application interface, enables quick and easy creation of industry-standard report templates.In addition, users can take advantage of XSL editors available on the market.

Page 44: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 12

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Enterprise Server Architecture

Printer, fax, email,WebDAV, FTP, B2B

Delivery channels

PDF, HTML, RTF, Flash Excel, EFT, EDI, XML, PS

Output formats

Data extraction Layoutrendering

Security Scheduling/Archiving

Core engine

Report repository

Report repositoryOracle DB or file system

Scheduling and archivingAny DB: Oracle, DB2, SQL Server, …

Oracle DB, Oracle BI EE, SQL

Server, DB2, … JDBC

Design data models. Administer the server.

Company portal, SAP, MSFT CRM, Oracle EBS-PSFT-JDE-CRM

Data sources

View and schedule reports. Office integration.

Build report layouts.

SecuritySSO, OID, LDAP, Oracle BI, EBS, JNDI interface

Web services interfaceDHTML - AJAX interface

J2EE Container: Oracle, WebSphere, BEA, Tomcat, ...

Caching services

Documentdelivery

BI Publisher Enterprise Server ArchitectureOracle BI Publisher Enterprise provides the following features and benefits:Oracle BI Publisher Embedded: Custom development

• Powerful formatting engines• High-performance data extraction engine• Batch processing and bursting • Delivery API for email, fax, printing, FTP, and AS2• Based on open standards: Java, XML, XSL-FO, RTF, PDF

Oracle BI Publisher Enterprise• Easy and fast deployment• Any J2EE container • Configure repository on XML DB or file system• Data from multiple databases in the same report (Oracle, DB2, and others)• Multiple output formats and multiple delivery options• Document repository, scheduling, archiving• Database and application server independent• Advanced security and administrative options• Pluggable services, Web service APIs

Page 45: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 13

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Process Architecture

Data

XML

Template

Deliveryserver

Destination

Translation

Document

XLIFF

XSL

XML

Variousformats

Translationcatalogs

Datahandler

Template manager

Translation handler

PDF Word XSL

BI Publisher Process ArchitectureOracle BI Publisher is made up of five modules:

• Data Handler: Data engines are registered with the Data Handler. It can be any XML source or any engine that generates XML (such as Oracle Reports).

• Template Manager: Template Manager is a friendly user interface that is built over a collection of APIs that enables customers to register and maintain their data definitions and templates. Layout templates to be used for the final output are stored and managed in Template Manager. Templates are created by using familiar desktop tools such as Word, Excel, and Acrobat.

• Document Processor: With the Document Processor, a user can build a single document from multiple data source and template combinations, or create individual documents for each combination. Passing XML that contains multiple data sources and templates to Oracle BI Publisher results in the generation of multiple output documents.

• Translation Handler: Translation Handler provides users with the ability to register and maintain data definitions and templates in a friendly user interface.

• Delivery Server: Delivery Server takes the output document and delivers it to the printer.

Page 46: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 14

Copyright © 2008, Oracle. All rights reserved.

Data Sources

• Any database or multiple databases– Distributed queries– Oracle BI Publisher Data Engine

• Any enterprise resource planning (ERP) system• Any XML data server

– Oracle Reports– DB packages in SQL or XML

• Any XML Web service

Web services

Oracle, SQL Server, DB2

PeopleSoft,SAP, Siebel

Java, C++,PERL, etc

Data SourcesData Sources include Oracle, SQL Server, DB2, MySQL, Sybase, Web services, HTTP, JDBC, Oracle BI Enterprise Edition, and Oracle BI Discoverer.Data can be extracted from multiple databases and applications. It may also be extracted from external systems by the BI Publisher extraction engine. These data sets can be merged either as sequential XML or merged at the line level effectively by running a query across the data sources to create a single combined hierarchical data set.

Page 47: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 15

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Data Engine

Printer, fax, email,WebDAV, FTP, B2B

Delivery channels

PDF, HTML, RTF, Flash, Excel, EFT, EDI, XML, PS

Output formats

Data extraction Layoutrendering

Security Scheduling/Archiving

Core engine

Report repository

Oracle DB, Oracle BI EE, SQL

Server, DB2, …JDBC

Data sources

Web services interfaceDHTML - AJAX interface

Caching services

Documentdelivery

BI Publisher Data EngineThe BI Publisher Data Engine provides the following:

• Fast, scalable extraction engine• Migration tools available from Oracle Reports• Offers all that Oracle Reports offers (30% to 40% faster)

- Multiple queries and joins- Event triggers- Java API layer for Oracle Applications Framework (OAF) support- Data bursting (5.6.1)- Distributed queries (5.6.1)

Page 48: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 16

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher Underlying Technology

Open-standard technologies:• W3C XSL: FO implementation• Pure Java• Pluggable data in XML• Output formats in PDF, RTF, and HTML• Support for Internet Printing Protocol, WebDAV, Internet Fax

Protocol, and Simple Mail Transfer Protocol (SMTP)

Oracle BI Publisher Underlying TechnologyThe underlying technology is based on an implementation of the W3C XSL-FO standard. BI Publisher also provides improved performance, added security, and extensions to the FO standard to support more complex reporting requirements.

Page 49: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 17

Copyright © 2008, Oracle. All rights reserved.

Performance and Scalability

Stream-based implementation:• Reduces memory footprint• Handles large XML input files• Is the fastest XSL-FO implementation

Performance and ScalabilityThe XSL-FO engine is not only robust but also fast. This is vital because XML data by its nature generates large objects and files, and these can cause serious memory issues during processing. BI Publisher has a stream-based implementation that reduces this memory footprint, therebyenabling large XML input files to be processed.

Page 50: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 18

Copyright © 2008, Oracle. All rights reserved.

Security

• Printing from MS Excel is not accepted by financial auditors.• PDF security levels for:

– Read-only text– Editable text– “Copyable” text– Printable text– Password-protecting text

Page 51: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 19

Copyright © 2008, Oracle. All rights reserved.

Internationalization and Language Support

• No need for expensive language-specific printers• Full set of Unicode fonts supplied with BI Publisher• Scalable fonts embedding, with CID mapping tables• Oracle BI Publisher supports:

– CJK– BiDi– Unicode– MLS

• Communication with partners around the world• Templates created for any language or territory

Language SupportIn today’s global economy, the support for languages is paramount. BI Publisher ships with a full set of Unicode fonts, and a font-mapping and subsetting engine has been built. As the output is created, the engine picks the font glyphs required for the languages used. These are then embedded in the document as a new font, ensuring that the final output contains the required fonts and no specific fonts are required on the printer.BI Publisher is unique in supporting:

• CJK• BiDi• Unicode• MLS

This compares favorably to other PDF engines.

Page 52: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 20

Copyright © 2008, Oracle. All rights reserved.

Translation

• Communicate with partners around the world.– No dependency on installed languages– No dependency on a database character set

• Create a template for any language or territory.– Use XLIFF technology.– Provide template to translators.

• Any combination of the following are recognized:– 185 language codes – 244 territory codes

TranslationBI Publisher enables users to create templates in 185 languages in 244 territories. There is no dependency on the database character set. Customers can either use XLIFF technology to have their templates translated, or provide translators with the whole template. This is a great advantage because it enables translators to translate templates in “context.”

Page 53: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 21

Copyright © 2008, Oracle. All rights reserved.

Output Formats

Oracle BI Publisher supports the following formats:• Rich text format (RTF)• Portable document format (PDF)• eText (used with electronic data interchange [EDI] or

electronic funds transfer [EFT])

Output FormatsRTF is a standard maintained by Microsoft. You can learn more about it at:

http://msdn.microsoft.com/library/?url=/library/en-us/dnrtfspec/html/rtfspec.aspPDF was created by Adobe. You can learn more about it at:

http://www.adobe.com/products/acrobat/adobepdf.htmlThe PDF specification is available at:

http://partners.adobe.com/public/developer/pdf/index_reference.htmlPDF standards in multiple output format (for example, print-based PDFs and electronic PDFs) are currently being submitted and accepted as standards to the International Standards Organization (ISO). You can find details about their published standards at:

http://www.iso.org/XML, XSL, XSL-FO, and XPath are standards maintained by the World Wide Web Consortium (W3C). You can find them at:

http://www.w3c.org/

Page 54: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 22

Copyright © 2008, Oracle. All rights reserved.

Flexible Deployment Options

For E-Business Suite

For Oracle BI EE

For PeopleSoft

For JD Edwards

Embedded

Page 55: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 23

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher for Applications

• Oracle BI Publisher for Oracle E-Business Suite– Integrated with concurrent manager– Tightly integrated with all E-Business Suite

modules– Central repository for managing data and layout – Translation and configuration management

• Oracle BI Publisher for PeopleSoft Enterprise– Integrated with process scheduler and

report manager– Publish PeopleSoft queries and row sets– Report bursting– Security join tables– Template manager with effective dates support

• Oracle BI Publisher for JD Edwards Enterprise– Integrated with Enterprise One queries– Support queries saved through data browser– Row and business unit security

Page 56: D54122

Oracle BI Publisher 10g R3: Fundamentals 2 - 24

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to describe the following elements of Oracle BI Publisher:• Components• Architecture• Technology

SummaryOracle BI Publisher enables the following user communities to be more productive.

• End users: The end user is presented with rich report offerings, including multiple formats with multiple delivery options.

• Business consultants: Traditionally, the business consultant gathers business requirements, describes the report that is required in a document, and passes this information to the IT consultant for implementation. The business consultant now has a set of familiar desktop applications that can be used to design the report format itself, ensuring that the report meets the business requirements that are in the scope and that it looks exactly as the consultant designed it.

• IT consultants: The IT consultant now receives a document that is the actual report format as designed by the business consultant. The time to develop, deploy, and test is greatly reduced; the cost of ongoing maintenance is also reduced.

• Developers: The developer is able to focus on generating XML data to satisfy multiple requirements. Now that development is free from the “one data definition produces one report layout” paradigm, there is a move toward generating larger data engines that can satisfy a larger requirement set. This provides end users with far greater choice and control over the content of the reports they want to see.

Page 57: D54122

Copyright © 2008, Oracle. All rights reserved.

Introduction to XML Standards

Page 58: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:• Describe Extensible Markup Language (XML), Extensible

Stylesheet Language (XSL), and other X Standards objects• List the components of an XML document• Create a well-formed XML document • Describe XML namespaces• Describe a document type definition (DTD)• Describe XML Schema • Describe XML Path Language (XPath)• Describe XSL and XSL Transformations (XSLT)

Page 59: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 3

Copyright © 2008, Oracle. All rights reserved.

XML Standards

Document typedefinition

XML language

Defines and validates

XML namespace

Uniquely identifieselements

XML schema

Defines and validates

XPath

Locatesnodes

XSL/XSLTstyle sheet

Applies Transformedto

Outputdocument

Processedby

XML processor (DOM and SAX API)

Used by1

2

3

5

4

6

/Catalog/Item

http://www.hr.com/catalog

XML StandardsThe following XML standards are covered in this lesson:

1. The XML language specification defines the rules that govern XML document structure and how XML processors must read them.

2. A document type definition (DTD) provides the definition and relationships of elements contained in an XML document. A DTD validates an XML document.

3. XML namespaces provide a mechanism to distinguish elements with the same name but different definitions used in the same XML document.

4. The XML Path Language (XPath) provides the syntax for searching an XML document. XPath expressions are used in an XSL style sheet to match specific nodes.

5. An XML Schema provides a way to describe the XML document structure by using data type definitions, and uses namespace support. XML Schema is the preferred way to validate XML documents.

6. Extensible Style Sheet Language (XSL) is implemented by XSL Transformations (XSLT) to specify how to transform an XML document into another document. XSLT uses an XML vocabulary for transforming or formatting XML documents.

Page 60: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 4

Copyright © 2008, Oracle. All rights reserved.

Extensible Markup Language

Extensible Markup Language (XML) describes data objects called XML documents that are composed of markup and data.

Markup and dataCustom tags

XML document

Web data XML processors

Extensible Markup LanguageXML describes data objects called XML documents that:

• Are composed of markup language for structuring the document data• Support custom tags for data definition, transmission, validation, and interpretation• Have become a standard way to describe data on the Web• Are processed by XML processors

XML was developed by an XML working group headed by the World Wide Web Consortium (W3C) with the following design goals:

• XML is usable over the Internet.• It supports a wide variety of applications.• It is compatible with Standard Generalized Markup Language (SGML).• XML can be processed using easy-to-write programs.• It has a minimum number of optional features. • XML is human-legible and reasonably clear.• XML enables quick design preparation.• It enables formal and concise design. • XML documents are easy to create.• XML documents can be verbose.

Page 61: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 5

Copyright © 2008, Oracle. All rights reserved.

Advantages of Using XML

XML enables:• A simple and extensible way to describe data• The ability to interchange data• Simplified business-to-business communication• Writing of smart agents• The ability to perform smart searches

A sample XML document:<?xml version="1.0 encoding=“UTF-8"?><books><title>Building Oracle XML Applications</title><title>Oracle XML Handbook</title><title>Beginning XML Second Edition</title>

</books>

Advantages of Using XMLXML’s strongest point is its ability to perform data interchange. Because different groups of people rarely standardize on a single set of tools, it takes a significant amount of work for two groups to communicate. XML makes it easy to send structured data across the Web so that nothing is lost in translation. When using XML, you can receive XML-tagged data from your system or another system. Neither user has to know how the other user’s system is organized. If another partner or supplier teams up with your organization, you do not have to write code to exchange data with its system. You simply require them to follow the document rules defined in the DTD. You can also transform those documents by using XSLT.When writing to an agent, one of the challenges for the agent is to make sense of incoming data. A good agent interprets information intelligently, and then responds to it accordingly. If the data sent to an agent is structured with XML, it is much easier for the agent to understand exactly what the data means and how it relates to other pieces of data that it may already know.

Page 62: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 6

Copyright © 2008, Oracle. All rights reserved.

Oracle XML Support

Oracle products provide support for XML in:• Development tools

• Middle-tier frameworks

• Database storageOracle XDK 10g

Oracle BI Publisher

Oracle XML SupportDevelopment tools and frameworks: Oracle XML Database (XDB), Oracle JDeveloper 10g, Oracle Internet File System (iFS), Oracle Application Development Framework (ADF) in JDeveloper, Oracle Portal, Oracle Application Server Reports Services, and Oracle Dynamic Services can be used to build XML applications. Database and middle-tier frameworks: Oracle Application Server 10g provides the environment for the XSQL Pages framework, J2EE services which support XML applications, and Web services.Database storage: In Oracle Database 10g, Oracle XDB enables XML documents to be stored in and retrieved from relational tables, XMLType columns, and character large object (CLOB) types. Oracle Text (interMedia Text) can be used to efficiently search XML documents stored in XMLType or CLOB columns.Oracle XML Developer’s Kit (XDK) 10g: Oracle XDK 10g is available in Oracle JDeveloper 10g, Oracle Application Server 10g, and Oracle Database 10g. Oracle XDK provides the following components, tools, and utilities:

• XML Parsers, XSLT Processors, XSLT VM, XML Schema processors• XML Java Beans, XML Class Generator, XSQL Servlet, XML SQL Utility (XSU)• XML Pipeline Processor, TransX Utility

Page 63: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 7

Copyright © 2008, Oracle. All rights reserved.

<?xml version="1.0"?><employees><employee><employee_id>120</employee_id><last_name>Weiss</last_name><salary>8000</salary>

</employee><employee><employee_id>121</employee_id><last_name>Fripp</last_name><salary>8200</salary>

</employee></employees>

Example: A Simple XML Page

Example: A Simple XML PageThe example of a simple XML document uses nested elements to describe the employee data. Elements are identified by tag names, such as employee, employee_id, and last_name. Tag names are distinguishable as markup, rather than data, because they are surrounded by angle brackets (< and >). Note: In XML, an element includes the start tag (<employees>), end tag (</employees>), and all markup and character data contained between the tags.

Page 64: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 8

Copyright © 2008, Oracle. All rights reserved.

XML Document Structure

An XML document contains the following parts:• Prologue• Root element• Epilogue

<?xml version="1.0" encoding="WINDOWS-1252"?><!–- this is a comment --><employees>...</employees>

<?gifPlayer size="100,300" ?>

1

2

3

XML Document StructureAn XML document contains the following parts:

• The prologue, which may contain the following information: - XML declaration (optional in XML 1.0, mandatory in XML 1.1)- Document type definition (DTD), which is required only to validate the document

structure- Processing instructions and comments, which are optional

• The root element, which is also called the “document element”• An epilogue, which contains processing instructions and comments

An XML document can also contain processing instructions, giving commands or information to an application that is processing the XML data.Processing instructions have the format <?target instructions?>, where target is the name of the application that is expected to do the processing, and instructions consist of a string of characters that embodies the information or commands for the application to process.

Page 65: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 9

Copyright © 2008, Oracle. All rights reserved.

XML Declaration

XML documents must start with an XML declaration.The XML declaration:• Looks like a processing instruction with the xml name, as in

the following example:

• Must contain the version attribute• May include the following elements:

– encoding attribute– standalone attribute

• Is optional in XML 1.0 but mandatory in XML 1.1

<?xml version="1.0" encoding="WINDOWS-1252"?><document-root> ...</document-root>

XML DeclarationIt is generally recommended that you start an XML document with an XML declaration. If it is present, it must be the first line in the document. Although the XML declaration looks like a processing instruction, it is really a simple declaration. In the XML 1.0 recommendation, an XML document does not require the XML declaration. However, in the XML 1.1 specifications, the XML declaration is mandatory.Note: Not all tools and XML Parsers support the XML 1.1 syntax.The only attribute that is required in the declaration is version. Additional attributes that can be added to the XML declaration include:

• The encoding attribute, which is optional. By default, XML documents are encoded in the UTF-8 format of the Unicode character set. The slide example uses an encoding of WINDOWS-1252. This is useful for applications (such as those written in Java) that can handle other encoding formats.

• The stand-alone attribute is optional and may be set to the yes or no value. If omitted, the value is assumed to be no. Set the stand-alone value to:

- no if an application requires an external DTD to determine the proper document structure

- yes when the document does not have DTD or change the document content, or if the DTD is internal

Page 66: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 10

Copyright © 2008, Oracle. All rights reserved.

Components of an XML Document

XML documents comprise storage units containing:• Parsed data, including the:

– Markup (elements, attributes, entities) used to describe the data they contain

– Character data described by markup

• Unparsed data, textual or binary information (graphic and sound data) taken as entered

<?xml version="1.0" encoding="WINDOWS-1252"?> <employees><employee id="100"><name>Rachael O&apos;Leary</name>

</employee></employees>

<![CDATA[ ...unparsed data... ]]>

Components of an XML DocumentAn XML document comprises storage units containing parsed or unparsed data. Parsed data is textual information comprising:

• Markup that describes the data it contains. Markup includes:- Elements to describe the data it contains, such as the root element (employees) and

its child elements (employee, name)- Attributes, which are name and value pairs (id="100") included in the start tag of an

element- The entities (&apos;) representing any character data substituted in place of their

appearance• Character data described by the markup components. For example:

- The value 100 assigned to the id attribute- The data Rachael O'Leary described by the <name> element- The &apos; entity, which represents the apostrophe (') character

Note: The element tree in an XML document defines its layout and logical structure.Unparsed data, embedded in CDATA sections, can be used in an XML document to contain textual data or encoded binary data, such as graphic and sound files. A CDATA section starts with <![CDATA[ and ends with ]]> characters. The information contained inside the CDATAsection is not parsed by an XML Parser, and is taken as entered.

Page 67: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 11

Copyright © 2008, Oracle. All rights reserved.

XML Elements

• An XML element:– Has a start tag, end tag, and optional data content– Has tag names that are case-sensitive

• Empty elements:– Do not contain any data– May appear as a single tag

<employee>

</employee>

<name>Steven King</name>

Start tag

End tag

Data contentElement

Tag name

Tag name

<initials></initials>

<initials/>

XML ElementsAn XML element has:

• A start tag (for example, <employee>) includes:- The “<”character- A case-sensitive tag name (employee), without leading spaces- The “>”character

• An end tag (for example, </employee>) includes:- The “<” character- The case-sensitive tag name that must be identical to the start tag name, but prefixed

with a slash. Leading spaces are not permitted.- The “>” character

• Data content that can also contain elements, such as <name> in the slide exampleIn summary, an XML element includes the start tag, end tag, and everything in between.Empty elements have no content between the start and end tags. In this case, a shortened form can be used where the start tag name is followed by a slash. For example: <initials/>.Tag names are a descriptive term for an XML element and its content—for example, employee. The tag name is known as the element type name.

Page 68: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 12

Copyright © 2008, Oracle. All rights reserved.

Markup Rules for Elements

• There is one root element, sometimes called the top-level or document element.

• All elements:– Must have matching start and end tags, or be a self-closing

tag (an empty element)– Can contain nested elements, so that their tags do not overlap– Have case-sensitive tag names subject to naming

conventions: start with a letter, contain no spaces, and do not start with the letters xml

• The element data content may contain white space, such as spaces, tabs, new lines, and combinations of these.

Markup Rules for ElementsEvery XML document must contain one root element (top-level or document element). XML documents are hierarchical in structure, with elements nested in others forming a document tree. The start and end tags for elements must not overlap, as in this example:

<employee><first_name>Steven<last_name>king</first_name></last_name>

</employee>

Here, the <last_name> element overlaps the <first_name> element. This is not permissible. The correct form is:

<employee><first_name>Steven</first_name><last_name>king</last_name>

</employee>

Element start and end tag names must be identical—that is, they are case-sensitive. For example, <Employee>, <employee>, and <EMPLOYEE> are all different tag names.Element tag names must start with a letter or an underscore (_), but not numeric or punctuation characters. After the first letter, numeric, dash (-), and period (.) characters are allowed, but not white space. Tag names cannot start with the xml letter sequence, or any case-sensitive combination thereof. White space, including new lines, are considered part of the data. However, XML Parsers treat end-of-line characters as a single line-feed.

Page 69: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 13

Copyright © 2008, Oracle. All rights reserved.

XML Attributes

An XML attribute is a name-value pair that:• Is specified in the start tag, after the tag name

• Has a case-sensitive name• Has a case-sensitive value that must be enclosed in

matching single or double quotation marks• Provides additional information about the XML document or

XML elements

<?xml version="1.0" encoding="WINDOWS-1252"?> <employees><employee id="100" name='Rachael O&apos;Leary'><salary>1000</salary>

</employee></employees>

XML AttributesAttributes are simple name-value pairs that are associated with a particular element. XML attributes must be specified after one of the following:

• The start tag of an element• The tag name of an empty element

Example: <employee id="100" email="SKING"/>Attribute names are case-sensitive and follow the naming rules that apply to element names. In general, spaces are not used, but are allowed, on either side of the equal sign.The attribute values must always be in matching quotation marks—either single or double quotation marks. The slide example shows the employee id attribute value enclosed in double quotation marks, and the name attribute value enclosed in single quotation marks. In the latter case, the &apos; entity must be used to include an apostrophe in the name value.Attributes provide additional information about the XML document’s content or other XML elements. Attributes can be used for the following purposes:

• Describing how the XML document data is encoded or represented• Indicating where the links or external resources are located• Identifying and calling external processes, such as applets and servlets• Specifying an element instance in the document for facilitating a rapid search

Note: Attributes always have a value. For example, name="" has an empty string value.

Page 70: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 14

Copyright © 2008, Oracle. All rights reserved.

Using Elements Versus Attributes

<?xml version="1.0"?><employees><employee id="100" last_name="King"

salary="24000"><job>President</job>

</employee></employees>

2

<?xml version="1.0"?><employees><employee><id>100</id><last_name>King</last_name><salary>24000</salary>

</employee></employees>

1 Elements

Attributes

Using Elements Versus AttributesIn the slide, you see two examples. In Example 1, id, last_name, and salary are defined as elements in the employee element, whose parent is the employees element. In Example 2, id, last_name, and salary are attributes of the employee element, whose root element is employees. Elements and attributes accomplish approximately the same thing; that is, they describe the data. The examples shown are both valid and communicate the same basic information about an employee. Note: In general, it is more robust and flexible to use elements rather than attributes.The choice to use elements or attributes is often a matter of preference, but takes some time and experience to determine the best style to use for different contexts. The easiest and the most consistent approach is to use elements for data that the user of the document wants to see, and attributes for metadata representing additional information about the data that the document may require. The following are additional points to consider:

• Elements are more easily added as your requirements expand. • Elements may be ordered, but attributes are returned unordered from the document.• Elements can be structured and may contain other elements.• Attributes are atomic; that is, they cannot be nested or have attributes of their own.

Page 71: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 15

Copyright © 2008, Oracle. All rights reserved.

XML Entities

An XML entity:• Is a unit of data storage• Is identified by a case-sensitive name• Is used as replacement text (substituted) when referencing

its name between an ampersand (&) and a semicolon (;)

• Has predefined names for special XML characters:– &lt; for less-than (<) and &gt; for greater-than (>)– &amp; for ampersand (&)– &quot; for double quotation mark (")– &apos; for single quotation mark (')

<comment>Salaries must not be &lt; 1000</comment>

XML EntitiesAn XML entity is a unit of data storage that:

• Is identified by a case-sensitive name• Represents replacement text to eliminate a lot of typing in XML documents• Is referenced by its name prefixed with an ampersand (&) and terminated by a semicolon

(;). The ampersand is referred to as an escape character.The XML standard predefines entity names for the following special characters:

• The less-than sign (<) represented by the name &lt;• The greater-than sign (>) represented by &gt;• The ampersand (&) represented by &amp;• The double quotation mark (") represented by &quot;• The single quotation mark or apostrophe (') represented by &apos;

In the following example, the XML Parser expects a tag name after the less-than (<) sign:<number>150<100</number>

This invalid syntax is corrected by using the &lt; built-in entity to represent the less-than character. Example:

<number>150&lt;100</number>

Note: User-defined entity names can be declared in a document type definition (DTD).

Page 72: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 16

Copyright © 2008, Oracle. All rights reserved.

XML Comments

XML comments:• Start with <!--• End with -->• May appear anywhere in the character data of a document,

and before the root element• Are not elements, and can occupy multiple lines• May not appear inside a tag or another comment

<?xml version="1.0" encoding="WINDOWS-1252"?><!–- Comment: This document has information about

employees in the company --><employees><name>Steven King</name> <!-- Full name --></employees>

XML CommentsComments are a way to document what is done inside an XML document. XML comments can appear anywhere in the XML document, except inside:

• The start or end tag of an element. Thus, they are not permissible in attribute values.• Another comment. Comments cannot be nested.

Because comments are not considered to be XML elements, their appearance does not violate the tree structure or one-root element requirement for well-formed XML documents. The slide example shows a comment:

• Before the root element• After the end tag of the </name> element

Note: In general, a comment must not appear before the XML declaration. However, some XML Parsers, as in Internet Explorer, do not mark it as an error.Applications must not depend on comments because they are not intended for processing purposes, but merely for making the XML document more meaningful to people reading its contents.

Page 73: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 17

Copyright © 2008, Oracle. All rights reserved.

A Well-Formed XML Document

Every XML document must be well formed:• An XML document must have one root element.• An element must have matching start and end tag names,

unless they are empty elements.• Elements can be nested but cannot overlap.• All attribute 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 special characters < and & cannot appear in the

character data of an element or attribute value.

A Well-Formed XML DocumentEvery XML document must be well formed to guarantee that it is correctly structured and adheres to the rules defined in the slide. The slide contains a list of the most common rules to be addressed for well-formed documents, but it is not a complete list.Note: The less-than (<) and ampersand (&) characters are special in XML and cannot appear as themselves in the character data part of an element, or the value of an attribute. In character data and attribute values, an XML Parser recognizes:

• The less-than (<) sign as a character that introduces the start tag of another element• The ampersand (&) as an escape character before an entity name terminated by a semicolon

(;)Therefore, to include special characters in the character data of an element, or attribute value, you must use built-in XML entity names for special characters. For example, use &lt; to include the less-than character, and &amp; for the ampersand character. The XML Parser replaces the entity reference with its textual or binary representation.Note: The XML 1.1 specification requires the XML declaration to appear at the beginning of the document. However, the declaration is optional when using XML 1.0.

Page 74: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 18

Copyright © 2008, Oracle. All rights reserved.

Class Activity

Identify errors in the following examples:

<?xml version="1.0"?><Question>Is this legal?</Question><Answer>No</Answer>

<!-- An XML document --><?xml version="1.0"?>

<Question 4You="Is this attribute name correct"/>

<EMAIL [email protected]></EMAIL>

<Question>Is this legal</question>

1

2

3

4

5

Class Activity1. Both <Question> and <Answer> are top-level elements. You can have only one

document element per document.2. In general, you cannot have a comment before the XML declaration, and the root element is

required.Note: Internet Explorer allows a comment before the XML declaration.

3. The attribute name cannot start with a digit.4. The attribute value is not enclosed in quotation marks.5. Opening and closing tag names are case-sensitive and must match.

Page 75: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 19

Copyright © 2008, Oracle. All rights reserved.

Comparing XML and HTML

• XML:– Is a markup language for describing data– Contains user-defined markup elements– Is extensible– Is displayed as a document tree in a Web browser– Conforms to rules for a well-formed document

• HTML:– Is a markup language for formatting data in a Web browser– Contains predefined markup tags– Is not extensible– Does not conform to well-formed document rules

Comparing XML and HTMLThe key difference between XML and HTML is that:

• XML is a markup language for describing data• HTML is a markup language for formatting data

The slide covers other important differences between XML and HTML. A Word About XHMTLThe World Wide Web Consortium (W3C) has worked on defining Extensible HyperText Markup Language (XHTML) as a successor to HTML.XHTML is designed to conform to XML standards and well-formed document rules, and provide a way to reproduce, subset, and extend HTML documents. An XHTML document is a particular XML document instance intended for processing by a Web browser.Note: Not all browsers support XHTML documents, and different browsers often process XHTML documents in different ways.

Page 76: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 20

Copyright © 2008, Oracle. All rights reserved.

XML Development

Developing XML documents can be done using:• A simple text editor, such as Notepad• A specialized XML editor, such as XMLSpy• Oracle JDeveloper 10g XML-related features that include:

– Syntax checking for XML documents– XML Editor with code insight for XML schema-driven editing – Registering of external XML schemas – Validation of XML documents against registered XML

schemas

XML Development and Oracle JDeveloper 10gThere are many ways to develop XML documents—from a simple text editor (such as Notepad) to rich XML development tools (such as XMLSpy or Oracle JDeveloper 10g). Oracle JDeveloper 10g includes:

• An XML editor, which is a specialized XML schema-driven editor for editing XML documents subject to XML language standards

• A code insight feature that enables JDeveloper to provide you with a choice of elements or attributes that are relevant to the context of the editing location in the document

• The capability to register external XML schemas for use by the schema-driven editor• The use of registered XML schemas to validate XML documents• A simple XML syntax check to test whether the document is well formed

Page 77: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 21

Copyright © 2008, Oracle. All rights reserved.

XML Namespaces

An XML namespace:• Is identified by a case-sensitive Internationalized Resource

Identifier (IRI) reference (URL or URN)• Provides universally unique names for a collection of names

(elements and attributes)

<employee> <departments>

<name>

<name>

<location_id>

department_id

employee_id

<salary>

http://hr.com/employees urn:hr:departments

XML Namespaces An XML namespace:

• Is identified by an Internationalized Resource Identifier (IRI), which is a case-sensitive string of characters identifying a resource.

• Provides a universally unique name for a collection of XML names made up of element and attribute names.

The IRI is a string of characters that can be formatted as:• A Uniform Resource Indicator (URI) or Uniform Resource Locator (URL), such as a Web

address http://hr.com/employeesNote: The URL, or Web address, represents a unique string and is not checked to ensure a valid or existing Web address.

• A Uniform Resource Name (URN), such as urn:hr:departments. A URN starts with the letters urn, followed by a colon (:), a Namespace Identifier (NID) (hr), a colon (:), and a Namespace Specific String (NSS) (departments).

The example in the slide shows two collections of XML element and attribute names, each identified by a unique XML namespaces IRI. If the XML namespace was not used, the <name>element for an employee will be indistinguishable from the <name> element of the department. Applying the XML namespace qualifies each <name> element, thereby removing the ambiguity, particularly if the documents are merged.

Page 78: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 22

XML Namespaces (continued)Why Use XML Namespaces?XML namespaces are designed to provide universally unique names for elements and attributes. XML namespaces:

• Resolve name ambiguity and collision problems that can occur when XML document fragments are combined, or when multiple elements have similar type and attribute names in the same XML document

• Allow code modules to be invoked for specific elements and attributesIf two companies are interchanging XML messages, they must come to a common agreement on the meaning of the element and attribute names in the messages. This can be achieved by two means:

• Defining the meaning, format, and domain of every element and attribute needed• Recognizing element and attribute names without ambiguity

The first can be accomplished by using an XML Schema definition. The second is solved by using XML namespaces to qualify element names.The examples in the slide illustrate the combining of a <department> element with one of its <employee> elements. Each document is different and defines a <name> element. Each <name> element has a different content model and must be interpreted by an application in a different way. The problem does not arise when the elements exist in separate documents.

Page 79: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 23

Copyright © 2008, Oracle. All rights reserved.

XML Namespace Declarations: Example

<?xml version="1.0"?><department xmlns="urn:hr:department-ns"

xmlns:emp="urn:hr:employee-ns"><name>Executive</name><emp:employee><emp:name><emp:first_name>Steven</emp:first_name><emp:last_name>King</emp:last_name>

</emp:name></emp:employee><emp:employee><emp:name><emp:first_name>Neena</emp:first_name><emp:last_name>Kochhar</emp:last_name>

</emp:name></emp:employee>

</department>

XML Namespace Declarations: ExampleThe slide shows an example of a <department> element containing two <employee>elements. The <department> element shows an example of declaring two XML namespaces: a default and one with the emp prefix. The <name> element is used for:

• The department name containing the Executives text• The employee name containing the <first_name> and <last_name> child elements

Without using XML namespaces in the document, the <name> element will be ambiguous to a processor and can possibly be treated as the same type, even though the department and employee names are semantically and structurally different. Using the XML namespaces removes the ambiguity for each <name> element, which allows them to be processed differently by an XML application. In the example in the slide:

• The unqualified <department> and <name> elements are implicitly qualified by the default namespace, urn:hr:department-ns, declared in the start tag of the <department> element

• All <employee> elements and their children, including the <emp:name> element, are explicitly qualified with the emp prefix, which is associated with the urn:hr:employee-ns XML namespace

Page 80: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 24

Copyright © 2008, Oracle. All rights reserved.

Why Validate an XML Document?

• Well-formed documents satisfy XML syntax rules, and not the business requirements about the content and structure.

• Business rules often require validation of the content and structure of a document.

• XML documents must satisfy structural requirements imposed by the business model.

• A valid XML document can be reliably processed by XML applications.

• Validations can be done by using a DTD or an XML Schema.

Why Validate an XML Document?A well-formed XML document is one that meets all the rules of the XML specification. What if just following the syntax rules is not quite good enough? Your business may require the validation of the actual structure and content of a document. Your document must not only follow the XML rules, but it must also satisfy structural requirements imposed by your business model, as in the following example:

Each <employee> element must consist of <employee_id>, <first_name>, <last_name>, <email>, <phone_number>, and <department_id> elements. If an <employee> element misses any of these elements, it is considered invalid. You may also need to verify whether these elements have a valid value.

You can perform these validations by using a document type definition (DTD). DTD was the first type of mechanism available for validating XML document structure and content. It lacked the capability of performing data type validations on the content. The XML Schema recommendation supports validation for different data types, and is rapidly replacing DTD as a way to validate the XML document structure and content.Note: Theoretically, anything that has not been explicitly permitted in DTD is forbidden. Some parsers do not always enforce the rules defined by a DTD.

Page 81: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 25

Copyright © 2008, Oracle. All rights reserved.

Document Type Definition

A document type definition (DTD): • Is the grammar for an XML document• Contains the definitions of:

– Elements– Attributes– Entities – Notations

• Contains specific instructions that the XML parser interprets to check document validity

• May be stored in a separate file (external) • May be included in the document (internal)

Document Type DefinitionA DTD provides a list of elements contained in an XML document that collectively specifies the structure of the document. A DTD defines the set of markup items used in an XML document—that is, the:

• Elements• Attributes, and their permissible values• Entities (user-defined)• Notations

Note: Notations are not frequently used. The XML engine interprets the markup defined in the DTD to check the document for validity. For example, a DTD may specify that a department must have exactly one department identification number and one name, but may have multiple employee elements. An XML document indicates to an XML Parser whether it is associated with a DTD and where to locate the DTD.A DTD may be found internally (inline) in the document, or externally identified by a Uniform Resource Locator (URL), which can be a file on disk. If the XML Parser does not encounter errors, the XML document is guaranteed to be consistent with the definition.

Page 82: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 26

Copyright © 2008, Oracle. All rights reserved.

Simple DTD Declaration: Example

Example of a simple DTD with element declarations:

A valid XML document based on the DTD is:

Note: All child elements must be defined.

<!ELEMENT employees (employee)><!ELEMENT employee (name)><!ELEMENT name (#PCDATA)>

<?xml version="1.0"?><employees><employee><name>Steven King</name>

</employee></employees>

Simple DTD Declaration: ExampleIn the slide, the DTD declares three elements: employees, employee, and name. These elements form a simple hierarchy, where the <employees> element must contain one <employee> element that must contain one <name> element (as shown in the slide).Note

• The #PCDATA example represents text-only content without child elements.• The XML document does not reference the DTD in the slide example.

Element names used in the content model represent a single instance of that element. Using the DTD in the slide, the following XML document is invalid because there are two <employee>child elements:

<?xml version="1.0"?><employees>

<employee><name>Steven King</name></employee><employee><name>Ellen Abel</name></employee>

</employees>

Note: The DTD syntax for declaring an element provides a way to specify a cardinality (a number of occurrences) for usage of elements in the content model.

Page 83: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 27

Copyright © 2008, Oracle. All rights reserved.

XML Schema

XML Schema:• Is an XML language that defines and validates

the structure of XML documents• Is stored in an XML

Schema Document (XSD)• Defines components, such as:

– Simple types definitions– Complex type definitions– Element declarations– Attribute declarations

• Supports XML namespaces and built-in,simple, and complex data types

XSD Validates

References

Instance

XML Schema The W3C XML Schema Definition Language is an XML language (or vocabulary) used in an XML Schema Document (XSD) for describing and constraining the content of XML documents. The XSD is used to validate the structure of an XML document. An XML document, whose structure is based on the definitions in an XML Schema, is called an instance document of that XML Schema. The slide shows an XML Schema Document stored separately from the XML instance document that it describes and validates.The introduction of the XML Schema allowed XML technology to represent data types in a standard format. The data types give a precise way of specifying the type of content that can be held in elements and attributes of an XML document. Using a document type definition (DTD) provides no mechanism for specifying data types in a way that a database user may require. The XML Schema definition file builds upon DTD functionality while providing XML namespace and data type support.

Page 84: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 28

XML Schema (continued)Benefits of XML SchemasYou can use XML Schema to specify the structure of XML documents and validate the XML documents. Although most XML documents are well formed, they may not be “valid.” A valid document is well formed and conforms to specific rules defined by either a DTD or an XML Schema. Using XML Schema for validation has the following benefits. An XML Schema:

• Is easily created using XML, as defined by the W3C XML Schema language• Supports the W3C namespace recommendation• Can be used to validate content of text elements based on built-in and user-defined data

types• Allow the creation of complex data type models that can be reused• Support object inheritance and substitution in types

In the Web publishing world, a single page that displays local weather, stock quotes, horoscopes, and specific news channels based on user preferences can involve dozens of queries made to underlying databases and application servers. These queries are made via SQL, the standard object-relational query language, or via a programmatic interface that ultimately calls SQL. Because both SQL and programming languages (such as Java) are strongly typed, they return information that possesses type, structure, constraints, relationships, and so on. The structural and data typing aspects of XML Schema can help exploit generation of viewable documents from databases.

Page 85: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 29

Copyright © 2008, Oracle. All rights reserved.

XML Schema Document: Example

• The simple XML Schema uses:– A required XML namespace string, with an xs prefix,

http://www.w3.org/2001/XMLSchema

– The <schema> element as its document root– The <element> element to declare an element

• A valid XML instance document:

<?xml version="1.0"?><xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="departments" type="xs:string"/></xs:schema>

<?xml version="1.0"?><!-- The element cannot contain child elements --><departments>Finance</departments>

XML Schema Document: ExampleThe example in the slide shows a simple XML Schema document that declares a single element called departments. The XML Schema Document (XSD) uses the required XML namespace value http://www.w3.org/2001/XMLSchema, which is assigned the xsd namespace prefix. The xsd prefix is used to qualify the schema, element, and string names to ensure that the XSD document structure conforms to the W3C XML Schema language recommendation; that is, the XSD itself is a valid document.The XML Schema language elements used in the example are the following:

• The <xs:schema> element is the root element for the XSD, and contains definitions for the structure of the XML instance document.

• The <xs:element> element declares a root element name, departments, for the XML instance document, as shown in the slide.

• The <xs:string> value is set as the data type for the contents of the departmentselement in the XML instance document. In this case, the data can be any string but not markup; that is, no child elements are permitted.

Note: Using a namespace prefix, such as xs or xsd, is recommended but not required.

Page 86: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 30

Copyright © 2008, Oracle. All rights reserved.

XML Schema Versus DTD

• XML Schema: – Is more powerful and flexible than a DTD– Provides better namespace support than a DTD– Is written in XML syntax– Is extensible– Provides data-type support

• DTD: – Provides the ENTITY functionality that is not supported by

XML Schema– Can be embedded in an XML document– Is written in Standard Generalized Markup Language (SGML)

XML Schema Versus DTD An XML Schema defines a set of new names (called a vocabulary) and the structure and data types for elements, types, attributes, and attribute groups. A DTD defines a vocabulary of names for elements and attributes containing either a text string, or a combination of text strings and child elements.Applications that process the same XML documents may want to represent their data elements differently. Using XML namespaces help applications to distinguish between different definitions of the same element name used in different contexts in a single document. XML Schema seamlessly supports namespaces to distinguish definitions. A DTD does not directly support namespaces or provide support for data typing. Because a DTD declares names associated with textual contents, it poses problems when you try to model dynamic content that comes from strongly typed systems such as databases. XML Schema is ideal for database systems because it provides for data type integrity and the maintenance of bound conditions.A DTD is written using a syntax that is different from an XML document. Consequently, parsers, tools, and programs dealing with a DTD must implement the specific rules that govern the DTD. An XML Schema allows models to be written by using the XML syntax, which allows the same programs that read the data to also read the definition of the data.

Page 87: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 31

Copyright © 2008, Oracle. All rights reserved.

XML Path Language

XML Path Language (XPath):• Is primarily used to address the nodes of an XML document

modeled as a tree of nodes• Is named after its use of a path notation for navigating

through the hierarchical structure of an XML document• Uses a compact, non-XML syntax to form expressions for

use in Uniform Resource Identifier (URI) and XML attribute values

• Fully supports XML namespaces• Is designed to be used by XML applications, such as XSLT

and XPointer

XML Path LanguageXML Path Language (XPath) is primarily used for addressing parts (nodes) of an XML document. XPath models an XML document as a tree of nodes and expresses a navigation path through the hierarchical structure of an XML document. XPath:

• Is named after the path notation that it uses for navigating through the structure of an XML document

• Uses a compact, non-XML syntax to form expressions that are used in URI and XML attribute values

• Facilitates the manipulation of string, number, and Boolean values• Operates on the abstract, logical structure of an XML document called the document data

model, rather than its surface syntax In addition to its use for addressing parts of an XML document, XPath fully supports XML namespaces and provides a natural expression language subset for pattern matching, which is extensively used in the W3C XSLT Recommendation and in XPointer.Note: XSLT is Extensible Stylesheet Language Transformation, the language used to transform an XML document into another XML document. XPointer is the XML Pointer Language used as a fragment identifier for any URI reference that locates a resource with a MIME type of text/xml or application/xml.

Page 88: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 32

Copyright © 2008, Oracle. All rights reserved.

XPath Model

Document root

<departments>

<department> num="1"

<department_id>

<department_name>

10

Administration

<department> num="2"

1

2

4

53

XPath ModelXPath models an XML document as a tree of nodes. The graphic in the slide depicts the different types of nodes, as seen by XPath, in an XML document:

1. Document root, which is a virtual document root that is the parent of the entire XML document containing the XML declaration, the root element and its children, comments, and processing instructions at the beginning and the end of the document

2. Root element (for example, the <departments> element).3. Element nodes (for example, the <department>, <department_id>, and <department_name> elements. The root element is also an element node.

4. Attribute nodes (for example, the num="1" node)5. Text nodes (for example, the nodes containing the text 10 and Administration)

Note: In the XPath model, the document root is not the same as the root element node.XPath can also address comment nodes, processing instruction nodes, and namespace nodes, which are not shown in the diagram. XPath defines a way to compute a string value for each type of node, some of which have names. Because XPath fully supports the XML Namespaces Recommendation, the node name is modeled as a pair known as the expanded name, which consists of a local part and a namespace URL, which may be null.XPath allows various kinds of expressions to be nested with full generality. XPath is a strongly typed language; this means that the operands of various expressions, operators, and functions must conform to designated types. XPath is a case-sensitive expression language.

Page 89: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 33

Copyright © 2008, Oracle. All rights reserved.

XSLT and XPath

XSLT:• Transforms XML into plain text, HTML, or XML• Specifies transformation rules in elements with attributes that

use XPath expressions<?xml version="1.0"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="//department_name"><html><body><p><xsl:value-of select="."/></p><xsl:apply-templates/>

</body></html>

</xsl:template><xsl:template match="*/text()"/>

</xsl:stylesheet>

XSLT and XPathAn Extensible Stylesheet Language (XSL) document is an XML document with elements that define transformation rules. The slide shows sample XSL document elements:

• The <xsl:template> element with a match attribute containing an XPath expression defining the set of nodes to which the template rule applies.

• The <xsl:value-of> element with the select attribute containing an XPath expression. The <xsl:value-of> element outputs the text value of the specified node, relative to the context node matching its template XPath expression.

The <xsl:template> element informs the XSLT Processor how to locate specific element nodes in the input document, and provides the rules to create the output data as the contents specified between the start and end tags of the <xsl:template> element. In the example, you search for department_name elements, and use the current node (.) to output the value of the department_name.Note: The XSLT Specification states that XSLT processors must provide a default template rule causing text nodes to be output, if no matching template rules exist. Suppress the output of unprocessed text nodes by including, at the end of the XSLT style sheet, a template rule matching all text nodes that does not output data. For example, as shown in the slide, you would use <xsl:template match="*/text()"/>.

Page 90: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 34

Copyright © 2008, Oracle. All rights reserved.

XSL

Extensible Stylesheet Language (XSL) has two parts:• XSL Transformations (XSLT)• XSL Formatting Objects (XSL-FO)

XSL

XSLXML documents have structure and, unlike HTML, do not provide formatting or display instructions. Extensible Stylesheet Language (XSL) adds the capability of transforming an XML document into another document containing XML with a different structure, or an HTML document with formatting tags.XSL has the following two parts:

• XSL Transformations (XSLT) is an XML application that processes rules contained in an XSLT style sheet. The rules in an XSLT style sheet can be applied to any XML document.

• XSL Formatting Objects (XSL-FO) is an XML application used for describing the precise layout of text on a page. XSLT is used to generate XSL-FO elements that are output to another XML document. Additional processing is needed to create the final output form, such as a portable document format (PDF) document.

The graphic in the slide depicts an XML document and an XSLT style sheet document being processed by an XSL Processor. The XSL Processor is an XML application that applies transformation rules to the XML document as specified in the XSL document, and produces a new document as the result.

Page 91: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 35

Copyright © 2008, Oracle. All rights reserved.

XSLT

XSLstyle sheet

Input XMLdocument

Output XMLdocument

<?xml version="1.0"?><xsl:stylesheet ...><xsl:template match="XPath"/><!-- output information -->

</xsl:template></xsl:stylesheet>

XSLprocessor

Matchingrule

Output data

XSLTExtensible Stylesheet Language Transformations (XSLT) is an XML application, or XSL Processor, that processes rules specifying how to transform one XML document into another XML document. The rules are contained in an XSLT document called an XSLT style sheet, which itself is an XML document and must be well formed.The slide shows that an XSLT style sheet contains one or more template rules; each template rule has two parts:

• A match pattern, specified as an XPath expression in an attribute of an <xsl:template>element.

• Template data, appearing between the start and end tags of the <xsl:template>element, that contains the output information. The template data typically contains XML or HTML elements mixed with the XSLT rules.

The XSL Processor compares the elements in the input XML document with the template rule pattern in the XSLT style sheet, and writes the template data for matching rules to the output tree—typically, another XML document. Essentially, the transformation process operates on the tree data structure of a source (input) XML document and produces a tree of nodes as its output.Note: XSL-FO elements are output elements found inside the <xsl:template> rules.

Page 92: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 36

Copyright © 2008, Oracle. All rights reserved.

XSLT Style Sheet

An XSLT style sheet is an XML document containing:• A <xsl:stylesheet> root element declaring:

– The xsl namespace prefix– The http://www.w3.org/1999/XSL/Transform

mandatory namespace URI• One or more <xsl:template> elements and other XSL

elements defining transformation rules<?xml version="1.0"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform">...<xsl:template match="/"> ... </xsl:template><xsl:template match="..."> ... </xsl:template>

<xsl:stylesheet>

XSLT Style SheetAn XSLT style sheet is an XML document that uses elements from the XSLT vocabulary to describe transformation rules. The document element of every XSLT style sheet is the <xsl:stylesheet> element, whose content is a set of one or more XSL elements defining template rules describing the transformation to be performed.Note: <xsl:transform> is a synonym for <xsl:stylesheet>.The <xsl:stylesheet> element declares the mandatory namespace attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform" that is used to qualify the elements in an XSLT style sheet. If you do not provide this exact namespace prefix and URI, the XSLT Processor simply ignores the rules in <xsl:template>, <xsl:for-each>, <xsl:value-of>, and other XSL elements that are qualified with the xsl prefix. Therefore, it does not recognize them as XSLT instructions.Each style sheet rule, called a template, contains a match pattern specified as an XPath expression that is compared against the nodes in the source XML document. An XSL template rule is represented by an <xsl:template> element with a match attribute that is assigned a "pattern" string containing an XPath expression.

Page 93: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 37

Copyright © 2008, Oracle. All rights reserved.

XSLT Style Sheet: Example

<?xml version="1.0"?><xsl:stylesheet version ="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"><html><body><table border="1"><tr><th>Id</th><th>Name</th><th>Salary</th></tr><xsl:apply-templates/></table></body></html></xsl:template><xsl:template match="employee"><tr><td><xsl:value-of select="employee_id"/></td><td><xsl:value-of select="last_name"/></td><td><xsl:value-of select="salary"/></td></tr></xsl:template></xsl:stylesheet>

123

45

6

XSLT Style Sheet: Example The XSLT document in the example, called a style sheet, shows the following components:

1. The standard XML document declaration, because the style sheet is an XML document.2. Mandatory XML namespace declaration using the xsl namespace prefix, and the URI http://www.w3.org/1999/XSL/Transform namespace.

3. The <xsl:template> rule matching the root of the source XML document.4. The template data containing HTML tags to be written to the output document.5. The <xsl:apply-templates> element instructing the XSLT Processor to apply

template rules, if any, for child elements of root in the source document. The <xsl:apply-templates> element is replaced by any output generated for matching child element template rules.

6. The <xsl:template> rule for matching <employee> elements in the source document, with template data containing HTML table row (<tr>...</tr>) tags enclosing three table data (<td>...</td>) tag pairs. Each table data tag pair encloses an <xsl:value-of select="..."/> rule that inserts the value of the source document element selected by the XPath expression, which is typically the name of the source document element.

The XML document that uses this XSLT style sheet is shown in the slide titled “Viewing the Transformed Document.”

Page 94: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 38

Copyright © 2008, Oracle. All rights reserved.

Viewing the Transformed Document

Perform one of the following actions:• Open the XML document in the browser.• View the oraxsl command-line processor output.

<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="emp.xsl"?><employees><employee><employee_id>100</employee_id><last_name>King</last_name><salary>24000</salary>

</employee><employee><employee_id>101</employee_id><last_name>Kochhar</last_name><salary>18000</salary>

</employee></employees>

Viewing the Transformed DocumentThe slide shows the source XML document and the result of applying the XSLT style sheet from the slide titled “XSLT Style Sheet: Example.” When you open the XML document with Microsoft Internet Explorer, it automatically applies the XSLT style sheet specified in the XML document processing the instruction and renders the result shown.Alternatively, you can use the oraxsl command-line interface to apply an XSLT style sheet to an XML document. To invoke oraxsl, use the following:

set CLASSPATH=E:\JDeveloper\lib\xmlparserv2.jarjava oracle.xml.parser.v2.oraxsl f.xml f.xsl f.html

The oraxsl parameters (in order) are:1. The source XML document (f.xml).2. The XSLT style sheet document (f.xsl).3. The output file name (f.html). If omitted, the output appears in the standard output.

Page 95: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 39

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:• Describe XML, XSL, and other X Standards objects• List the components of an XML document• Create a well-formed XML document • Describe XML namespaces• Describe a DTD• Describe XML Schema • Describe XML Path Language (XPath)• Describe XSL and XSLT

Page 96: D54122

Oracle BI Publisher 10g R3: Fundamentals 3 - 40

Copyright © 2008, Oracle. All rights reserved.

Practice 3: Overview

This practice covers the following topics:• Creating an employee XML file• Adding an employee element to the XML file• Adding employee data to the XML file• Creating a department XML file• Adding a department element to the XML file• Adding department data to the XML file• Creating an XML file to combine employee and department

Page 97: D54122

Copyright © 2008, Oracle. All rights reserved.

Getting Started with BI Publisher: Creating a Simple Report

Page 98: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:• Describe the sample schemas used in course practices

(HR,OE, and SH)• Log in to Oracle BI Publisher and set up a database

connection• Create a simple report based on Oracle Database• Upload an existing template for the report and view data• Export or download a BI Publisher report

Page 99: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 3

Copyright © 2008, Oracle. All rights reserved.

Sample Schemas in Oracle Database

Sample schemas:• Are provided with Oracle Database• Provide a common platform for examples in each release of

Oracle Database• Are a set of interlinked schemas

Sample Schemas in Oracle DatabaseOracle Database sample schemas provide a common platform for examples in each release of Oracle Database. Most of the examples in Oracle Database documentation, courses, and other training materials use the sample-schemas environment. These are a set of interlinked schemas that include a simple Human Resources (HR) schema, the Order Entry (OE) schema (of intermediate complexity), the Online Catalog (OC) subschema of the OE schema, the Product Media (PM) schema (dedicated to multimedia data types), the Information Exchange (IX) schema (that can demonstrate Oracle Advanced Queuing capabilities), and the Sales History (SH) schema (that is designed to allow for demos with large amounts of data). In this course, HR, OE, and SH schemas are used for examples and in some practice sessions. These schemas are covered on the following pages.Note

• Sample schemas are provided with Oracle Database. These can be installed automatically or manually depending on the installation options that you select. You can also install the required schemas by using the advanced or custom installation options.

• These schemas contain data about a global electronics retailer (a fictitious company), which sells several categories and subcategories of products through various channels.

Page 100: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 4

Copyright © 2008, Oracle. All rights reserved.

Human Resources (HR) Data Model

COUNTRIESCOUNTRY_IDCOUNTRY_NAME

REGION_ID

DEPARTMENTSDEPARTMENT_IDDEPARTMENT_NAME

MANAGER_ID

LOCATION_ID

EMPLOYEESEMPLOYEE_ID FIRST_NAMELAST_NAMEEMAIL

PHONE_NUMBERHIRE_DATEJOB_IDSALARY

COMMISSION_PCTMANAGER_ID

DEPARTMENT_ID

JOBSJOB_ID

JOB_TITLEMIN_SALARYMAX_SALARY

JOB_HISTORYEMPLOYEE_IDSTART_DATEEND_DATEJOB_ID

DEPARTMENT_ID

LOCATIONSLOCATION_IDSTREET_ADDRESSPOSTAL_CODE

CITYSTATE_PROVINCECOUNTRY_ID

REGIONSREGION_IDREGION_NAME

HR

Human Resources (HR) Data ModelThe company’s employee database is maintained in the Human Resource (HR) (schema) records. For example, each employee has an identification number, email address, job identification code, salary, and manager. Some employees earn commissions in addition to their salary. The company also tracks information about jobs within the organization. Each job has an identification code, job title, and a minimum and maximum salary range for the job. Some employees have been with the company for a long time and have held different positions within the company. When an employee resigns, the duration of the employment, the job identification number, and the department are recorded.The sample company is regionally diverse, so it tracks the locations of its warehouses and departments. Each employee is assigned to a department, and each department is identified either by a unique department number or a short name. Each department is associated with one location, and each location has a full address that includes the street name, postal code, city, state or province, and the country code.In places where the departments and warehouses are located, the company records details such as the country name, currency symbol, currency name, and the region where the country is geographically.

Page 101: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 5

Copyright © 2008, Oracle. All rights reserved.

Order Entry (OE) Data Model

PRODUCTINFORMATIONPRODUCT_IDCATEGORY

WEIGHT_CLASSWARRANTY_PERIODSUPPLIER_ID

PRODUCT_STATUSLIST_PRICE MIN_PRICECATALOG_URL

ORDER_ITEMSORDER_ID

LINE_ITEM_IDPRODUCT_IDUNIT_PRICEQUANTITY

ORDERSORDER_IDORDER_DATEORDER_MODECUSTOMER_IDSHIP_MODE

ORDER_STATUSSALES_REP_IDORDER_TOTAL

PRODUCTDESCRIPTIONSPRODUCT_ID LANGUAGE_IDPRODUCT_NAME

PRODUCT_DESCRIPTION

INVENTORIESPRODUCT_ID WAREHOUSE_ID

QUANTITY_ON_HAND

CUSTOMERSCUSTOMER_ID

CUST_FIRST_NAMECUST_LAST_NAMECUST_ADDRESS_TYPSTREET_ADDRESSPOSTAL_CODE

CITYSTATE_PROVINCECOUNTRY_ID

PHONE_NUMBERSCREDIT_LIMITCUST_EMAIL

ACCOUNT_MGR_IDNLS_LANGUAGENLS_TERRITORY

WAREHOUSESWAREHOUSE_IDWAREHOUSE_NAMELOCATION_ID

HR

OE

EMPLOYEES REGIONS

Order Entry (OE) Data ModelAs shown in the slide, the OE schema is interlinked with the HR schema. The OE schema contains data about orders, products, customers, inventory information, and so on. The company maintains information about products, such as product identification numbers, the category into which the product falls, order entry (OE), the weight group (for shipping purposes), the warranty period if applicable, the supplier, the availability status of the product, a list price, a minimum price at which a product is sold, and a URL address for manufacturer information. Inventory information is also recorded for all products, including the warehouse where the product is available and the quantity on hand. Because products are sold worldwide, the company maintains the names of the products and their descriptions in several languages.The company maintains warehouses in several locations to fulfill customer needs. Each warehouse has a warehouse identification number, name, facility description, and location identification number. Customer information is also tracked, which contains customer identification number, name, street name, city or province, country, phone numbers (up to five phone numbers for each customer), and postal code. Some customers place orders through the Internet, so email addresses are also recorded. Because of language differences among customers, the company records the native language and territory of each customer. The company places a credit limit on its customers to limit the amount of products that they can purchase at one time. Some customers have an account manager, and this information is also recorded.

Page 102: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 6

Order Entry (OE) Data Model (continued)When a customer places an order, the company tracks the date of the order, how the order was placed, the current status of the order, shipping mode, total amount of the order, and the sales representative who helped place the order. The sales representative may or may not be the same person as the account manager for a customer. If an order is placed over the Internet, no sales representative is recorded. In addition to the order information, the company also tracks the number of items ordered, the unit price, and the products ordered.

Page 103: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 7

Copyright © 2008, Oracle. All rights reserved.

Logging In to Oracle BI Publisher

Logging In to Oracle BI PublisherYou can log in to BI Publisher in one of the following ways:

• In a browser window, enter the URL for BI Publisher in the format:http://<hostname>:<port>/xmlpserver/ (for example, http://localhost:9704/xmlpserver/)The Log In page for BI Publisher appears. Enter a username and password given by the administrator. Click Sign In.

• If you installed BI Publisher along with Oracle BI Enterprise Edition, select All Programs > Oracle Business Intelligence > BI Publisher from the Start menu.Next, log in using the user credentials given to you.

Note: If you installed BI Publisher in stand-alone mode, select All Programs > Oracle -OracleHome > BI Publisher Server from the Start menu to log in.OracleHome refers to the name of the Oracle Home where you installed Oracle BI Publisher.

Page 104: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 8

Copyright © 2008, Oracle. All rights reserved.

Opening a Predefined Report

Opening a Predefined ReportWhen you log in to BI Publisher, the Welcome page is displayed. BI Publisher provides many predefined reports that can be seen in various folders in the Shared Folders section. You can open and view a report in BI Publisher as follows:

1. Click the Reports tab to see the list of predefined reports. 2. Click Shared Folders to see the list of folders and predefined reports provided with BI

Publisher. 3. Select a report for viewing. (For example, click the Revenue by Region report from the

Executive folder to open it in View mode).

Page 105: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 9

Copyright © 2008, Oracle. All rights reserved.

Viewing a Predefined Report

Viewing a Predefined ReportWhen you open a report in View mode, you can see the predefined templates for the report in the Template drop-down list. Select a template to view the report. Similarly, select a format (such as HTML, PDF, RTF, or POWERPOINT) to view the report. (In the example shown in slide, Charts is selected as the template, and PDF is selected as the format for viewing the report.)

Page 106: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 10

Copyright © 2008, Oracle. All rights reserved.

Setting Preferences

• General Preferences• Account Preferences

Setting PreferencesTo change the settings in BI Publisher, click the Preferences link in the upper-right corner of a BI Publisher page. You can change the following preferences:

• General Preferences: These are the generic settings, such as:- UI Language: The UI language is the language that your user interface is displayed in.

BI Publisher offers support for multiple languages. The language that you selected at login is selected as the default. You can select a language from the language options available in the drop-down list.

- Report Locale: A locale is a language-and-territory combination; for example, English (United States) or French (Canada). BI Publisher uses the report locale selection to determine the template translation to apply and the number formatting and date formatting to apply to the report data.Note: That particular report must have an available template translation for the selected locale, and this is discussed further in the lesson titled “Translating Reports.”

- Report Time Zone: Select the time zone to apply to your reports. Reports run by this user display the time according to the time zone preference selected here. However, the time displayed on the user interface and reflected in report processing times is governed by the BI Publisher Server time zone.

Page 107: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 11

Setting Preferences (continued)- SVG for HTML: You can choose to display graphics in the HTML reports using the

Scalable Vector Graphics (SVG) technology. Your browser may require a plug-in to enable SVG. If so, you are prompted to download this plug-in the first time you attempt to view an HTML graphic with SVG enabled. If you do not want to use the SVG plug-in, select No.

• Account Preferences: You can change the password settings for your account on the Account page.

- Password: To change your password, select the Account tab on the Preferences page. Next, enter your current password and your new password, as prompted.

Page 108: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 12

Copyright © 2008, Oracle. All rights reserved.

Creating a BI Publisher Report Based on Oracle Database

• Defining a Java Database Connectivity (JDBC) connection to the database

• Creating a new folder (optional)• Creating a new report and editing the properties• Defining the data model• Using Query Builder • Viewing the report data• Uploading an existing template• Exporting a report

Creating a BI Publisher Report Based on Oracle DatabaseBI Publisher supports report creation based on various data sources, including Oracle Database. The steps to create a BI Publisher report based on Oracle Database are listed in the slide, and are explained in detail on the following pages.

Page 109: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 13

Copyright © 2008, Oracle. All rights reserved.

Defining a JDBC Connection

1

2

Defining a JDBC ConnectionBefore creating a query based on Oracle Database, you must first define the JDBC connection details on the Admin tabbed page of BI Publisher.Perform the following steps to define a JDBC connection:

1. After logging in to BI Publisher as administrator, select the Admin tab. In the Data Sources section, click JDBC Connection.

2. On the JDBC Data Sources page that is displayed, click demo to edit the connection details for this data source.

Note: You can click Add Data Source to create a data source with a different name (for example, OrderEntry) instead of editing the demo data source.

Page 110: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 14

Copyright © 2008, Oracle. All rights reserved.

Defining a JDBC Connection

3

4

Defining a JDBC Connection (continued)3. On the Update Data Source page, enter the following connection details:

Connection String: This is of the following format:jdbc:oracle:thin:@<Host name>: <Port>:<SID>For example, a sample connection string may look like:jdbc:oracle:thin:@myhost:1521:orclUser Name: User or schema name in Oracle Database for which you are defining a connection (The example uses the OE schema for the connection.) Password: Password for the user Database Driver Class: oracle.jdbc.driver.OracleDriver (This is the default.)

4. Click Test Connection to see whether the database connection can be established successfully. When the confirmation message is displayed, click Apply to save the connection details that you defined.

Note: You should have administrator privileges to define a JDBC connection, or your BI Publisher Administrator should have created a connection for you. Other administrative and configuration tasks are described in the lesson titled “Oracle BI Publisher Server: Administration.”

Page 111: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 15

Copyright © 2008, Oracle. All rights reserved.

Creating a New Folder in BI Publisher

Creating a New Folder in BI PublisherIt is not mandatory to create a folder each time you create a report. However, it is always a good idea to segregate your reports into different folders for easy maintenance.Perform the following steps to create a folder in BI Publisher:

1. Click the Reports tab to go to the Reports page in BI Publisher.2. Click My Folders and then click the Create a New Folder link (found in the Folder and

Report Tasks section).3. Enter a name for the folder and click Create.

Page 112: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 16

Copyright © 2008, Oracle. All rights reserved.

Creating a Report

1

2

Creating a Report To create a report based on Oracle Database, perform the following steps:

1. Navigate to the folder where you want to create your report (for example, My Folders > Learn) and click Create a New Report.

2. Enter a name for the report and click Create.The report you created is displayed in the folder.

Page 113: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 17

Copyright © 2008, Oracle. All rights reserved.

Editing the Properties of a Report

Editing the Properties of a ReportYou edit the report created to define the data source, a new data model, and so on. Perform the following steps:

1. Click the Edit link displayed below the name of the report to open it in Edit mode. Observe the properties that are displayed under the Report node on the left.

2. In the General Settings section of Report Properties, select the data source (the JDBC connection that is defined) from the Default Data Source drop-down list.(In the example, the demo data source that is defined for the OE schema is used). Click the Save icon (in the upper-left corner) to save the changes.

Page 114: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 18

Copyright © 2008, Oracle. All rights reserved.

Defining the Data Model

Defining the Data ModelYou must define the data model for the report. Perform the following steps:

1. Click Data Model and click New to define a new data set for the report.2. On the Data Set page that is displayed on the right, enter a name and type for the data set.

The type can be one of the following:- SQL Query- HTTP (XML Feed)- Web Service- Data Template- Oracle BI Answers- File

In this case, select SQL Query to create a report based on Oracle Database. (The other data sets are discussed in later lessons.)

3. Ensure that a proper data source (the JDBC connection that you defined) is selected from the Data Source drop-down list.Select the Cache Results check box if you want the query results to be cached in the session.

Page 115: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 19

Copyright © 2008, Oracle. All rights reserved.

Using Query Builder

Defining the Data Model: Using Query BuilderBI Publisher provides a Query Builder for the ease of creating a SQL query. After defining the data set, click Query Builder to define the query. To build a query in Query Builder, perform the following steps:

1. Select schema: The Schema list contains all available schemas in the data source. Note that you have access only to the schemas that are defined by your connection.

2. Select objects from the Object Selection pane: The Object Selection pane lists the tables, views, and materialized views from the selected schema (for Oracle databases, synonyms are also listed). Select the object from the list and it displays on the Design pane. Use the Design pane to identify how the selected objects are used in the query. Note that if more tables are present in the data source, you can use the Search feature to locate and select the objects.

3. Select columns: Select the check box for each column to include it in your query. (A maximum of 60 columns can be selected to be included in a query.)

Page 116: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 20

Copyright © 2008, Oracle. All rights reserved.

Using Query Builder

Defining the Data Model: Using Query Builder (continued)4. Establish relationships between objects (optional): Identify the columns for join (for

example, DEPARTMENT_ID in the DEPARTMENTS table, and DEPARTMENT_ID in the EMPLOYEES table) and click the box beside one of these columns to mark it for join. (The box is disabled when marked for join.) Next, click the box beside the other column to create the join. A fine line appears between the tables to show the relation between the tables (observe the join line in the slide). You can create a join between tables, views, and materialized views.

5. Create query conditions (optional): Conditions enable you to filter and identify the data that you want to work with. As you select columns within an object, you can specify conditions on the Conditions tabbed page. You can use the attributes on the Conditions page to modify the column alias, apply column conditions, sort columns, apply functions, and so on. (When you select a column to include in your query, it appears as a separate row in the Conditions Output pane.)

6. Execute the query and view results: To execute the query and view results, select Results. When no errors are reported and the query displays valid results, click Save to save the query, and return to the Report Editor. Click Save again.

7. If you want to edit the query further, click Query Builder again. Query Builder parses the query and presents it for modification in the Query Builder interface.Note: After you edit the query manually, you cannot edit the query in Query Builder because parsing fails in this case.

Page 117: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 21

Copyright © 2008, Oracle. All rights reserved.

Viewing Report Data

Viewing Report DataYou may want to view the XML data in the report to see whether the query returns valid data.However, you must create templates to display this data in appropriate formats. On the Reports home page, select the report name; or, in the Folder view, select the View link for the report. This runs the report by using the default options and displays it in your browser. However, you can change the following options as appropriate:

• Report template: If multiple templates are available, they are displayed in the Template list. Select a new template and click View.

• Output type: If multiple output types are available, select the output type (for example, HTML, PDF, RTF, Excel, PowerPoint, CSV, or Data) from the list and click View. The output is rendered in your browser.

Note: You can also export report definitions and send the report to Email, Printer, Fax, and so on. Configuring report delivery options is discussed in lesson 9, “Oracle BI Publisher Server: Administration”.

Page 118: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 22

Copyright © 2008, Oracle. All rights reserved.

Uploading an Existing Template

Uploading an Existing TemplateWhen you create a BI Publisher report, only the XML data is displayed in View mode of the report. The report should be associated with a template for displaying data in a formatted fashion. You can create rich text format (RTF) templates by using BI Publisher Desktop, or you can upload an existing template file for a BI Publisher report. (Creating RTF templates is covered in the lesson titled “Creating Simple RTF Templates.”) Perform the following steps to upload an existing template file:

1. Open the report in Edit mode (click the Edit link). Click Layouts in the Report pane on the left to display the Create Layouts section on the right. Click Browse in the Manage Template Files section to browse and upload a predefined RTF template.

2. Navigate to the folder (on your local system) where the RTF template file is saved, select the appropriate file, and click Upload to upload the RTF template for the report.

3. Click Layouts again, and click New to create a report layout to associate it with the template uploaded.

4. In the Layout section that is displayed on the right, make sure that the RTF file uploaded is selected from the Template drop-down list and that the appropriate format is selected as the output format. Save the report.Note: Do not forget to click the Save icon (in the upper-left corner) when you make changes to the BI Publisher report.

Page 119: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 23

Uploading an Existing Template (continued)5. After uploading a template for a report, view the report data in various formats, such as

PDF, HTML, RTF, and MS Excel by using the template. Click View to open the report in View mode. Select the template that you uploaded from the Template drop-down list, select a data format (such as PDF) from the drop-down list, and click View to view the report.

Page 120: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 24

Copyright © 2008, Oracle. All rights reserved.

Exporting or Downloading a Report

Exporting or Downloading a ReportYou can export a report definition to various supported formats in BI Publisher. These downloaded reports give the flexibility of moving the reports from the development to the production environment. Perform the following steps to export or download a BI Publisher report and save it on your local file system:

1. (If not logged in) Log in to BI Publisher, navigate to the folder that has the report to be exported, and open the report in View mode. Select a template for the report, and a format (such as PDF or HTML) to display.

2. Click the Export link to export this report in the selected format. According to the format of the report selected, BI Publisher displays a dialog box prompting you to open or save the report. (For example, the dialog box for the PDF format is shown in the slide.) Similarly, if you select the HTML format, the file is opened in a new browser window, which can be saved on your local file system.

Note: You can also export the report data in XML format and save it on you local file system. In this case, the file is saved with an .xdo extension.

Page 121: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 25

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:• Describe the sample schemas used in course practices

(HR,OE, and SH)• Log in to Oracle BI Publisher and set up a database

connection• Create a simple report based on Oracle Database• Upload an existing template for the report and view data• Export a BI Publisher report

Page 122: D54122

Oracle BI Publisher 10g R3: Fundamentals 4 - 26

Copyright © 2008, Oracle. All rights reserved.

Practice 4: Overview

This practice covers the following topics:• Logging in to BI Publisher and creating a JDBC connection• Creating simple BI Publisher reports based on Oracle

Database• Uploading an existing template for a report to view data

Page 123: D54122

Copyright © 2008, Oracle. All rights reserved.

Creating Simple RTF Templates

Page 124: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:• Describe the functions and features of BI Publisher Desktop• Describe how to install BI Publisher Desktop• Create RTF templates for a sample report• Create and publish RTF templates for BI Publisher reports• Create RTF templates by using the following methods:

– Basic– Form field

• Insert tables,forms, and charts in RTF templates• Preview results

NoteIt is worth noting that Oracle BI Publisher Desktop was previously known as “Template Builder for Word” or just as “Template Builder.” In this course, these terms are used synonymously.

Page 125: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 3

Copyright © 2008, Oracle. All rights reserved.

Introduction to Oracle BI Publisher Desktop

What is Oracle BI Publisher Desktop?• An extension to Microsoft Word (2000 or later) that

simplifies rich text format (RTF) template creationOracle BI Publisher Desktop enables you to perform the following tasks:• Inserting data fields• Inserting data-driven tables• Inserting data-driven forms• Inserting data-driven charts• Previewing your template with sample XML data• Browsing and updating the content of form fields• Extracting boilerplate text into an XML Localization

Interchange File Format (XLIFF) translation file and testing translations

Introduction to Oracle BI Publisher DesktopRich Text Format (RTF) is a specification used by common word processing applications such as Microsoft Word. When you save a document, RTF is a file type option that you select. Oracle BI Publisher Desktop (previously known as Template Builder for Word) is an extension to Word, and simplifies the common tasks associated with creating RTF templates for Oracle BI Publisher reports.You can create report designs by using many design features of your standard Word application, and BI Publisher’s RTF template parser will recognize and maintain the design. In addition to Word’s formatting features, BI Publisher Desktop supports other advanced reporting features such as charts, conditional formatting, and running totals. BI Publisher Desktop provides easy-to-use wizards for inserting fields, tables/forms, charts, and cross-tabs. BI Publisher Desktop also enables you to preview reports by using the template in supported formats. It also supports translation features.

Page 126: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 4

Copyright © 2008, Oracle. All rights reserved.

Installing Oracle BI Publisher Desktop

BI Publisher Desktop can be installed from Oracle BI Publisher:

Installing Oracle BI Publisher DesktopPrerequisites for InstallationTo install Oracle BI Publisher Desktop, you must have:

• Microsoft Windows 2000 or later• Microsoft Word 2000 or later• Java SE Development Kit (JDK) 5 or later (This also includes Java Runtime Environment

[JRE].)• Microsoft .NET Framework 2.0 or later

Note: BI Publisher Desktop is already installed, and is available as a part of the lab environment. However, the steps for installation are listed briefly here.You can install Oracle BI Publisher Desktop from BI Publisher. Perform the following steps to install BI Publisher Desktop:

1. Log in to BI Publisher, and click the Template Builder link in the Developer Tools section to display the download dialog box for BI Publisher Desktop.

2. Click Run to directly run this file or Save to save this installable file on your local file system.

Page 127: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 5

Installing Oracle BI Publisher Desktop (continued)3. Follow the on-screen instructions displayed in the steps of the installation wizard: select the

setup language, specify the JRE location, destination location, and so on. (Optionally, you can also select the option to go through the tutorial provided for BI Publisher Desktop.)

4. At the message indicating successful installation is displayed, click Finish.

Page 128: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 6

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Desktop User Interface (UI)

Oracle BI Publisher Desktop UI consists of the following:• BI Publisher menu• BI Publisher toolbar

BI Publisher Desktop User Interface (UI) After you install BI Publisher Desktop successfully, when you open the Word application, you see the BI Publisher menu and the BI Publisher toolbar (menu bar) with various menus such as Data, Insert, Preview, Tools, and Help. These menus are explained in detail on the following pages.BI Publisher MenuThe Oracle BI Publisher menu includes functions that enable you to log on and interact with the BI Publisher Server; validate, preview, and publish templates; load data; insert various objects; and so on. A few important options are discussed here:

• Log On: This invokes the BI Publisher logon page. Enter your username and password. Select or enter the URL for the BI Publisher Report server. When you log on, the Open Template dialog box is displayed.Note: You must be granted one of the following roles to log on through BI Publisher Desktop: BI Publisher Administrator, BI Publisher Developer, or BI Publisher Template Designer.

• Open Template: This invokes the Open Template dialog box. This dialog box enables you to select reports from the BI Publisher Report server to create RTF templates for these reports.

Page 129: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 7

BI Publisher Desktop User Interface (UI) (continued)• Update Layout Template: If you used the Open Template dialog box to download a template

from the BI Publisher Server, use this option to upload the updated layout back to the report definition on the server.

• Publish Template As: If you used the Open Template dialog box to download a template or to open a report from the BI Publisher Server, use this option to upload the layout to the report definition on the server. Also use this option to upload modifications to an existing template under a different name.

Page 130: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 8

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Toolbar

BI Publisher ToolbarThe toolbar or menu bar gives you alternative access to much of the functionality provided by the Oracle BI Publisher menu. Data, Preview, and Help menus are discussed here; Insert and Tools are discussed on the following pages. Data MenuFrom the Data menu, you can select the data source for the template. The data source defines the XML format that is merged with the RTF template. You must load a data source to use most of the Template Builder functionality.

• Load XML Data: Using this option, you can load a sample XML file that contains all fields that you want to insert into your template as a data source. If you are not connected to the BI Publisher Server, use this method to load your data.

• Load XML Schema: With this option, you can load an XML Schema file (.xsd) that contains the fields available in your report XML data. The XML Schema has the advantage of being complete (a sample XML file may not contain all the fields from the data source). For the preview, the Template Builder can generate dummy sample data for an XML Schema. However, the preview works better if you also upload data from an actual sample.

Page 131: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 9

BI Publisher Toolbar (continued)Preview MenuThe Preview menu enables you to preview your RTF template with sample XML data. Use the Data menu to upload a sample XML file. The Preview menu offers you PDF, HTML, RTF, EXCEL, PowerPoint, and CSV as output formats. When you select any of these output formats, the Template Builder uses BI Publisher to merge the data into your template and create the output document.Note: You must have installed Adobe Acrobat Reader version 5.0 or later to preview documents in PDF format. Help MenuUsing the Help menu, you can access online Help. The “About” option gives information about the product, such as the copyright notice and the version of Oracle BI Publisher Desktop.

Page 132: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 10

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Toolbar: Tools

• Field Browser• Validate Template• Translate Template• Export• Options

BI Publisher Desktop: ToolsTools MenuThe Tools menu provides you with additional tools that help you translate and modify RTF templates for Oracle BI Publisher.

• Field Browser: The field browser is a tool for advanced users who need to change the BI Publisher commands hidden in the form fields. It shows the commands behind each form field and allows you to change them. Use this tool to correct flawed RTF templates or to update multiple fields efficiently.

• Validate Template: The validation function checks the template for incorrect use of BI Publisher commands and unsupported elements in the Word file.

• Translate Template:- Extract Text: This option enables you to create a standard XLIFF translation file

containing the boilerplate text from your template. The XLIFF file is a standard file format that is understood by many translation software packages. Preview Translation: Using this option, you can preview your template as a PDF file by using a specified XLIFF translation file. This functionality enables you to test translation files.

- Localize Template: This option applies a translation file to an RTF template. This means that, in your current RTF template, all boilerplate text is translated. The main function of this feature is to create a language-specific version of a template.

• Export: This enables you to convert RTF templates into an enhanced XSL-FO style sheet, FO-formatted XML, or PDF. This function can be used to generate XSL-FO for debugging or further customization.

• Options: This enables you to define some preferences and options for using BI Publisher.

Page 133: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 11

Copyright © 2008, Oracle. All rights reserved.

Setting Build Preferences

1

2

Setting Build PreferencesYou can determine how the Template Builder should generate tables and forms by setting build preferences:

1. In the Tools menu, select Options. (You can also select Oracle BI Publisher > Options.)2. Click the Build tab. The options on this page enable you to specify how the tables and forms

must be generated. After selecting the options, click OK.

Page 134: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 12

Copyright © 2008, Oracle. All rights reserved.

Build Options

Build OptionsThe Build options are described here:For-each form fieldYou may choose how BI Publisher Desktop creates form fields for processing instructions in the Insert Table/Form dialog box.

• The Descriptive option (for-each Invoice) renders a descriptive form field for processing instructions that makes the layout template easier to understand. However, the longer fields may be distorted in the visual layout of the template.

• The Abbreviated option (F) provides a one-letter abbreviation for each instruction.If the Hidden font effect check box is selected, the instruction text is generated with the hidden font effect of Microsoft Word. The hidden text is not visible in the print preview. Also, you may display or hide the text by selecting or deselecting the Hidden Text check box on the View tabbed page of the Microsoft Word Options dialog box.Table Header ColorYou may also choose the color of the table header columns for the generated tables in the Insert Table/Form dialog box.Note: You have inserted fields in the sample template. You can also insert tables and charts, and this is covered in more detail on the following pages.

Page 135: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 13

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Toolbar: Wizards

• Table Wizard• Table/Form• Cross Tab• Chart

BI Publisher Toolbar: WizardsBI Publisher also offers you easy-to-use, step-by-step wizards for inserting tables, forms, charts, and cross-tabs in your RTF templates. BI Publisher Desktop also provides you with easy-to-use wizards for creating conditional formats, conditional regions, and so on. Some of these wizards are discussed with examples in this lesson; the cross-tab wizard and conditional formats are discussed in the lesson titled “Advanced RTF Template Techniques.” Most of these wizards are provided through the Insert menu as discussed here:Insert MenuUsing the Insert menu, you can insert data fields and groups from the data source into the template:

• Field: This option enables you to select fields from your data source and insert them into your template.

• Table Wizard: This option provides you with a wizard that guides you through the creation of tables used in typical reports.

• Table/Form: This option enables you to insert tables or forms into your template. It opens the Insert Table/Form dialog box. From this dialog box, you can insert data fields to be organized as a simple or nested table or as a form that is repeated with different data. You may even organize all data fields for the whole document before inserting them.

• Cross tab: This option enables you to quickly insert a pivot table of your data. You can drag data elements to the cross-tab structure.

Page 136: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 14

BI Publisher Toolbar: Wizards (continued)Insert Menu (continued)

• Chart: BI Publisher does not recognize native Microsoft Word charts. With the Insert Chart option, you can insert a chart that is understood by Oracle BI Publisher. It opens the Insert Chart dialog box, where you can define parameters for your chart.

• All Fields: This option inserts all fields found in the XML data into your document. It also inserts processing instructions that repeat a section, such as a table row, when the associated XML element is repeated.

• Other options in the menu enable you to insert a conditional format, conditional region, and a repeating group.

Note: XML documents often contain a large number of fields in a deeply nested hierarchy. For example, an Oracle Purchasing purchase order contains purchase order lines, which contain shipments, which contain distributions. The purchase order line alone contains more than 150 data fields. In these cases, you must use the Insert Table/Form function to have more control over which fields are inserted.

Page 137: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 15

Copyright © 2008, Oracle. All rights reserved.

Creating an RTF Template from a Sample

Creating an RTF Template from a SampleA sample template file, Balance Letter.rtf, is shown in the slide. You often have a template from which to begin. Files used in this example and the associated lab files are found in the following location:D:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\samples\RTF templates\Balance Letter\

Note: The default location for sample files is:D:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\samples

Also, the template and lab files are provided in the D:\Labs\BIP_10.1.3.3._Labs folder for this course on your system.

Page 138: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 16

Copyright © 2008, Oracle. All rights reserved.

Creating an RTF Template: Loading the Sample XML Data

Creating an RTF Template: Loading the Sample XML Data 1. Select Load XML Data from the Data menu. 2. Open the Balance.xml file as your XML sample data from the samples folder. When the

XML data is loaded, a message indicating the successful loading of data is displayed.Note: You can also open a BI Publisher report to load the data. You must keep the template open while you load the data.

Page 139: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 17

Copyright © 2008, Oracle. All rights reserved.

Creating an RTF Template: Inserting Fields

Creating an RTF Template: Inserting FieldsUsing the Insert Field feature, you can select data elements defined in the data source (that is, the XML file) and insert them into the template. Position the cursor in the Word document where you want to insert a field (for example, Customer Name). From the Insert menu, select Field to open the Field dialog box. The Field dialog box shows the structure of the data source in a tree view. Select <CUSTOMER_NAME> and click Insert.Similarly, insert other fields: <ADDRESS_LINE_1>, <ADDRESS_LINE_2>, <ADDRESS_LINE_3>, <ADDRESS_LINE_4>, <CITY>, <STATE>, and <ZIP>When you insert a field in a template, a text form field, with hidden BI Publisher commands (in the Help text of the form field), is inserted at the cursor position in the template.You may either select and insert additional data fields or close the dialog box by clicking the Close button. Using the Insert Field dialog box, set the other fields in the RTF template, such as <AS_OF_DATE>, <TRX_CURRENCY_CODE> , and <C_INV_OPEN_BALANCE>.

Page 140: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 18

Creating an RTF Template: Inserting Fields (continued)Note

• Throughout the same template file, you see placeholders, such as <INSERT ADDRESS HERE>. You must remove these placeholders, and replace them with appropriate fields.

• You must also adjust the position of the cursor, typically by pressing the Enter key, when inserting fields. Otherwise, all fields may appear on the same line.

• You can also drag the fields from the Field window into your template. At this point, you must insert fields only for unique data fields. You handle the data table in the next section.

Page 141: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 19

Copyright © 2008, Oracle. All rights reserved.

Creating an RTF Template: Previewing Data

In the Preview menu, select your format to view data.

This example shows the RTF format.

Creating an RTF Template: Previewing DataSelect a format from the Preview menu. You can also select a format from BI Publisher> Preview Template. Before previewing your work, be certain to perform a Save As instead of Save.Your choice of preview formats are:

• PDF to see the document in Acrobat Reader• HTML to see the document in your browser• RTF to see the document in Microsoft Word• EXCEL to see the document in Microsoft Excel

Page 142: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 20

Copyright © 2008, Oracle. All rights reserved.

Creating an RTF Template: Inserting a Table

Creating an RTF Template: Inserting a Table From the Insert menu, select Table/Form to open the Insert Table/Form dialog box. The Insert Advanced Table/Form dialog box is the most flexible tool of the Template Builder. It enables you to perform the following tasks:

• Create a simple or nested table with a variable number of rows• Associate a group of data elements, such as a complete invoice or a purchase order line, with a

form in the document that is repeated for each occurrence of the data element• Select and define a layout for all data fields in the template• Group or regroup the data

The Insert Table/Form dialog box displays two tree view panes. The left pane shows the data source structure, and the right pane shows the elements that were selected.Note: Oracle BI Publisher Desktop generates the table by using Build Options settings that you specified previously. The following example uses descriptive instructions.Example: The document must include a table of all invoices that are not paid or only partially paid. To open the Table/Form dialog box, select the <INSERT TABLE OF INVOICES HERE> label. Next, select Insert > Table/Form.

Page 143: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 21

Copyright © 2008, Oracle. All rights reserved.

Selecting Data Fields

Drag the data sources to the Template pane.

Selecting Data FieldsFirst, select the data fields that you want to insert in the template and then define how to format them. Drag an XML element from the left Data Source pane to the right Template pane to select it. If the XML element has children, you will see a pop-up menu with the following options:

• Drop Single Node: Select this option if you want to move only the selected node.• Drop All Nodes: Select this option if you want to move the node and all its children.• Cancel: This cancels the selection.

If you drag an additional data field from the left Data Source pane to the right Template pane, it is either inserted at the same level (Same Level) or below the node (Child) where you release the node. The Insert Position box defines which way the node is inserted.Note: If you use the left mouse button for the drag-and-drop operation, the node and all children are copied. However, if you use the right mouse button for dragging, a dialog box appears when you release the mouse button. The dialog box gives you the option to copy either only the selected node or the selected node and all the children.Example: Drag G Invoices from the Data Source pane to the Template pane. Choose Drop All Nodes in the pop-up menu.

Page 144: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 22

Copyright © 2008, Oracle. All rights reserved.

Removing Selected Fields

Removing Selected FieldsYou can also remove fields from the Template pane by selecting a field and pressing the Delete key. Only one field may be deleted at a time.Example: After selecting the Drop All Nodes option, G Invoices and all its child fields are added to the Template pane, as shown in the slide. Now, delete all the child fields except:

• Trx Number• Transaction Date• Trans Amount• Trans Amount Remaining

Alternatively, you could have selected G Invoices, chosen Drop Single Node, and then dragged over just the children that you want to include in your table.

Page 145: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 23

Copyright © 2008, Oracle. All rights reserved.

Completing the Table

Completing the TableClick a parent node element in the Template pane to preview how the data fields are formatted. In the slide example, the G Invoices element is selected in the Template pane. The Properties and Preview regions on the right show how the data fields are formatted.For each group, you can set the following properties that describe how a group (such as G Invoices) must be rendered by Oracle BI Publisher Desktop:

• Style: Select Table to create a table around the data fields.• Grouping: Grouping is an advanced operation that enables you to regroup data—for example,

by transaction date instead of currency. You can select the element that the data must be grouped by for this property. Refer to the Oracle BI Publisher User’s Guide for additional information about grouping.

• Show Grouping Value: This property is shown only if you have selected a node created by the Grouping functionality. You can choose for a group if the Data Field node that is used as a grouping criterion is shown in the table or form.

• Sort By: You can select an element by which data groups are sorted.• Sort Order: If you have selected an element for the Sort By operation, you can select if the data

should be sorted in ascending or descending order.

Page 146: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 24

Completing the Table (continued)• Sort Data Type: If you have selected an element for the Sort By operation, the data is sorted as

Text by default. That means that 12 will be shown after 111. If you need to sort numbers, you must select Number as the sort data type.

• Break: This property enables you to insert a page break or a section break between every data group. If nothing is selected, the data groups are shown continuously with no break. If you select New Page per Element, a page break will be inserted between each element. If you select New Section per Element, a section break will be created for each data group. A section break allows changing the header/footer and resets the page number. You typically use this option if you want to print multiple documents (for example, invoices or purchase orders) to a single PDF file.

Click the OK button to create the table.Note: The order in which the data elements are shown reflects the order of the columns in the table. If you want to reorder the columns, you must change the option in Insert Position from Child to Same Level. Then drag the elements into the correct order.

Page 147: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 25

Copyright © 2008, Oracle. All rights reserved.

Resulting Table

The resulting table should look like the following:

Resulting TableOracle BI Publisher Desktop creates two kinds of form fields:

• Form fields representing data elements• Form fields with processing instructions for repeating table rows or a repeating document

sectionForm fields representing data elements are replaced with the data when the template is processed. The “F TRX_NUMBER” and “TRANS_AMOUNT_REMAINING E” form fields indicate a repeating section (F stands for for-each, and E for end). The section of the document encapsulated by these two form fields is repeated if the associated data element, G_INVOICE, is found repetitively in the data. You can now format these elements in Microsoft Word and add more text. You can also move fields around as long as you keep them in the surrounding for-each G_INVOICES and end G_INVOICES processing instructions. If you remove one of these processing instructions, your template may not work with Oracle BI Publisher.You can now preview the template again to review your current template (see the slide). You probably want to change the alignment of the table columns or change the data type and format for the amounts. For example, select the TRANS_AMOUNT field, right-click, and select Properties to see the Text Form Field Options dialog box.

Page 148: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 26

Copyright © 2008, Oracle. All rights reserved.

Changing Field Properties

Changing Field PropertiesBI Publisher enables you to change the properties and format of the fields. Double-click a field to edit the properties (for example, the TRANS_AMOUNT field). This opens the BI Publisher Properties dialog box. (This dialog box can also be opened by using the shortcut menu of a field.) You can change the properties of the fields in Word. Click Word Properties to open the Form Field Properties dialog box and edit the format as follows: Select Number in the Type field, enter #,##0.00 for the number format, and enter 1,000.00 as the default number to achieve a more desirable format for currencies in US dollars. Formatting options defined in this dialog box are understood by Oracle BI Publisher and used to format your fields. Try to modify the template to get an idea of which Word functions are supported by Oracle BI Publisher.Note: It is recommended that you do not use currency signs such as $ in the format string, especially if you are using multiple languages with a single template or the translation, because it may lead to difficulties.Example: Set the field properties shown in the slide to both the TRANS_AMOUNT and TRANS_AMOUNT_REMAINING fields. Then, in Word, set all columns except Transaction Date to display right-justified.

Page 149: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 27

Copyright © 2008, Oracle. All rights reserved.

Previewing the Table Data

Previewing the Table DataSelect a format such as PDF, RTF , HTML, or PowerPoint from the Preview menu to preview the data. Before you preview your work, be sure to save it.

Page 150: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 28

Copyright © 2008, Oracle. All rights reserved.

Practice 5-1: Overview

This practice covers creating an RTF template for a sample report.

Page 151: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 29

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Charts

BI Publisher ChartsBI Publisher’s charting feature is based on Oracle Business Intelligence Beans, and it offers all chart types provided by that module. BI Publisher supports almost 70 different graph types and variations, and you can choose one of them for your template. A few sample BI Publisher charts are shown in the slide. Note: Oracle BI Publisher does not support native Microsoft Word charts. You must create charts by using the Oracle BI Publisher Desktop chart wizard (use the Insert > Chart option). Chart types and other Chart options provided in the wizard are discussed in detail on the following pages.

Page 152: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 30

Copyright © 2008, Oracle. All rights reserved.

Creating an RTF Template: Inserting a Chart

Creating an RTF Template: Inserting a ChartTo insert a chart, you use the following sample files:

• Open the following file: D:\Program Files\Oracle\BI Publisher Desktop\samples\RTF templates\Sales Report\Retail Sales Start.rtf

• Load the RetailSales.xml file in the D:\Program Files\Oracle\BI Publisher Desktop\samples\RTF templates\Sales Report folder by selecting Load XML Data in the Data menu. (This data contains retail sales data for different industries. You create a chart that shows sales per industry.)

Select Insert > Chart or BI Publisher > Insert > Chart. Use the Chart dialog box to insert a data-driven chart into a template.The data source pane shows the structure of the XML data. You notice that you can select only some of the nodes—the data group nodes. Data group nodes (parent nodes) are nodes that have child nodes. They typically do not represent data attributes, but groups of data, such as an invoice, a purchase order, a purchase order line, or a shipment.Select a data group node in the data source pane that you want to associate with the graph. For example, you may have multiple invoices in a single XML document. If you select the root node containing all invoices, the graph is calculated over all invoices. However, if you select the invoice node, the graph is calculated using the data for a single invoice.

Page 153: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 31

Creating an RTF Template: Inserting a Chart (continued)

Chart OptionsChart TypeThe current version of BI Publisher offers many graph types, and you can choose one of the following options available from the wizard:

• Bar Graph - Vertical• Bar - Vertical - Percent• Bar - Vertical - Stacked• Bar Graph - Horizontal• Bar - Horizontal - Percent• Bar - Horizontal - Stacked• Pie Chart • Line Graph• Line-Percent• Line-Stacked• Area Graph• Area-Percent• Area-Stacked• Ring Graph• 3-D Bar Graph• Radar Graph• Pareto Graph

Values Drag the data value of interest to the Values field (for example, Revenue). AggregationYou can choose to aggregate the Values data as a sum, a count, or an average.LabelsDrag the data element for which you want to see the Value charted (for example, Region). Select Group Data to group the label element before rendering it in the chart. For example, if you are charting Revenue by Region, selecting Group Data accumulates the values for Region, so that only one occurrence of each region appears in the chart. If you do not select Group Data, the value for every occurrence of Region in the data is plotted separately.Series Drag the element to display as a series in the chart.StyleSelect a color scheme and style for your chart.

Page 154: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 32

Copyright © 2008, Oracle. All rights reserved.

Defining a Chart

Defining a ChartTo create the chart as shown in the slide, ensure that Row is selected in the data source pane, and perform the following actions:

• For Type, select Pie Chart.• For Values, select Sales.• For Measure, select Sum.• For Labels, select Industry.• Click Preview to preview the graph, and click OK.• You can also select a Style to have an appropriate color theme for your graph.

Page 155: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 33

Copyright © 2008, Oracle. All rights reserved.

Previewing the Chart

Previewing the ChartSelect Preview > PDF/RTF or Oracle BI Publisher > Preview > PDF/RTF. The slide example shows what the chart looks like if you select the RTF format.Note: Remember to save before you preview.

Page 156: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 34

Copyright © 2008, Oracle. All rights reserved.

Practice 5-2: Overview

This practice covers creating a chart in the RTF template for a sample report

Page 157: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 35

Copyright © 2008, Oracle. All rights reserved.

Designing an RTF Template for a BI Publisher Report

1. In MS Word, create a document and log in to BI Publisher.2. Open the BI Publisher report (to load XML data).3. Define an RTF template by using wizards:

• Add a table.• Add a chart.

4. Preview the data in the report by using the template.5. Upload the template to BI Publisher Enterprise Server, and

view data.

Designing an RTF Template for a BI Publisher ReportPreviously, you created an RTF template for sample data. To create an RTF template for any of the reports created in BI Publisher, you must perform the steps listed in the slide. These steps are discussed in detail on the following pages. To exemplify the steps, the “Based on Oracle DB” report that you have created in the lesson titled “Getting Started with BI Publisher: Creating a Simple Report” is used.

Page 158: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 36

Copyright © 2008, Oracle. All rights reserved.

Step 1: Open MS Word and Log In to BI Publisher

Step 1: Open MS Word and Log In to BI Publisher1. Open the MS Word application, and create a document. From the BI Publisher menu, select Log

On. 2. On the Login page that appears, enter the username and password (for example, Administrator/Administrator), and click Login.

3. The first time you connect to BI Publisher from MS Word, you may be asked for the report server URL. Enter the URL, which is of the format: http://<Host>:9704/xmlpserver

When you log in to BI Publisher, the Open Template window is displayed.

Page 159: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 37

Copyright © 2008, Oracle. All rights reserved.

Step 2: Open the BI Publisher Report

Step 2: Open the BI Publisher Report1. In the Open Template window, ensure that BI Publisher is selected from the Workspace drop-

down list.2. Navigate to your working folder (My Folders > Learn) and select the report (in this example,

Based on Oracle DB) for which you want to create an RTF template. Click Open Report. Note: When you open the report, you will not see any data in the MS Word document. But this loads the XML data definitions from the report to facilitate the defining of a template. Also, you see that the report name is displayed in the title bar in MS Word beside the document name.

Page 160: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 38

Copyright © 2008, Oracle. All rights reserved.

Step 3: Define the RTF Template: Add a Table

Step 3: Define the RTF Template: Add a TableBI Publisher Desktop provides easy-to-use wizards to add tables, forms, charts, and other report elements. Perform the following steps to add a table in the report template:

1. Select Insert > Table Wizard from the BI Publisher toolbar to define a table format for the report query. This displays the Table Wizard. Select Table and click Next.

2. Select ROWSET/ROW as the grouping field (this is the default), and click Next.3. Click Select All (>>) to include all the available columns. Alternatively, use the Select (>)

button to select the columns individually. Click Next.4. Select options in the Group By fields. In the example, select Department Name in the Group By

field, and the Group above or Group left options as appropriate. Observe the other options in this step. Click Next.

5. Select options in the Sort By fields and the other Sort options—for example, you may want to sort the report by the descending order of the Salary field or by the ascending order of the Hire Date field. Click Next.

6. Edit the labels of the columns as required, and click Finish.

Page 161: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 39

Copyright © 2008, Oracle. All rights reserved.

Form Fields in RTF Templates

Form fields are Word objects that enable you to refer to other data.BI Publisher uses form fields to:• Reference data fields from the report definition • Embed instructions that control how the data fields are laid

out in the table

Form Fields in RTF TemplatesAfter adding the table, you see that the BI Publisher Desktop Template Builder created a table for you (which looks like the one in the slide). Notice the fields and letters with the gray background. These are called form fields. Form fields are Word objects that enable you to reference other data (for example, a mail merge letter). BI Publisher uses form fields in two ways:

• To reference data fields from the report definition (such as Employee Name, Salary)• To embed instructions that control how the data fields will be laid out in the table (such as G that

stands for “group by,” F for “for each,” and E for “end”).It is important to treat these form fields carefully and not accidentally delete or move them. Otherwise, the layout of the table in your report will be changed. You can add or modify your own form fields with XSL commands to do more sophisticated things with the table layout. You can additionally use MS Word’s native formatting features in this template, such as changing the background and text colors, adding a title, and so on. This is covered in the lesson titled “Advanced RTF Template Techniques.”

Page 162: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 40

Copyright © 2008, Oracle. All rights reserved.

Step 3: Define the RTF Template: Add a Chart

Step 3: Define the RTF Template: Add a ChartYou can also add a chart in the template. (In the example, you can add a chart to display the average employee salaries by department.)

1. To add a chart to the template, select Insert > Chart.2. In the Chart window that appears, define graph characteristics by performing the following

actions:- Drag Salary to the Values field and Department Name to the Labels field. - Select Average from the Aggregation drop-down list. - Select Pie Chart from the Type drop-down list. - Click Preview to preview how the graph looks like, and click OK.

3. Save the template as an RTF file. - In MS Word, select the File > Save As option. - Enter a name for the RTF template file, and click Save.

Do not close the file or log off BI Publisher. Note: You can save the file in any local folder on your system, but you must save the template in the .rtf format (not in the .doc format).

Page 163: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 41

Copyright © 2008, Oracle. All rights reserved.

Step 4: Preview the Data by Using the Template

Step 4: Preview the Data by Using the TemplateBefore you publish the report, you can see how data in the report is displayed by using the template. Select Preview > PDF to preview data by using the template you created.The data and graph are shown in the slide.

Page 164: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 42

Copyright © 2008, Oracle. All rights reserved.

Step 5: Upload the Template and View Data

Step 5: Upload the Template and View Data1. In MS Word, select Oracle BI Publisher > Upload Template As.

Note: If you have not saved the template in RTF format, it may prompt you to save the template in RTF format before publishing the template.

2. The “Upload as new” dialog box appears. Enter a name for the template, and click OK. 3. After the template is uploaded, a confirmation message indicating that the template is added to

the BI Publisher report is displayed. Click OK again. 4. You can now log in to BI Publisher Enterprise and view the report by using the template

uploaded.

Page 165: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 43

Copyright © 2008, Oracle. All rights reserved.

Practice 5-5: Overview

This practice covers creating and publishing an RTF template for the BI Publisher report that you created in Practice 4.

Page 166: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 44

Copyright © 2008, Oracle. All rights reserved.

Methods for Creating RTF Templates

Although there are virtually unlimited ways to create RTF templates for Oracle BI Publisher, only two methods are supported:• Basic RTF method• Form field method

Methods of Creating RTF TemplatesSo far you have seen how you can build up on an existing template. BI Publisher supports mainly two methods for creating RTF templates:

• Basic RTF method: With any word-processing application that supports RTF version 1.6 (or later), design a template by using Oracle BI Publisher’s simplified syntax.

• Form Field method: Using Microsoft Word’s form field feature, place the syntax in hidden form fields rather than directly into your design. Oracle BI Publisher supports this using Microsoft Word 2000 (or later) on a system that runs Microsoft Windows 2000 (or later). The form field method relies upon the Oracle BI Publisher Desktop plug-in that works only with Microsoft Word 2000 and later.

Page 167: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 45

Copyright © 2008, Oracle. All rights reserved.

Basic Method: Example

Basic Method: ExampleIn your lab environment, the User Listing Start 2.rtf file can be found at the following directory path: D:\Labs\ BIP_10.1.3.3._Labs\Templates\User Listing\For this class, you use Microsoft Word to create and edit your RTF files. But any program capable of creating and editing RTF files can be used for the basic method.Start with the User Listing Start 2.rtf file. Edit the RTF template by using the basic method to place the fields:

1. In Microsoft Word, open the User Listing Start 2.rtf file.2. In the template, replace all text in < > (angle brackets) with the appropriate Oracle BI Publisher

tags.3. Enter <?USER_NAME?> in the User Name field.4. Enter <?for-each:G_RESPS?> and <?APPLICATION_NAME?> in the Application Name

column of the table.5. Enter <?RESPONSIBILITY_NAME?> and <?START_DATE?> in the corresponding

columns.6. Enter <?END_DATE?> and <?end for-each?> in the End Date column of the table.7. Save the new template as User Listing End 2.rtf.8. Exit Microsoft Word.

Page 168: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 46

Copyright © 2008, Oracle. All rights reserved.

Form Field Method: Example

Form Field Method: ExampleIn your lab environment, the User Listing Start.rtf file can be found at the following directory path: D:\Labs\ BIP_10.1.3.3._Labs\Templates\User Listing\For this class, you use Microsoft Word to create and edit RTF files. The form field method relies on the Oracle BI Publisher Desktop plug-in that works only in Microsoft Word 2000 and later.Start with the User Listing Start.rtf file. Edit the RTF template by using the form field method to place the fields:

1. In Microsoft Word, open the User Listing Start .rtf file.2. Load the XML data file FNDSCURX.xml by selecting Data > Load XML Data. 3. In the template, replace all the text in < > (angle brackets) with appropriate Oracle BI Publisher

tags.4. Now insert fields in the templates. Select the <INSERT USER NAME HERE> placeholder in

the template file, and from the Oracle BI Publisher Desktop menu, select Insert > Field. When the Field selector opens, select USER_NAME from the list, and then click Insert.Note: You can see that the USER_NAME field is inserted in the RTF template. Notice that the USER_NAME field is gray, indicating that it is a form field.

Page 169: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 47

Copyright © 2008, Oracle. All rights reserved.

Form Field Method:Creating a Data Table

Form Field Method: Creating a Data Table5. Create a data table for the rest of the data. Unlike the basic method, you are not going to start

with a table created for you. You are going to let Oracle BI Publisher Desktop create one for you.

6. Choose Insert > Table/Form. (The Insert Table/Form dialog box appears.)7. Click G_RESPS in the Data Source pane, and drag this group to the Template pane.8. You are prompted to select Drop Single Node, Drop All Nodes, or Cancel. Select Drop All

Nodes to grab the four fields beneath G_RESPS.9. Click OK in the Insert Table/Form window to save your work and then return to the template.

(The images in the slide show what the Template pane looks like when you drop all the nodes.)10. Save your template as User Listing End.rtf.

Page 170: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 48

Copyright © 2008, Oracle. All rights reserved.

Completed Template

Your completed template should look similar to the following:

Completed TemplateWhen you return to your template, note that the wizard created the table, the fields in the table, and the repetitive section defined with the <for-each> and <end> tags.

Page 171: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 49

Copyright © 2008, Oracle. All rights reserved.

Previewing the Report

Previewing the ReportYou can preview your results in Microsoft Word. Select Preview > PDF to view the report in PDF. (You can also select any of the other supported formats such as HTML, RTF, EXCEL, PowerPoint, and so on.)If you have done everything correctly, Adobe Acrobat Reader should open with the output of your

report. If not, you have done something in error and you must return to Microsoft Word to edit your file until it produces the correct output.

Page 172: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 50

Copyright © 2008, Oracle. All rights reserved.

Practices 5-3, 5-4: Overview

These practices cover creating an RTF template for a report by using the following methods:• Basic (Practice 5-3)• Form field (Practice 5-4)

Page 173: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 51

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:• Describe the functions and features of BI Publisher Desktop• Describe how to install BI Publisher Desktop• Create RTF templates for a sample report• Create and publish RTF templates for BI Publisher reports• Create RTF templates by using the following methods:

– Basic– Form field

• Insert tables, forms, and charts in RTF templates• Preview the results

Page 174: D54122

Oracle BI Publisher 10g R3: Fundamentals 5 - 52

Copyright © 2008, Oracle. All rights reserved.

Practice 5: Overview

This practice covers the following topics:• Creating simple RTF templates by using sample reports or

files• Creating RTF templates by using basic and form field

methods• Creating and publishing RTF templates for BI Publisher

reports• Adding fields, table, and charts to RTF templates• Modifying RTF templates • Previewing results

Page 175: D54122

Copyright © 2008, Oracle. All rights reserved.

Advanced RTF Template Techniques

Page 176: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:• Use native MS Word features to format RTF templates• Use other advanced features

Page 177: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 3

Copyright © 2008, Oracle. All rights reserved.

Know Your Data

Oracle BI Publisher does not provide an automated (intelligent) mapping mechanism. There are two useful methods for exploring and understanding data:• Looking at raw XML data• Looking at the data structure in Oracle BI Publisher Desktop

Know Your DataIn the lesson titled “Creating Simple RTF Templates,” you explicitly included certain fields or typed certain tags, such as <?USER_NAME?>. But how do you know what to enter or what to include using the drag-and-drop operation? BI Publisher does not provide an automated mapping mechanism; you must understand the data you are using and then correctly map it so that it appears properly in your report.Your template content and layout must correspond to the content and hierarchy of the input Extensible Markup Language (XML) file. Each data field in your template must map to an element in the XML file. Each group of repeating elements in your template must correspond to a parent-child relationship in the XML file. Specifically, to map data fields, you define placeholders. To designate repeating elements, you define groups.

Page 178: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 4

Copyright © 2008, Oracle. All rights reserved.

Looking at Raw XML Data

This snippet of XML data is a sample of what you may be provided:

Looking at Raw XML DataEach data field in your report template must correspond to an element in the XML file. When you mark up your template design, you define placeholders for XML elements. The placeholder maps the template report field to the XML element. At run time, the placeholder is replaced by the value of the element of the same name in the XML data file.The slide shows a good example of data coming from an outside source. In this case, the data was produced by Oracle Reports running from within an Oracle 11i E-Business Suite database and querying the user data from that system. But it is not uncommon for XML coming from other data systems to produce unnecessary XML tags before the first tag of interest. Most raw XML data can be difficult to read (except the simplest data). Because it is difficult, you may make errors in interpreting the data.In this data, the first tag of interest is the <USER_NAME>SYSADMIN</USER_NAME> tag.Notice the group data, <G_RESPS>, beneath the <USER_NAME> tag.Note: Only a portion of the file is shown in the slide, so all the closing tags are not present.

Page 179: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 5

Copyright © 2008, Oracle. All rights reserved.

Looking at the Data Structure in Oracle BI Publisher Desktop

The Field dialog box (accessed by selecting Insert > Field) is less error-prone. You can see tabular structures more easily.

Looking at the Data Structure in Oracle BI Publisher DesktopSelect Insert > Field to see the data structure in BI Publisher.In the Field dialog box, you can select data elements defined in the data source (that is, the XML file) and insert them into the template.The dialog box shows the structure of the data source in a tree view. As you have already learned, you select a field that represents a single data field (a leaf node of the tree) and click Insert to place a text form field with hidden BI Publisher commands (in the Help text of the form field) at the cursor position in the template.Note: You can also select Insert >Table/Form to see the data structure.

Page 180: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 6

Copyright © 2008, Oracle. All rights reserved.

Underlying Tags

In the basic method:XML data = <USER_NAME>Placeholder = <?USER_NAME?>But how does the form field method create tags?

Underlying TagsIn the basic method, it is easy to see the relationship between the XML data and the tag as indicated in the slide. The form field tags are discussed on the next page.

Page 181: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 7

Copyright © 2008, Oracle. All rights reserved.

Form Field Method Tags

Observe the properties of the field:

Form Field Method TagsYou can view Form Field tags by selecting Properties of a field. Right-click a field and select Properties to open the BI Publisher Properties. Observe the general and advanced properties. Also, click Word Properties to see Text Form Field Options, and click Add Help Text to see the Form Field Help Text. Note that the placeholder, even with the form field method, is still <?USER_NAME?>, which is what it would be if you used the basic method.

Page 182: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 8

Copyright © 2008, Oracle. All rights reserved.

Additional Tag Space

There are two places to put tags:• Status Bar (first) • Help Key (F1) (second)

Additional Tag SpaceYou can add tags at two places: Status Bar and Help Key (F1). However, the form field method has a limitation. The Status Bar part of Additional Help Text is limited to 138 characters. The Help Key (F1) part is limited to 255 characters. These two areas are simply concatenated with Status Bar appearing first, followed by Help Key (F1). So, in total, you are limited to 393 characters. If you have placeholders that stretch capabilities, or if you use advanced functions that go beyond 393 characters, you must use the basic method.Pre-markup Layout:Oracle BI Publisher converts all formatting that you apply in the word processing program to XSL-FO, but some features of your word processor may not be mappable to XSL-FO.

Page 183: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 9

Copyright © 2008, Oracle. All rights reserved.

RTF Template: Design Considerations

• Premarkup layout• Supported MS Word–native formatting features• Adding markup• Images and charts• Template features• Conditional formatting• Page-level calculations• Data handling• Variables, parameters, and properties• Advanced report layouts

RTF Template: Design ConsiderationsConsider the points in the slide for creating an efficient design for RTF templates. BI Publisher supports the use of all these features. Most of these features are also supported in BI Publisher Desktop. More details about advanced template techniques are presented on the following pages.Note: For more information about the supported features for designing templates, see the Oracle BI Publisher User’s Guide.

Page 184: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 10

Copyright © 2008, Oracle. All rights reserved.

Supported MS Word Native Formatting Features

• Alignment• Fonts, background, text colors• Table formats• Inserting clip arts and images• Inserting headers and footers• Date fields• Including watermarks• Page breaks, and so on

Supported MS Word Native Formatting FeaturesBI Publisher supports many native formatting features of MS Word when you use BI Publisher Desktop to create and edit templates. A few of these features are listed here:General features:

• Large blocks of text• Fonts, background, and text colors• Page breaks and page numbering• Alignment (supported for text, graphics, objects, and tables)• Bidirectional languages handled automatically using a word processing application’s left and

right alignment controlsTable formatting:

• Nested tables, autoformatting of tables, and repeating table headers• Cell alignment, cell patterns, and colors• Row and column spanning• Rows prevented from breaking across pages• Fixed-width columns• Truncated fields

Date fields: They correspond to the publishing date, and not the request run date.Multicolumn page support: This enables you to use the multiple column function from Microsoft Word to publish your output.

Page 185: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 11

Copyright © 2008, Oracle. All rights reserved.

Adding Markup

Additional markup features:• Placeholders:

– <?XML element tag name?>

• XML data value (example):– <?USER_NAME?>

• Groups (example):– <?for-each:USER_NAME?>

– <?end for-each?>

Advanced markup features:• Headers and footers:

– Use native RTF headers and footers.• Subtemplates

Adding MarkupAdditionally, you can add the markup (for placeholders, groups, and so on) in the templates. You can easily mix manual markup and the markup done in Oracle BI Publisher Desktop. In fact, Oracle BI Publisher Desktop simply uses the hidden form field method available in Microsoft Word 2000 (and later).Identifying Placeholders and GroupsYour template content and layout must correspond to the content and hierarchy of the input XML file. Each data field in your template must map to an element in the XML file. Each group of repeating elements in your template must correspond to a parent-child relationship in the XML file.PlaceholdersEach data field in your report template must correspond to an element in the XML file. When you mark up your template design, you define placeholders for XML elements. The placeholder maps the template report field to the XML element. At run time, the placeholder is replaced by the value of the element of the same name in the XML data file.

Page 186: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 12

Adding Markup (continued)Defining GroupsBy defining a group, you are notifying Oracle BI Publisher that for each occurrence of an element (parent), you want the included fields (children) displayed. At run time, Oracle BI Publisher loops through the occurrences of the element and display the fields each time. To designate a group of repeating fields, insert the grouping tags around the elements to repeat. The group element must be a parent of the repeating elements in the XML input file.

• If you insert the grouping tags around text or formatting elements, the text and formatting elements between the group tags are repeated.

• If you insert the tags around a table, the table is repeated.• If you insert the tags around text in a table cell, the text in the table cell between the tags is

repeated.• If you insert the tags around two different table cells, but in the same table row, the single row is

repeated.• If you insert the tags around two different table rows, the rows between the tags are repeated

(this does not include the row that contains the “end group” tag).Headers and FootersOracle BI Publisher supports the use of the native RTF header and footer feature. To create a header or footer, use the word processing application’s header and footer insertion tools. Alternatively, you can define an internal template in the body of your template, and then call this subtemplate from the header or footer region. If your template requires multiple headers and footers, create them by using Oracle BI Publisher tags to define the body area of your report. When you define the body area, the elements occurring before the beginning of the body area will compose the header. The elements occurring after the body area will compose the footer. Use the following tags to enclose the body area of your report:• <?start:body?>• <?end body?>

Use the tags either directly in the template or in the form fields.At the time of this writing, Microsoft Word does not support form fields in the header and footer. You must, therefore, insert the placeholder syntax directly into the template (basic RTF method), or use the header-and-footer template alternative.If you require many or complex objects in the header or footer of your report, these regions can become difficult to read or understand. Alternatively, you can create header-and-footer templates in the body of your RTF template document that can then be called from the header or footer region.For more information, refer to the Oracle BI Publisher User’s Guide.

Page 187: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 13

Adding Markup (continued)SubtemplatesTo create a template within your template, wrap the contents of the internal template with the following tags:• <?template:internaltemplate name?>• <?end template?>

In this code, internaltemplate name is the name that you assign to the header/footer template.

Then in the header/footer region, enter the following syntax to call this template:• <?call:internaltemplate name?>

At run time, the contents of the internal template are rendered at the position of the call.ExampleAssume that you have the following XML data:<REPORT>

<COMPANY_NAME>Oracle</COMPANY_NAME>

<REPORT_NAME> Accounts Payables – Invoice Listing</REPORT_NAME>

<REPORT_DATE>1st January 2005</REPORT_DATE>

<LEGAL_TEXT>Private and Confidential</LEGAL_TEXT>

...

/<REPORT>

You want COMPANY_NAME, REPORT_NAME, and REPORT_DATE to be displayed in a table in the header of the report. In the header of your template, enter the following:

<?call:OraHeader/>

At run time, the OraHeader template is rendered in the header of each page of the document.

Page 188: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 14

Copyright © 2008, Oracle. All rights reserved.

Images and Charts

Oracle BI Publisher supports several methods for including images and charts in an Oracle BI Publisher report:• Direct insertion• Images in the form of clip arts• The URL reference• The OA_MEDIA directory reference• Leveraging Oracle Business Intelligence Beans (BI Beans)

to add charts and graphs• Image retrieved from binary large object (BLOB) data

Images and ChartsBI Publisher supports several methods for including images or charts.Direct InsertionInsert the .jpg, .gif, or .png image directly in your template.Clip ArtsYou can insert images by using the MS Word Clip Art libraries in your report templates.URL Reference

• Insert a dummy image in your template. For layout purposes, it is best if the dummy image is the same size, in pixel height and width, as your actual image.

• In the Format Picture dialog box (right-click the image to open it), click the Web tab. Enter the following syntax in the Alternative Text region: url:{‘http://image.location.com/image-name’}

OA_Media Directory ReferenceThe OA_MEDIA method refers to only Oracle E-Business Suite installations. Otherwise, it is the same as the URL reference with Alternative Text changing to the following: url:{‘${OA_MEDIA}/image-name’}

Page 189: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 15

Images and Charts (continued)Chart SupportBI Publisher leverages the graph capabilities of Oracle Business Intelligence Beans (BI Beans) to enable you to define charts and graphs in your RTF templates that will be populated with data at run time. BI Publisher supports all the graph types and component attributes available from the BI Beans graph document type definition (DTD). Most of these are provided through the Chart Wizard in BI Publisher Desktop. Alternatively, you can also use XSL to define the charts in templates. At run time, Oracle BI Publisher calls the appropriate BI Bean to render the image that is inserted as a graph or chart.The BI Beans graph DTD is fully documented in the following technical note available in the Oracle Technology Network:

http://www.oracle.com/technology/products/reports/htdocs/getstart/whitepapers/graphdtd/graph_dtd_technote_2.html

There is also information published on the BI Publisher blog:http://blogs.oracle.com/xmlpublisher/

Rendering an Image Retrieved from BLOB DataIf your data source is an Oracle BI Publisher Data Template, and your results XML contains image data that had been stored as a BLOB in the database, use the following syntax in a form field inserted in your template where you want the image to render at run time:<fo:instream-foreign-object content type="image/jpg"><xsl:value-of select="IMAGE_ELEMENT"/></fo:instram-foreign-object>

Here, image/jpg is the Multipurpose Internet Mail Extensions (MIME) type of the image (other options may be image/gif and image/png) and IMAGE_ELEMENT is the element name of the BLOB in your XML data.You can specify height and width attributes for the image to set its size in the published report. Oracle BI Publisher scales the image to fit the box size that you define. For example, to set the size of the preceding example to three inches by four inches, enter the following:<fo:instream-foreign-object content type="image/jpg" height="3 in" width="4 in">

<xsl:value-of select="IMAGE_ELEMENT"/>

</fo:instram-foreign-object>

Specify the size in pixels:<fo:instream-foreign-object content type="image/jpg" height="300 px" width="4 px">

You can also specify the size in centimeters:<fo:instream-foreign-object content type="image/jpg" height="3 cm" width="4 cm">

You can also specify the size as a percentage of the original dimensions:<fo:instream-foreign-object content type="image/jpg" height="300%" width="300%">

Page 190: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 16

Copyright © 2008, Oracle. All rights reserved.

Adding a Chart

• Using the Chat Wizard in BI Publisher Desktop:– Select the appropriate options in the wizard to select the

graph type, series, and color themes. • Using Extensible Stylesheet Language (XSL) commands:

– Insert a dummy image in your template to define the size and position of the chart.

– Add a definition for the chart, to the alternative text box of the dummy image, by using XSL commands.

Adding a ChartBI Publisher supports almost 70 different graph types and variations, and you can choose one of them for your template. Chart types and other chart options are discussed in detail in the lesson titled “Creating Simple RTF Templates.” You can add charts in report templates by using the Chart Wizard in BI Publisher Desktop (already discussed in the lesson titled “Creating Simple RTF Templates”) or XSL commands.

Page 191: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 17

Copyright © 2008, Oracle. All rights reserved.

Support for Drawings and Shapes

The following AutoShape categories are supported:• Lines: Straight, arrowed, connectors, curve, free-form, and

scribble• Connectors: Only straight connectors• Basic Shapes: All shapes• Block Arrows: All arrows• Flowchart: All objects• Stars and banners: All objects• Callouts: All callouts except “Line” callouts

Support for Drawings and ShapesBI Publisher also supports the use of different drawings and shapes. These are mentioned in the slide.

Page 192: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 18

Copyright © 2008, Oracle. All rights reserved.

Other Graphic Features

• Freehand drawing: Supported• Hyperlinks: Supported• Layering: Supported• 3-D effects: Not currently supported• Microsoft Equation: Supported• Organization Chart: Supported• WordArt: Mostly supported

Other Graphic Features• Freehand Drawing: Use the freehand drawing tool in Microsoft Word to create drawings in

your template to be rendered in the final PDF output.• Hyperlinks: You can add hyperlinks to your shapes.• Layering: You can layer shapes on top of each other and use the transparency setting in

Microsoft Word to allow shapes on lower layers to show through.• 3-D Effects: BI Publisher does not currently support the 3D option for shapes. (But the 3D

option is supported in the Chart Wizard of BI Publisher Desktop.)• Microsoft Equation: Use the equation editor to generate equations in your output. • Organization Chart: Use the organization chart functionality in your templates and the chart

will be rendered in the output.• WordArt: You can use Microsoft Word’s WordArt functionality in your templates.

Note: Some Microsoft WordArt uses bitmap operations that currently cannot be converted to Scalable Vector Graphics (SVG). To use the unsupported WordArt in your template, take a screenshot of the WordArt and save it as an image (.gif, .jpeg, or .png). Replace the WordArt with the image.

Page 193: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 19

Copyright © 2008, Oracle. All rights reserved.

Data-Driven Shape Support

The following manipulations of shapes are supported:• Replicate• Move• Change size• Add text• Skew• Rotate

Data-Driven Shape SupportIn addition to supporting static shapes and features in your templates, Oracle BI Publisher supports the manipulation of shapes based on incoming data or parameters.Enter manipulation commands for a shape on the Web tab of the shape’s properties dialog box (right-click and select Format AutoShape > Web > Alternative Text).Replicating a ShapeYou can replicate a shape based on incoming XML data in the same way that you replicate data elements in a for-each loop. To do this, use a for-each@shape command in conjunction with a shape-offset declaration. For example, use this syntax to replicate a shape down the page:

<?for-each@shape:SHAPE_GROUP?><?shape-offset-y:(position()-1)*100?><?end for-each?>

In this example, for-each@shape opens the for-each loop for the shape context, and SHAPE_GROUP is the name of the repeating element from the XML file. For each occurrence of the SHAPE_GROUP element, a new shape is created. shape-offset-y: is the command to offset the shape along the y-axis. (position()-1)*100) sets the offset in pixels per occurrence. The XSL position command returns the record counter in the group (that is, 1, 2, 3, 4, and so on); 1 is subtracted from that number and the result is multiplied by 100. Therefore, for the first occurrence, the offset would be 0: (1–1) * 100. The offset for the second occurrence would be 100 pixels: (2–1) * 100. Subsequently, each offset would be another 100 pixels down.

Page 194: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 20

Data-Driven Shape Support (continued)Adding Text to a ShapeYou can add text to a shape dynamically either from the incoming XML data or from a parameter value. In the properties dialog box, enter the following syntax:

<?shape-text:SHAPETEXT?>

Here, SHAPETEXT is the element name in the XML data. At run time, the text is inserted into the shape.Adding Text Along a PathYou can add text along a line or curve from incoming XML data or a parameter. After drawing the line, in the properties dialog box, enter:

<?shape-text-along-path:SHAPETEXT?>

Here, SHAPETEXT is the element from the XML data. At run time, the value of the SHAPETEXTelement is inserted above and along the line.Moving a ShapeYou can move a shape or transpose it along both the x- and y-axes based on the XML data. For example, to move a shape 200 pixels along the y-axis and 300 pixels along the x-axis, enter the following commands in the properties dialog box of the shape:

<?shape-offset-x:300?><?shape-offset-y:200?>

Rotating a ShapeTo rotate a shape about a specified axis based on the incoming data, use the following command:

<?shape-rotate:ANGLE;’POSITION’?>

Here, ANGLE is the number of degrees to rotate the shape. If the angle is positive, the rotation is clockwise; if it is negative, the rotation is counterclockwise. POSITION is the point about which to carry out the rotation (for example, “left/top”). Valid values are combinations of left, right, or center with center, top, or bottom. The default is left/top.Skewing a ShapeYou can skew a shape along its x- or y-axis using the following commands:

<?shape-skew-x:ANGLE;’POSITION’?><?shape-skew-y:ANGLE;’POSITION’?>

Here, ANGLE is the number of degrees to skew the shape. If the angle is positive, the skew is to the right. POSITION is the point about which to carry out the rotation (for example, “left/top”). Valid values are combinations of left, right, or center with center, top, or bottom. The default is left/top.For example, to skew a shape by 30 degrees about the lower-right corner, enter the following:

<?shape-skew-x:number(.)*30;’right/bottom’?>

Page 195: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 21

Data-Driven Shape Support (continued)Changing the Size of a ShapeYou can change the size of a shape by using the appropriate commands either along a single axis or along both axes. To change a shape’s size along both axes, use:

<?shape-size:RATIO?>

Here, RATIO is the numeric ratio to increase or decrease the size of the shape. Therefore, a value of 2 would generate a shape twice the height and width of the original. A value of 0.5 would generate a shape half the size of the original. To change a shape’s size along the x- or y-axis, use:

<?shape-size-x:RATIO?><?shape-size-y:RATIO?>

Changing only the x or y value has the effect of stretching or shrinking the shape along an axis. This can be data driven.

Page 196: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 22

Copyright © 2008, Oracle. All rights reserved.

Background and Watermark Support

Oracle BI Publisher supports: • Adding a color as background in Microsoft Word• Adding text or image watermark (in Microsoft Word 2002 or

later) Note: This feature is supported for PDF output only.

Background and Watermark SupportYou can specify a single, graduated color or an image background for your template to be displayed in the PDF output. However, this feature is supported for PDF output only.To add a background by using Microsoft Word 2000, select Format > Background.On the Background menu, you can:

• Select a single-color background from the color palette• Select Fill Effects to open the Fill Effects dialog box

In Microsoft Word 2002 or later, you can also add a text or image watermark by selecting Format >Background > Printed Watermark.

Page 197: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 23

Copyright © 2008, Oracle. All rights reserved.

Using More Advanced Template Features

• Page breaks• Initial page numbers• Hyperlinks• Table of contents• Bookmarks in PDF output• Check boxes• Drop-down lists

Using More Advanced Template FeaturesMost of the advanced features discussed in this lesson are supported in BI Publisher wizards. The examples also show the tags or aliases for using these features with the templates.Page BreaksTo create a page break after the occurrence of a specific element, use the split-by-page-break alias. This causes the report output to insert a hard page break between every instance of a specific element. You can also insert a form field immediately following the form field of the element after which you want the page break to occur. In the Help text of this form field, enter the following:<?split-by-page-break:?>

Page-Level CalculationsYou can create page-level calculations in BI Publisher Desktop, and mention the aggregation type that you want to specify for the field; for example, sum of sales, average employee salary. You can use markup to specify page-level calculations. These are discussed later in the lesson.

Page 198: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 24

Using More Advanced Template Features (continued)Initial Page NumbersSome reports require that the initial page number be set at a specified number. For example, monthly reports may be required to continue numbering from month to month. With Oracle BI Publisher, you can set the page number in the template to support this requirement.Use the following syntax in your template to set the initial page number:<?initial-page-number:pagenumber?>

Where pagenumber is the XML element or parameter that holds the numeric value.Example 1: Suppose that your XML data contains an element to carry the initial page number, as in this example:<REPORT>

<PAGESTART>200<\PAGESTART>....

</REPORT>

Enter the following in your template:<?initial-page-number:PAGESTART?>

Your initial page number will be the value of the PAGESTART element, which in this case is 200.Example 2: Suppose that you set the page number by passing a parameter value. If you define a parameter called PAGESTART, you can pass the initial value by calling the parameter. Enter the following in your template:

<?initial-page-number:$PAGESTART?>

Note: You must first declare the parameter in your template. See “Defining Parameters in Your Template” in the Oracle BI Publisher User’s Guide.HyperlinksYou can add fixed or dynamic hyperlinks to your template:

• To insert static hyperlinks, use your word processing application’s “insert hyperlink” feature.• If your template includes a data element that contains a hyperlink or part of one, you can create

dynamic hyperlinks at run time. In the “Type the file or Web page name” field of the Insert Hyperlink dialog box, enter the following:

{URL_LINK}where URL_LINK is the incoming data element name.

• If you have a fixed URL that you want to pass parameters to, enter the following syntax:http://www.oracle.com?product={PRODUCT_NAME}where PRODUCT_NAME is the incoming data element name.

• In both these cases, the dynamic URL is constructed at run time. (This topic is discussed in more detail in the lesson titled “Creating Parameters, List of Values (LOVs), and Hyperlinks.”)

Page 199: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 25

Using More Advanced Template Features (continued)Table of ContentsOracle BI Publisher supports the RTF specification’s feature for generating a table of contents. Follow your word processing application’s procedures for inserting a table of contents. Oracle BI Publisher also provides the ability to create dynamic section headings in your document from the XML data. You can then incorporate these into a table of contents.To create dynamic headings, perform the following steps:

1. Enter a placeholder for the heading in the body of the document, and format it as a “Heading,” using your word processing application’s style feature. You cannot use form fields for this functionality.For example, you want your report to display a heading for each company reported. The XML data element tag name is <COMPANY_NAME>. In your template, enter <?COMPANY_NAME?> where you want the heading to appear. Now format the text as a heading.

2. Create a table of contents by using your word processing application’s table of contents feature.3. At run time, the TOC placeholders and heading text are substituted.

Generating Bookmarks in PDF OutputIf you have defined a table of contents in your RTF template, you can use your table of contents definition to generate links in the Bookmarks tab in the navigation pane of your output PDF. The bookmarks can be either static or dynamically generated.

• To create links for a static table of contents, enter:<?copy-to-bookmark:?>directly above your table of contents and<?end copy-to-bookmark:?>directly below the table of contents.

• To create links for a dynamic table of contents, enter:<?convert-to-bookmark:?>directly above the table of contents and<?end convert-to-bookmark:?>directly below the table of contents.

Check BoxesYou can include a check box in your template that you can define to display as selected (Checked) or deselected (Not Checked) based on a value from the incoming data. To define a check box in your template, perform the following steps:

1. Position the cursor in your template where you want the check box to appear, and select the Check Box Form Field on the Forms toolbar.

2. Right-click the field to open the Check Box Form Field Options dialog box.3. Specify the default value as either Checked or Not Checked.4. In the Form Field Help Text dialog box, enter the criteria for how the box should behave. This

must be a Boolean expression (that is, one that returns a true or false result). For example, suppose your XML data contains an element called <population>. You want the check box to appear selected if the value of <population> is greater than 10,000. Enter the following in the Help text field: <?population>10000?>

5. Note that you do not have to construct an if statement. The expression is treated as an ifstatement.

Page 200: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 26

Using More Advanced Template Features (continued)Drop-Down ListsOracle BI Publisher enables you to use the drop-down form field to create a cross-reference in your template from your XML data to some other value that you define in the drop-down form field. For example, suppose you have the following XML:<countries>

<country>

<name>Chad</name>

<population>7360000</population>

<continentIndex>5</continentIndex>

</country>

<country>

<name>China</name>

<population>1265530000</population>

<continentIndex>1</continentIndex>

</country>

<country>

<name>Chile</name>

<population>14677000</population>

<continentIndex>3</continentIndex>

</country>

. . .

</countries>

Notice that each <country> entry has a <continentindex> entry, which is a numeric value to represent the continent. Using the drop-down form field, you can create an index in your template that will cross-reference the <continentindex> value to the actual continent name. You can then display the name in your published report. To create the index for the continent example, perform the following steps:

1. Position the cursor in your template where you want the value from the drop-down list to appear, and select the Drop-Down Form Field from the Forms toolbar.

2. Right-click the field to display the Drop-Down Form Field Options dialog box.3. Add each value to the “Drop-down item” field and then click Add to add it to the “Items in drop-

down list” group. The values are indexed starting from 1 for the first. For example, the list of continents is stored as follows:

Index Value1 Asia2 North America3 South America4 Europe5 Africa6 Australia

Now use the Help Text box to enter the XML element name that will hold the index for the drop-down field values. For this example, enter <?continentIndex?>.

Page 201: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 27

Copyright © 2008, Oracle. All rights reserved.

Some More Advanced Template Features

• Page-level calculations• Conditional formats• Parameters and variables• Data handling:

– Grouping– Sorting

Some More Advanced Template FeaturesThese features are discussed in detail on the following pages.

Page 202: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 28

Copyright © 2008, Oracle. All rights reserved.

Conditional Formatting

• Oracle BI Publisher supports the use of the following types of conditional formatting using XSL/XSL:FO code:

– if statements– if statements in boilerplate text– if-then-else statements– choose statements– Column formatting– Row formatting– Conditionally displaying a row– Cell highlighting

• Oracle BI Publisher Desktop provides a wizard for defining conditional formats:

– Insert > Conditional Format

Conditional FormattingConditional formatting occurs when a formatting element appears only when a certain condition is met. Oracle BI Publisher supports the usage of simple if statements, as well as more complex choose expressions. The conditional formatting that you specify can be XSL or XSL:FO code, or you can specify actual RTF objects such as a table or data. For example, you can specify that reported numbers reaching a certain threshold be displayed in red. Alternatively, you can use this feature to hide table columns or rows depending on the incoming XML data. Note: The current version of BI Publisher Desktop also provides you with a wizard to insert conditional formats in RTF templates. Select Insert > Conditional Format.if StatementsUse an if statement to define a simple condition. If a data field is a specific value:

• Insert the following syntax to designate the beginning of the conditional area: <?if:condition?>

• Insert the following syntax at the end of the conditional area: <?end if?>For example, to set up the Payables Invoice Register to display invoices only when the Supplier name is “Company A,” insert the syntax <?if:VENDOR_NAME=’COMPANYA’?> before the Supplier field on the template. Enter the <?end if?> tag after the invoices table. You can insert the syntax in form fields or directly into the template.

Page 203: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 29

Conditional Formatting (continued)if Statements in Boilerplate TextAssume that you want to incorporate an if statement into the following free-form text:

The program was (not) successful.

You want the word not to appear only if the value of an XML tag called <SUCCESS> equals N. To meet this requirement, you must use the Oracle BI Publisher context command to place the ifstatement into the inline sequence rather than into the block (the default placement). Note: For more information about context commands, see “Using Context Commands” in the Oracle BI Publisher User’s Guide.For example, suppose that you construct the code as follows:

The program was <?if:SUCCESS=’N’?>not<?end if?> successful.

The following undesirable result occurs:The program wasnotsuccessful.

This happens because Oracle BI Publisher applies the instructions to the block by default. To specify that the if statement must be inserted into the inline sequence, enter:The program was <?if@inlines:SUCCESS=’N’?>not<?end if?> successful.

This construction results in one of two displays. If SUCCESS does not equal ‘N’, the display is The program was successful. If SUCCESS equals ‘N’, the display is The program was not successful.if-then-else StatementsOracle BI Publisher supports the common programming construct if-then-else. This is extremely useful when you need to test a condition and conditionally show a result. For example:

IF X=0 THENY=2ELSEY=3END IF

You can also nest these statements as follows:IF X=0 THENY=2ELSEIF X=1 THENY=10ELSE Y=100END IF

Use the following syntax to construct an if-then-else statement in your RTF template:<?xdofx:if element_condition then result1 else result2 end if?>

Page 204: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 30

Conditional Formatting (continued)For example, the following statement tests the AMOUNT element value. If the value is greater than 1000, show the word Higher. If it is less than 1000, show the word Lower. If it equals 1000, show Equal:

<?xdofx:if AMOUNT > 1000 then ’Higher’elseif AMOUNT < 1000 then ’Lower’else’Equal’end if?>

choose StatementsUse the choose, when, and otherwise elements to express multiple conditional tests. If certain conditions are met in the incoming XML data, specific sections of the template are rendered. This is a very powerful feature of the RTF template. In regular XSL programming, if a condition is met in the choose command, further XSL code is executed. Use the following syntax for these elements:

<?choose:?><?when:expression?><?otherwise?>

Column FormattingYou can conditionally show and hide columns of data in your document output. Row FormattingWith Oracle BI Publisher, you can specify formatting conditions as the row level of a table. Examples of row-level formatting are:

• Highlighting a row when the data meets a certain threshold• Alternating background colors of rows to ease readability of reports• Showing only rows that meet a specific condition

Conditionally Displaying a RowTo display only rows that meet a certain condition, insert the <?if:condition?> and <?end if?> tags at the beginning and end of the row within the for-each tags for the group. This is demonstrated in the following sample template.

Page 205: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 31

Conditional Formatting (continued)Cell HighlightingThe code to highlight the debit column as shown in the table is:

<?if:debit>1000?><xsl:attributexdofo:ctx="block" name="background-color">red</xsl:attribute><?end if?>

The if statement tests whether the debit value is greater than 1,000. If it is, the next lines are invoked. Notice that the example embeds native XSL code inside the if statement. Using the attribute element, you can modify properties in the XSL. The xdofo:ctx component is an Oracle BI Publisher feature that enables you to adjust XSL attributes at any level in the template. In this case, the background-color attribute is changed to red. To change the attribute, you can use either the standard HTML names (for example, red, white, and green), or you can use the hexadecimal color definition (for example, #FFFFF).Note: Examples of conditional formatting can be found in the BI Publisher User’s Guide.

Page 206: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 32

Copyright © 2008, Oracle. All rights reserved.

Conditional Formats in BI Publisher Desktop

Conditional Formats in BI Publisher DesktopUsing the BI Publisher Desktop Insert > Conditional Format option, you can insert conditional formats in RTF templates. BI Publisher provides this feature through its simple-to-use UI that does not require the user to code. For example, in the employee salary report, you may want to show the salaries of all employees who earn more than 8,000 USD per month in green, and the salaries of all employees who are making less than 3,500 USD in red. You can do this in BI Publisher Desktop. (More details about how to create conditional formats in BI Publisher Desktop are given in the self-guided Practice 6-1).

Page 207: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 33

Copyright © 2008, Oracle. All rights reserved.

Page-Level Calculations

• Oracle BI Publisher supports the use of the following types of page-level calculations:

– Page totals – Brought-forward or carried-forward totals– Running totals

• These features are performed by the PDF-formatting layer. Therefore, they are not available for other outputs types such as HTML, RTF, and Excel.

Page-Level CalculationsDisplaying Page TotalsWith Oracle BI Publisher, you can display calculated page totals in your report. Because the page is not created until publishing time, the totaling function must be executed by the formatting engine. Note: Page totaling is performed in the PDF-formatting layer. Therefore, this feature is not available for other output types such as HTML, RTF, Excel, or PowerPoint.Because the page total field does not exist in the XML input data, you must define a variable to hold the value. When you define the variable, you associate it with the element from the XML file that is to be totaled for the page. After you define total fields, you can also perform additional functions on the data in those fields.To declare the variable that is to hold your page total, insert the following syntax immediately following the placeholder for the element that is to be totaled:<?add-page-total:TotalFieldName;’element’?>

Where TotalFieldName is the name that you assign to your total (to refer to later), and element is the XML element field to be totaled.

Page 208: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 34

Page-Level Calculations (continued)You can add this syntax to as many fields as you want to total. Then, when you want to display the total field, enter the following syntax:<?show-page-total:TotalFieldName;’number-format’?>

Where TotalFieldName is the name you assigned to the page total field, and number-formatis the format you want to use for the display.Note that this page totaling function works only if your source XML has raw numeric values. The numbers must not be preformatted.Brought-Forward and Carried-Forward TotalsMany reports require that a page total be maintained throughout the report output and be displayed at the beginning and end of each page. These totals are known as brought-forward and carried-forward totals. Note: The totaling for the brought-forward and carried-forward fields is performed in the PDF-formatting layer. Therefore, this feature is not available for other output types, such as HTML, RTF, and Excel.To display the brought-forward total at the top of each page (except the first), use the following syntax:

<xdofo:inline-totaldisplay condition="exceptfirst"name="InvAmt">Brought Forward:

<xdofo:show-brought-forwardname="InvAmt"format="99G999G999D00"/>

</xdofo:inline-total>The following table describes the elements in the brought-forward syntax:Code Element Description and Usageinline-total This element has two properties:

name: Name of the variable that you declared for the fielddisplay condition: This sets the display condition. This is an optional property that takes one of the following values:first: Contents appear only on the first page.last: Contents appear only on the last page.

. exceptfirst: Contents appear on all pages except the first.exceptlast: Contents appear on all pages except the last.everytime: (default) Contents appear on every page.In this example, display condition is set to exceptfirst to prevent the value from appearing on the first page where the value would be zero.

Brought Forward This string is optional and will display as the field name on the report.

show-brought-forward This shows the value on the page. It has the following two properties: name: Name of the field to show—in this case, InvAmt. This property is mandatory.format: The Oracle number format to apply to the value atrun time. This property is optional.

For more information, see “Number Formats” and “Date Fields” in the Oracle BI Publisher User’s Guide.

Page 209: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 35

Page-Level Calculations (continued)Insert the brought-forward object at the top of the template where you want the brought-forward total to appear. If you place it in the body of the template, you can insert the syntax in a form field. If you want the brought-forward total to appear in the header, you must insert the full code string into the header because Microsoft Word does not support form fields in header or footer regions.However, you can alternatively use the Header/Footer Template technique, which enables you to enter your header and footer content within the body of the template and then simply include a call for this content in the header or footer region. This can simplify the look of your template if you have many or complex objects contained in your header or footer regions.Place the carried-forward object at the bottom of your template where you want the total to display. The carried-forward object for the example is as follows:

<xdofo:inline-totaldisplay condition="exceptlast"name="InvAmt">Carried Forward:

<xdofo:show-carry-forwardname="InvAmt"format="99G999G999D00"/>

</xdofo:inline-total>

Note the following differences with the brought-forward object:• The display condition is set to exceptlast so that the carried-forward total is

displayed on every page except the last page.• The display string is “Carried Forward.”• The show-carry-forward element is used to show the carried-forward value. It has the

same properties as brought-carried-forward.You are not limited to a single value in your template. You can create multiple brought-forward and carried-forward objects in your template pointing to various numeric elements in your data.Running TotalsTo create the Running Total field, define a variable to track the total and initialize it to 0.

Page 210: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 36

Copyright © 2008, Oracle. All rights reserved.

Data Handling

Oracle BI Publisher supports the use of the following types of data handling:• Sorting• Grouping

Data HandlingSortingYou can sort a group by any element within the group. Insert the following syntax within the group tags:<?sort:element name?>

To sort the example by Supplier (VENDOR_NAME), enter the following after the <?for-each:G_VENDOR_NAME?> tag:<?sort:VENDOR_NAME?>

To sort a group by multiple fields, insert the sort syntax after the primary sort field. To sort by Supplier and then by Invoice Number, enter the following:<?sort:VENDOR_NAME?> <?sort:INVOICE_NUM?>

Grouping the XML DataThe RTF template supports the XSL 2.0 for-each-group standard that enables you to group XML data into hierarchies that are not present in the original data. With this feature, your template does not have to follow the hierarchy of the source XML file. You are thus no longer limited by the structure of your data source.

Page 211: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 37

Copyright © 2008, Oracle. All rights reserved.

Variables, Parameters, and Properties

Oracle BI Publisher supports the use of the following features:• Using variables• Defining parameters• Setting configuration properties in a template

Variables, Parameters, and PropertiesUsing VariablesUpdatable variables differ from standard XSL variables <xsl:variable> in that they are updatable during the template application to the XML data. This allows you to create many new features in your templates that require updatable variables. The variables use a “set and get” approach for assigning, updating, and retrieving values. Use the following syntax to declare or set a variable value:<?xdoxslt:set_variable($_XDOCTX, ’variable name’, value)?>

Use the following syntax to retrieve a variable value:<?xdoxslt:get_variable($_XDOCTX, ’variable name’)?>

You can use this method to perform calculations, as in the following example:<?xdoxslt:set_variable($_XDOCTX, ’x’, xdoxslt:get_variable($_XDOCTX, ’x’ + 1)?>

This sets the value of variable ‘x’ to its original value plus 1, much like using "x = x + 1". $_XDOCTX specifies the global document context for the variables. In a multithreaded environment, many transformations may be occurring at the same time, and thus the variable must be assigned to one transformation.Note: Handling parameters and hyperlinks is discussed in more detail in the lesson titled “Creating Parameters, List of Values (LOVs), and Hyperlinks.”

Page 212: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 38

Variables, Parameters, and Properties (continued)Defining ParametersYou can pass run-time parameter values into your template. These can then be referenced throughout the template to support many functions. For example, you can filter data in the template, use a value in a conditional formatting block, or pass property values (such as security settings) into the final document. Note: The Oracle Applications concurrent manager does not support passing parameter values into the template. The parameters must be passed programmatically by using the API as follows.Using a Parameter in a Template

• Declare the parameter in the template. Use the following syntax to declare the parameter:<xsl:param name="PARAMETERNAME" select="DEFAULT" xdofo:ctx="begin"/>Where PARAMETERNAME is the name of the parameter, DEFAULT is the default value for the parameter (the select statement is optional), and xdofo:ctx="begin" is a required string to push the parameter declaration to the top of the template at run time so that it can be referred to globally in the template. The syntax must be declared in the Help Text field of a form field. The form field can be placed anywhere in the template.

• Refer to the parameter in the template by prefixing the name with a "$" character. For example, if you declare the parameter name to be "InvThresh", then reference the value by using "$InvThresh".

• At run time, pass the parameter to the Oracle BI Publisher engine programmatically. Before calling either the FOProcessor API (Core) or the TemplateHelper API (E-Business Suite), create a Properties class and assign a property to it for the parameter value as follows:

Properties prop = new Properties();prop.put("xslt.InvThresh", "1000");

For more information, see “Calling Oracle BI Publisher APIs” in the BI Publisher User’s Guide.

Page 213: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 39

Variables, Parameters, and Properties (continued)Setting PropertiesOracle BI Publisher properties that are available in the Oracle BI Publisher Configuration file can alternatively be embedded into the RTF template. The properties set in the template are resolved at run time by the Oracle BI Publisher engine. You can either hard-code the values in the template or embed the values in the incoming XML data. Embedding the properties in the template avoids the use of the configuration file.Note: See “Administration” in the BI Publisher User’s Guide for more information about the Oracle BI Publisher configuration file and the available properties.

Page 214: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 40

Copyright © 2008, Oracle. All rights reserved.

Advanced Design Options

Oracle BI Publisher supports the use of the following advanced report layout features:• Batch reports• Cross-tab support• Dynamic data columns• Defining columns to repeat across pages• Number and date formatting• Calendar and time-zone support• Using external fonts

Advanced Design OptionsIf you have more complex design requirements, Oracle BI Publisher supports the use of XSL and XSL-FO elements, and has also extended a set of SQL functions. RTF templates offer extremely powerful layout options by using Oracle BI Publisher’s syntax. However, because the underlying technology is based on open W3C standards, such as XSL and XPATH, you are not limited by the functionality described in this course. You can fully use the layout and data manipulation features available in these technologies.Note: For inserting cross-tabs, BI Publisher Desktop provides a cross-tab wizard, which can be invoked by selecting Insert > Cross tab.A few of these options are described on the following pages. For more information about these options, refer to the Oracle BI Publisher User’s Guide.

Page 215: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 41

Advanced Design Options (continued)Batch Reports: It is a common requirement to print a batch of documents, such as invoices or purchase orders, in a single PDF file. Because these documents are intended for different customers, each document requires that the page numbering be reset and that page totals be specific to the document. If the header and footer display fields from the data (such as customer name), these must be reset as well.BI Publisher supports this requirement through the use of a context command. Using this command, you can define elements of your report to a specific section. When the section changes, these elements are reset. The following example demonstrates how to reset the header, footer, and page numbering within an output file:The following XML sample is a report that contains multiple invoices:

... <LIST_G_INVOICE> <G_INVOICE> <BILL_CUST_NAME>Vision, Inc. </BILL_CUST_NAME> <TRX_NUMBER>2345678</TRX_NUMBER> ... </G_INVOICE> <G_INVOICE> <BILL_CUST_NAME>Oracle, Inc. </BILL_CUST_NAME> <TRX_NUMBER>2345685</TRX_NUMBER> ... </G_INVOICE> ... </LIST_G_INVOICE> ...

Each G_INVOICE element contains an invoice for a potentially different customer. To instruct BI Publisher to start a new section for each occurrence of the G_INVOICE element, add the @section command to the opening for-each statement for the group, using the following syntax:

<?for-each@section:group name?>

Here, group name is the name of the element for which you want to begin a new section.For example, the for-each grouping statement for this example is as follows:

<?for-each@section:G_INVOICE?>

The closing <?end for-each?> tag is not changed.Dynamic Data Columns The ability to construct dynamic data columns is a very powerful feature of the RTF template. Using this feature, you can design a template that correctly renders a table when the number of columns required by the data is variable. For example, you are designing a template to display columns of test scores within specific ranges. However, you do not know how many ranges will have data to report. You can define a dynamic data column to split into the correct number of columns at run time.Use the following tags to accommodate the dynamic formatting required to render the data correctly:

• Dynamic Column Header: <?split-column-header:group element name?> : Use this tag to define which group to split for the column headers of a table.

• Dynamic Column: <?split-column-data:group element name?> : Use this tag to define which group to split for the column data of a table.

• Dynamic Column Width: <?split-column-width:name?> or <?split-column-width:@width?>: Use one of these tags to define the width of the column when the width is described in the XML data. The width can be described in two ways:

- An XML element stores the value of the width. In this case, use the <?split-column-width:name?> syntax, where name is the XML element tag name that contains the value for the width.

- If the element defined in the split-column-header tag contains a width attribute, use the <?split-column-width:@width?> syntax to use the value of that attribute.

• Dynamic Column Width’s unit value (in points): <?split-column-width-unit:value?>

Page 216: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 42

Advanced Design Options (continued)Cross-Tab Support: The columns of a cross-tab report are data dependent. At design time, you do not know how many columns will be reported or what the appropriate column headings will be. Moreover, if the columns should break onto a second page, you must be able to define the row label columns to repeat onto subsequent pages. The following example shows how to design a simple cross-tab report that supports these features.This example uses the following XML sample:

<ROWSET> <RESULTS> <INDUSTRY>Motor Vehicle Dealers</INDUSTRY> <YEAR>2005</YEAR> <QUARTER>Q1</QUARTER> <SALES>1000</SALES> </RESULTS> <RESULTS> <INDUSTRY>Motor Vehicle Dealers</INDUSTRY> <YEAR>2005</YEAR> <QUARTER>Q2</QUARTER> <SALES>2000</SALES> </RESULTS> <RESULTS> <INDUSTRY>Motor Vehicle Dealers</INDUSTRY> <YEAR>2004</YEAR> <QUARTER>Q1</QUARTER> <SALES>3000</SALES> </RESULTS> <RESULTS> <INDUSTRY>Motor Vehicle Dealers</INDUSTRY> <YEAR>2004</YEAR> <QUARTER>Q2</QUARTER> <SALES>3000</SALES> </RESULTS> <RESULTS> <INDUSTRY>Motor Vehicle Dealers</INDUSTRY> <YEAR>2003</YEAR> ... </RRESULTS> <RESULTS> <INDUSTRY>Home Furnishings</INDUSTRY> ... </RESULTS> <RESULTS> <INDUSTRY>Electronics</INDUSTRY> ... </RESULTS> <RESULTS> <INDUSTRY>Food and Beverage</INDUSTRY> ... </RESULTS> </ROWSET>

Page 217: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 43

Copyright © 2008, Oracle. All rights reserved.

Cross-Tab Wizard in BI Publisher Desktop

Cross-Tab Support in BI Publisher DesktopCross-tab reports enable you to perform your analysis on multiple facets—for example, Sales Revenues by Year and Region, Profits by Product and year, and Customer order by sales manager. These have data fields (Sales revenues, profits, order totals, and so on), row fields (product name), and column fields (year). BI Publisher provides a wizard for inserting cross-tab reports in your RTF templates. You can select Insert > Cross Tab. This displays the cross-tab report layout so that you can easily drag the fields in your data set to create a cross-tab. (The steps are covered in more detail in the self-guidedPractice 6-9).

Page 218: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 44

Copyright © 2008, Oracle. All rights reserved.

Summary

In this module, you should have learned how to describe and use advanced RTF template techniques.

Page 219: D54122

Oracle BI Publisher 10g R3: Fundamentals 6 - 45

Copyright © 2008, Oracle. All rights reserved.

Practice 6: Overview

This practice covers the topics covered in the lesson:• Creating RTF templates and using MS Word native features• Using advanced features

Additional challenge practices are provided to give you more hands-on experience with RTF template advanced features.

Page 220: D54122
Page 221: D54122

Copyright © 2008, Oracle. All rights reserved.

Creating Parameters, List of Values (LOVs), and Hyperlinks

Page 222: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:• Create a report with parameters and a list of values• Create a report with a hyperlink to another report

Page 223: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 3

Copyright © 2008, Oracle. All rights reserved.

Reports with Parameters and a List of Values (LOVs)

Reports with Parameters and a List of Values (LOVs)ParametersYou can add parameters to your report definition to enable your users to interact with the report and dynamically specify the data of interest from the data set or specify hidden parameters to control the data returned to a user from a data set.BI Publisher supports the following parameter types:

• Text: The user can enter a text entry to pass as the parameter. When you select this option, the parameter page displays fields such as Display Label and Text Field Size, which can be specified for the parameter.

• Menu: This type presents an LOV. When you select your parameter to be of the Menu type, you may also enable the following options:

- Multiple Selection: Enables the user to select multiple entries from the list- Can select all: Inserts an “All” option in the list (so that you can select all the values in the

list by selecting this option)- Refresh other parameters on change: Performs a partial page refresh to refresh any other

parameters whose values are dependent on the value of this oneThe report in the slide shows the report that has the parameter defined on the Department Name and displays the List of Values (LOVs) for the department name.

Page 224: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 4

Reports with Parameters and a List of Values (LOVs)• Date: Allows the user to specify a Date as the parameter. When you select this option, you can

also specify the options such as Date Format String, Date From and Date To, in addition to the Display Label and Text Field Size (in characters) options.

• Hidden: Enables you to pass the default value always, without allowing the user to see or change it.

List of Values (LOVs)A list of values can contain fixed data that you specify or the list can be created via a SQL query executed against any of the defined data sources. For example, department names (accounting, sales, human resources, and so on) can be specified directly or can be obtained as the result of a query based on the database. You can define the properties for the list of values in the report definition. After defining the LOVs, you can associate it with a parameter so that the user can select one or all the values from the list dynamically when executing the report.Note: Parameters are not supported if you create a report based on the Oracle BI Answers request data set.

Page 225: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 5

Copyright © 2008, Oracle. All rights reserved.

Adding a Parameter to a BI Publisher Report

Adding a Parameter to a BI Publisher ReportPerform the following steps to add a parameter to a BI Publisher report:

1. Open the report that you want to add a parameter to in Edit mode. Click the Parameters node in the Report pane on the left, and click New to create a parameter.

2. This displays Parameter on the right, in which you perform the following actions:- Enter a name in the Identifier field for the parameter. (In the example in the slide, dname is

the identifier.)- Select a data type (String, Integer, Boolean, Date, or Float). For example, if the parameter is

a character data type, select String as the data type.- Enter a value in the Default Value field. Enter * to pass All as the default. Sales is

entered as the default value for the department name in the example in the slide. - Select the parameter type. (Parameter types are discussed on the previous page.)- Enter a display label (see the slide).

3. Click Save to save the changes to the report.

Page 226: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 6

Copyright © 2008, Oracle. All rights reserved.

Modifying a Report to Include the Parameter

Modifying a Report to Include the ParameterAfter creating the parameter, you must modify the report definition to include this parameter. For example, in the employee salary report, you must modify the SQL query to include this parameter. After making changes to the report definition (or when any changes are made), save the changes to the report. (Do not forget to click the Save icon on the upper-left corner.) Observe the example shown in the slide. The query is modified to include the dname parameter, which is based on the department name.Note: The simple employee salary report based on the Oracle database that you created in practice3-1 is used in the example here.

Page 227: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 7

Copyright © 2008, Oracle. All rights reserved.

Viewing the Report Data

Viewing the Report DataAfter modifying the report definition to include the parameter, you can view the XML data in the report. You can also view the data by using a template. In the slide, the example shows the report data by using a predefined template for the default parameter value of the Sales department. You can enter the names of other departments in the Parameter field displayed at the top to see the data. For example, in the Parameter field, you can enter Shipping as the department name to view the data for the Shipping department.

Page 228: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 8

Copyright © 2008, Oracle. All rights reserved.

Creating a List of Values and Associating It with a Parameter

Creating a List of Values and Associating It with a ParameterWhen you create reports with parameters, it is advisable to define a list of values for the parameter so that the users can select one or all the values from the list, instead of entering the values for the parameters manually. If you select the parameter type as the menu item, you must create a list of values first to associate it with the parameter.Perform the following steps to create a list of values and associate it with a parameter:

1. Open the report that you want to add a list of values to in Edit mode. (The example uses the employee salary report in which a dname parameter is already added. A list of values is defined to be used with the dname parameter.)

2. In the Report pane displayed on the left, click List of Values. Then click New to create a new list of values.

3. In List of Values that appears on the right, click Query Builder to define a query for defining a list of values. Ensure that you select a data source (for example, demo, which is the Java Database Connectivity [JDBC] connection defined to the OE schema of the Oracle Database).

Page 229: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 9

Copyright © 2008, Oracle. All rights reserved.

Creating a List of Values and Associating It with a Parameter

Creating a List of Values and Associating It with a Parameter (continued)4. In Query Builder, define a query to display the list of values for the parameter. For example,

select the DEPARTMENTS table, and then the DEPARTMENT_NAME column (by selecting the check box beside it) for defining a list of values for the dname parameter.

5. Save the report. This takes you back to List of Values, which displays the query. 6. Click Save to save the changes to the report.

Associating the List of Values with a Parameter7. In the Parameters section (found in the Report pane on the left), select the parameter (dname in

the example) that must be associated with the list of values created. In Parameter Type that appears on the right, select Menu as the parameter type. (When using a list of values, you must always select Menu as the parameter type.)

8. In the Menu Setting section that appears below the General Settings section, enter a display label (such as Select Department Name) and ensure that the list of values (that you created) is selected from the List of Values drop-down list. (You can optionally select the “Can select all” check box to be able to see the data for all the values in the list).

9. Click Save to save the report.

Page 230: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 10

Copyright © 2008, Oracle. All rights reserved.

Cascading Parameters

Cascading ParametersOracle BI Publisher supports the use of cascading parameters. You can define cascading parameters, wherein the available values for the second parameter may depend on the values that you select for the first parameter. For example, if you have two parameters, one based on region and another based on country, you can set up the parameters as cascading parameters so that the list of countries that are available for the country parameter is based on the value that was selected for the parameter based onregion. That is, the list of countries is displayed based on the region selected. Similarly, a departmentcan be located in various cities. So when you select a department, the details of employees in all the cities where that particular department operates from must be displayed. Therefore, department and the cities where the department is located can be defined as cascading parameters.When you create these parameters with LOVs, you must select:

• Menu as the parameter type• Refresh other parameters on change. This performs a partial page refresh to refresh any other

parameters whose values are dependent on the value of this one.You can optionally select Multiple Selection and Can select all.

Page 231: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 11

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Reports with Hyperlinks

Hyperlinks in BI Publisher reports can be:• Fixed or dynamic• Added on a field or to shapes• Defined to drill down to details

BI Publisher Reports with HyperlinksOracle BI Publisher supports different types of hyperlinks. Hyperlinks can be fixed or dynamic and can link to either internal or external destinations. Hyperlinks can be added on a field as well as to shapes. You can create a report template with a link to another report. In reports with hyperlinks, you can drill down to see data or a different report that is linked to another report. For example, you can create a master report (Department Details) with a link defined on a field (department name or department number) to another report (employee salary report) with all employee details. So you can drill down on a department name to see details about employees who are working in that department.

Page 232: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 12

Copyright © 2008, Oracle. All rights reserved.

Creating a Report with a Hyperlink: Example

Creating a Report with a Hyperlink: ExamplePerform the following steps to create a report with a hyperlink:

1. Create a (master) report.2. Create an RTF template for this report (or use a predefined template).3. Create another report (with details) and edit it to include a parameter. (This value is passed from

the master report.)4. Define a hyperlink in the master report template.5. Drill down from one report to another by using the hyperlink.

Note: The slide shows the department details report with hyperlinks. When you click a department, it drills down to the report that shows employee details of that department.

Page 233: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 13

Copyright © 2008, Oracle. All rights reserved.

Creating a Master Report

Creating a Master ReportPerform the following steps to create a master report (Department Details) based on Oracle Database: (The steps to create a report based on Oracle Database are discussed in detail in the lesson titled “Introduction to XML Standards.”)

1. Create a report and edit it to define a new data model. Define the data source (in the example, demo) and the SQL query in Query Builder.

2. In Query Builder, select the schema and the tables to be queried. (In the example, select the HRschema and click the DEPARTMENTS, LOCATIONS, and COUNTRIES tables to define a query based on these tables.)

3. Define joins between these tables. (For example, define a join between the DEPARTMENTS and LOCATIONS tables by using the LOCATION_ID column in these tables. Similarly, define another join between the LOCATIONS and COUNTRIES tables by using the COUNTRY_ID column.)

4. Select the columns to be included in the query. 5. Save the report and view the XML data.

Page 234: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 14

Copyright © 2008, Oracle. All rights reserved.

Creating an RTF Template for the Master Report

Creating an RTF Template for the Master ReportYou can create an RTF template for your report or you can use a predefined template.The steps for creating RTF templates are discussed in the lesson titled “Getting Started with BI Publisher: Creating a Simple Report.” The steps are briefly listed here:

1. Open Microsoft Word and log in to BI Publisher.2. Load XML data by opening the BI Publisher report that you created.3. Create a table to represent the data in the report by using Insert > Table Wizard. Format the table

and template by using MS Word and the BI Publisher formatting options.4. Save the template as an RTF file.5. Upload the template for the report by using the Upload Template As option from the BI

Publisher menu. Note: A sample RTF template for the report with the department details is displayed in the slide.

Page 235: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 15

Copyright © 2008, Oracle. All rights reserved.

Creating and Editing a Detail Report

Creating and Editing a Detail ReportYou can use the employee salary report that you created earlier or you can create a separate employee details report to be linked to the Department Details master report. Note the following points when editing the detail report:

• Open the report in Edit mode and create a parameter on a column, for which the value will be passed from the master report. For the example in discussion, you must create a parameter based on the DEPARTMENT_ID column. In this case, enter a name as the identifier (such as dept_id), and select Integer as the data type and Text as the parameter type.

• Edit the query to include this parameter in the WHERE clause of the SQL query.

Page 236: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 16

Creating and Editing a Detail Report (continued)For the example, the edited query can look like this:

select DEPARTMENTS.DEPARTMENT_NAME as DEPARTMENT_NAME,EMPLOYEES.FIRST_NAME ||' '||EMPLOYEES.LAST_NAME as EMPLOYEE_NAME,EMPLOYEES.HIRE_DATE as HIRE_DATE,EMPLOYEES.SALARY as SALARY from HR.DEPARTMENTS DEPARTMENTS,HR.EMPLOYEES EMPLOYEES where DEPARTMENTS.DEPARTMENT_ID=EMPLOYEES.DEPARTMENT_IDand departments.department_id = :dept_id

(dept_id is the name of the parameter that you have created in the detail report.)

Page 237: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 17

Copyright © 2008, Oracle. All rights reserved.

Defining a Hyperlink

Defining a HyperlinkPerform the following steps to define the hyperlink in the master report template:

1. In BI Publisher (Web), copy the URL for the detail report (employee salary report) that you edited and created a parameter for.

2. Open the template file that you created for the master report in MS Word.3. Log in to BI Publisher and load the master report XML data by opening the report.4. Select the field that must be passed as the parameter (in the example, DEPARTMENT_NAME),

and select Insert > Hyperlink in MS Word.5. In the Insert Hyperlink window, paste the URL of the detail report that you copied earlier, and

add the parameter at the end. For this example, the string added at the end looks like this: ?dept_id={DEPARTMENT_ID}

6. Preview the template as PDF to check whether the links are working.

Page 238: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 18

Copyright © 2008, Oracle. All rights reserved.

Defining a Dynamic Hyperlink

• In the RTF template, define an XSLT variable:<?variable:report_url;string(‘http://<host>:<port>/xmlpserver/<URL for the Details report>?>

• Edit the hyperlink to use this variable.

Defining a Dynamic HyperlinkWord has a known limitation on the length of the URL defined. As a workaround for this issue, it is sometimes necessary to use an XSL Transformations (XSLT) variable to hold a portion of the URL. Define this variable in the RTF template file, and edit the hyperlink to use this variable. Note: Adding a variable in this manner makes the link dynamic.

Page 239: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 19

Copyright © 2008, Oracle. All rights reserved.

Viewing the Report Data

Viewing the Report DataIf you performed the steps correctly and defined the links properly, you should be able to click any of the links (in the example, department names) in the master report to drill down to see the details of employees working in the same department.

Page 240: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 20

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to: • Create a report with parameters and a list of values• Create a report with a hyperlink to another report

Page 241: D54122

Oracle BI Publisher 10g R3: Fundamentals 7 - 21

Copyright © 2008, Oracle. All rights reserved.

Practice 7: Overview

This practice covers the following topics:• Creating reports with parameters and a list of values• Creating a report with a hyperlink to another report• Viewing the data in the reports created

Page 242: D54122
Page 243: D54122

Copyright © 2008, Oracle. All rights reserved.

Working with PDF and eText Templates

Page 244: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to describe thefollowing features of Oracle BI Publisher:• The basics of PDF templates• The advanced capabilities of PDF templates• The basics of eText templates

Page 245: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 3

Copyright © 2008, Oracle. All rights reserved.

PDF Template Overview

You can take any existing PDF document and apply Oracle BI Publisher markup. You can obtain the initial source PDF document in the following ways:• Design the layout of your template by using any application

that generates documents that are convertible to PDF.• Print the document by using Adobe Acrobat Distiller.• Scan a paper document to PDF.• Download a PDF document from a third-party Web site.

PDF Template OverviewIf you are designing the layout, note that after you convert your document to PDF, your layout is treated like a set background. When you mark up the template, draw fields on top of this background. To edit the layout, you must edit your original document and then convert it back to PDF.For this reason, the PDF template is not recommended for documents that require frequent updates to the layout. However, it is appropriate for forms that have a fixed layout such as invoices or purchase orders.Note: Further information about creating PDF and eText templates can be found in “Creating a PDF Template” of the BI Publisher User’s Guide.

Page 246: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 4

Copyright © 2008, Oracle. All rights reserved.

Supported Modes

• Oracle BI Publisher supports Adobe Acrobat 5.0 (PDF Specification 1.4).

• If you are using Adobe Acrobat 6.0 (or later), use the Reduce File Size option to save the file so that it is compatible with Adobe Acrobat 5.0.

Page 247: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 5

Copyright © 2008, Oracle. All rights reserved.

Adding Markup to the Template Layoutfor Adobe Acrobat Users

Adding Markup to the Template Layout for Adobe Acrobat UsersAfter converting your document to PDF, you define form fields to display the data from the XML input file. These form fields are placeholders for the data.When you draw form fields in Adobe Acrobat, you are drawing them on top of the layout that you designed. There is no relationship between the design elements on your template and the form fields. Therefore, you must place the fields exactly where you want the data to display on the template.The markup procedures for Adobe Acrobat 5.0 and 6.0 (or later) are slightly different. These procedures are outlined on the following pages.ExampleThe example in the slide shows a completely marked-up PDF template for a W2 form.

Page 248: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 6

Copyright © 2008, Oracle. All rights reserved.

Accessing the Text Field Toolin Adobe Acrobat

Accessing the Text Field Tool in Adobe AcrobatAdobe Acrobat 6.0 (or later) (shown in the slide)

• Select Text Field Tool from the Forms toolbar.Adobe Acrobat 5.0

• Select Form Tool from the toolbar.

Page 249: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 7

Copyright © 2008, Oracle. All rights reserved.

Creating a Text Field in Adobe Acrobat

1

2

Creating a Text Field in Adobe AcrobatAdobe Acrobat 6.0 (or later)

1. Draw a form field box on the template where you want the field to be displayed. Result: The Text Field Properties dialog box appears.

2. On the General tab, enter a name for the placeholder in the Name field, which must exactly match your XML source (for example, Control_Number).

3. Use the Text Field Properties dialog box to set other attributes for the placeholder, such as enforce maximum character size, field data type, data type validation, visibility, and formatting.Note: In the example, the PDF template is w2.pdf and the XML source file is w2.XML. Both files are part of the BI Publisher Desktop sample files.

Adobe Acrobat 5.01. Draw a form field box on the template where you want the field to be displayed.2. In the Name field of the Field Properties dialog box, enter the placeholder name, which

must match the XML source field name.3. Select Text from the Type drop-down list.4. Use the Field Properties dialog box to set other attributes in the same way as with Acrobat

6.0.

Page 250: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 8

Copyright © 2008, Oracle. All rights reserved.

Supported Field Properties Options

Supported Field Properties OptionsBI Publisher supports the following options that are available from the Text Field Propertiesdialog box (in Acrobat 6.0 or later):General tab

• Common properties: Read-only, required, visible/hidden, orientation (in degrees)Appearance tab

• Border settings: Color, background, width, style• Text settings: Color, font, size• Border style

Options tab• Multi-line• Scrolling text

Format tab: Number category options onlyCalculate tab: All calculation functionsNote: For more information about these options, see the Adobe Acrobat documentation.

Page 251: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 9

Copyright © 2008, Oracle. All rights reserved.

Creating a Check Box

A check box is used to present options from which more than one option can be selected. Each check box represents a different data element. You define the value that will cause thecheck box to display as “checked.”

Creating a Check BoxA certain form contains a check box listing of automobile options such as Power Windows, Sunroof, and Alloy Wheels. Each option represents a different element from the XML file. If the XML file contains a value of "Y" for a field, you want the check box to display as “checked.” All or none of these options may be selected. To create the check box, perform the following steps:Acrobat 6.0 (and later)

1. Select the Check Box tool from the Forms toolbar.2. Draw the check box field in the desired position.3. On the General tab of the Check Box Properties dialog box, enter a name for the field.4. Click the Options tab.5. In the Export Value field, enter the value that the XML data field should match to enable

the “checked” state. For the example, enter “Y” for each check box field.Acrobat 5.0

1. Draw the form field.2. In the Field Properties dialog box, enter a name for the field.3. Select Check Box from the Type drop-down list.4. Click the Options tab.5. In the Export Value field, enter the value that the XML data field should match to enable

the “checked” state. For the example, enter “Y” for each check box field.

Page 252: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 10

Copyright © 2008, Oracle. All rights reserved.

Creating a Radio Button Group

A radio button group is used to display options from which only one can be selected.

Shipping MethodStandardOvernight

Creating a Radio Button GroupAcrobat 6.0 (and later):

1. Select the Radio Button tool from the Forms toolbar.2. Draw the form field on the template.3. On the General tab of the Radio Button Properties dialog box, enter a name for the field.

Each radio button can be named differently, but must be mapped to the same XML data field.

4. Click the Options tab. 5. In the Export Value field, enter the value that the XML data field should match to enable

the “on” state. Acrobat 5.0:

1. Draw the form field.2. On the Field Properties dialog box, enter a name for the field. Each radio button can be

named differently, but must be mapped to the same XML data field. 3. Select Radio Button from the Type drop-down list. 4. Click the Options tab.5. In the Export Value field, enter the value that the XML data field should match to enable

the “on” state. For the example in the slide, enter “Standard” for the field labeled “Standard” and "Overnight“ for the field labeled “Overnight.”

Page 253: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 11

Copyright © 2008, Oracle. All rights reserved.

Defining Groups of Repeating Fields

Defining Groups of Repeating FieldsIn the PDF template, you explicitly define the area on the page that contains the repeating fields. For example, on the purchase order template, the repeating fields must be displayed in the block of space between the Item header row and the Total field.To define the area to contain the group of repeating fields, perform the following steps:

1. Insert a form field at the beginning of the area that is to contain the group. (Acrobat 6.0 users must select the Text Field tool, and then draw the form field.)

2. In the Name field of the Field Properties window, enter a name. This field is not mapped.3. Acrobat 5.0 users: Select Text from the Type drop-down list.4. In the Short Description field (Acrobat 5.0) or the Tooltip field (Acrobat 6.0) of the Field

Properties window, enter the following syntax: <?rep_field="BODY_START"?>

5. Define the end of the group area by inserting a form field at the end of the area that is to contain the group.

6. In the Name field of the Field Properties window, enter a name. This field is not mapped. Note that the name you assign to this field must be different from the name you assigned to the <?rep_field="BODY_START"?> field.

Page 254: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 12

Defining Groups of Repeating Fields (continued)7. Acrobat 5.0 users: Select Text from the Type drop-down list.8. In the Short Description field (Acrobat 5.0) or the Tooltip field (Acrobat 6.0) of the Field

Properties window, enter the following syntax: <?rep_field="BODY_END"?>To define a group of repeating fields, perform the following steps:

1. Insert a placeholder for the first element of the group.2. For each element in the group, enter the following syntax in the Short Description field

(Acrobat 5.0) or the Tooltip field (Acrobat 6.0): <?rep_field="T1_Gn"?> where n is the row number of the item in the template.

Note: The placement of this field in relationship to the BODY_START tag defines the distance between the repeating rows for each occurrence.For example, the group in the sample report is laid out in three rows:

• For fields belonging to the row that begins with POL_ITEM_DESCRIPTION, enter <?rep_field="T1_G1"?>.

• For fields belonging to the row that begins with C_FLEX_ITEM_DISP, enter <?rep_field="T1_G2"?>.

• For fields belonging to the row that begins with C_SHIP_TO_ADDRESS, enter <?rep_field="T1_G3"?>.

Page 255: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 13

Copyright © 2008, Oracle. All rights reserved.

Adding Page Numbers

To add page numbers, define a field in the template where you want the page number to appear and then enter an initial value in that field as follows:1. Decide the position on the template where you want the

page number to be displayed.2. Create a placeholder field called @[email protected]. Enter a starting value for the page number in the Default

field. If the XML data includes a value for this field, the starting value assigned in the template is overridden. If no starting value is assigned, it defaults to 1.

Page 256: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 14

Copyright © 2008, Oracle. All rights reserved.

Adding Page Breaks

In your template, you can define a page break to occur after a repeatable field. • To insert a page break after the occurrence of a specific

field, add the following to the syntax in the Short Description field of the Field Properties dialog box (use the Tooltip field for Acrobat 6.0): page_break="yes"

• Example:<?rep_field="T1_G3", page_break="yes"?>

Note: For the break to occur, the field must be populated with data from the XML source.

Page 257: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 15

Copyright © 2008, Oracle. All rights reserved.

Performing Calculations

Performing CalculationsAdobe Acrobat provides a calculation function in the Text Field Properties dialog box. To create a field to display a calculated total on your report, perform the following steps:

1. Create a text field to display the calculated total. Give the field a name.2. In the Text Field Properties dialog box, click the Format tab and select Number from the

Category list.3. Click the Calculate tab.4. Select the second option button (Value is the <operation> of the following fields:). 5. Select sum (+) from the drop-down list.6. Click the Pick button, and select the fields that you want totaled.

Page 258: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 16

Copyright © 2008, Oracle. All rights reserved.

Run-Time Behavior

Placement of repeating fields:• The placement, spacing, and alignment of fields that you

create in the template are independent of the underlying form layout.

• At run time, Oracle BI Publisher places each repeating row of data according to calculations performed on the placement of the rows of created fields.

Run-Time BehaviorPlacement of Repeating Fields As already noted, the placement, spacing, and alignment of fields that you create on the template are independent of the underlying form layout. At run time, BI Publisher places each repeating row of data according to calculations performed on the placement of the rows of fields that you created, as follows:First occurrenceThe first row of repeating fields is displayed exactly where you placed them on the template.Second occurrence, single rowTo place the second occurrence of the group, BI Publisher calculates the distance between the BODY_START tag and the first field of the first occurrence. The first field of the second occurrence of the group is placed at the calculated distance below the first occurrence.Second occurrence, multiple rowsIf the first group contains multiple rows, the second occurrence of the group is placed at the calculated distance below the last row of the first occurrence. The distance between the rows within the group is maintained as defined in the first occurrence.

Page 259: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 17

Copyright © 2008, Oracle. All rights reserved.

Downloaded PDFs

Downloaded PDFsThere are many PDF forms available online that you may want to use as templates for your report data—for example, government forms that your company is required to submit.You can use these downloaded PDF files as your report templates, and supply the XML data at run time to fill the report. Note: Some of these forms already have form fields defined; some do not. If the form fields are not defined in the downloaded PDF, you must create them.

Page 260: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 18

Copyright © 2008, Oracle. All rights reserved.

Using Downloaded PDFs with Form Fields

Using Downloaded PDFs with Form FieldsThe following is a summary of the steps used to prepare downloaded PDF files with form fields:

1. Download the PDF file to your local system.2. Open the file in Adobe Acrobat.3. Select the Text Field tool (Acrobat 6.0 users) or the Form tool (Acrobat 5.0 users). This

highlights text fields that were already defined.4. To map the existing form fields to the data from your incoming XML file, rename the fields

to match the element names in your XML file.5. Open the text form field’s Properties dialog box either by double-clicking the field or

selecting the field and then selecting Properties from the shortcut menu.6. In the Name field, enter the element name from your input XML source.7. Repeat steps 5 and 6 for all fields that you want populated by your data file.

Page 261: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 19

Copyright © 2008, Oracle. All rights reserved.

Running Reports with PDF Templates:Define Data Model

1

2

Running Reports with PDF Templates: Define Data ModelYou can run a report in BI Publisher to test your completed PDF template.First, create a data model for the report and perform the following steps:

1. Specify File as the type.2. Identify the name of the XML file as the source data in the File Name field.

ExampleThe data source file, W2.xml, is one of the sample XML data files for PDF templates.

Page 262: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 20

Copyright © 2008, Oracle. All rights reserved.

Running Reports with PDF Templates:Upload Template

3 4

5

Running Reports with PDF Templates: Upload TemplateAfter you define the data model, create a new layout and perform the following steps:

3. In the Manage Template Files pane, click Browse to find the PDF template file.4. Click Upload.5. In the General Settings pane, select PDF Template as the template type.

Page 263: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 21

Copyright © 2008, Oracle. All rights reserved.

Running Reports with PDF Templates:View Report

Running Reports with PDF Templates: View ReportYou view the PDF template report in BI Publisher just as you would any report with an RFT template.After the PDF template is associated with the BI Publisher report (via access to the XML file as its data source) and the report is saved, click View.ExampleThe example shows the result of the completed w2.pdf template combined with the w2.xmldata source file.

Page 264: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 22

Copyright © 2008, Oracle. All rights reserved.

eText Templates

An eText template is:• An RTF-based template that is used to generate text output

for electronic funds transfer (EFT) and electronic data interchange (EDI)

• Applied at run time by Oracle BI Publisher to an input XML data file to create an output text file that can be transmitted to a bank or another customer

eText TemplatesAn eText template is an RTF-based template that is used to generate text output for electronic funds transfer (EFT) and electronic data interchange (EDI). At run time, BI Publisher applies this template to an input XML data file to create an output text file that can be transmitted to a bank or another customer. Because the output is intended for electronic communication, the eText templates must follow specific format instructions for exact placement of data.

• Note: An EFT is an electronic transmission of financial data and payments to banks in a specific fixed-position format flat file (text).

• EDI is similar to EFT, except that it is not limited to the transmission of payment information to banks. It is often used as a method of exchanging business documents, such as purchase orders and invoices, between companies. EDI data is delimiter-based and also transmitted as a flat file (text).

Files in these formats are transmitted as flat files, rather than printed on paper. The length of a record is often several hundred characters and, therefore, difficult to lay out on standard size paper.

Page 265: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 23

eText Templates (continued)To accommodate the record length, the EFT and EDI templates are designed using tables. Each record is represented by a table. Each row in a table corresponds to a field in a record. The columns of the table specify the position, length, and value of the field.These formats can also require special handling of the data from the input XML file. This special handling can be on a global level (for example, character replacement and sequencing) or on a record level (for example, sorting). Commands to perform these functions are declared in command rows. Global-level commands are declared in setup tables.At run time, Oracle BI Publisher constructs the output file according to the setup commands and layout specifications in the tables.Note: Further information about creating eText templates can be found in “Creating an eText Template” in the BI Publisher User’s Guide.

Page 266: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 24

Copyright © 2008, Oracle. All rights reserved.

Structure of eText Templates

Structure of eText TemplatesThere are two types of eText templates: fixed position–based (EFT templates) and delimiter-based (EDI templates). The templates contain a series of tables. The tables define layout, setup commands, and data field definitions. The required data description columns for the two types of templates vary, but the commands and functions are the same. A table can contain just commands, or it can contain commands and data fields.

Page 267: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 25

Copyright © 2008, Oracle. All rights reserved.

Row Types

Row TypesCommand rows are used to specify commands in the template. Command rows always have two columns: command name and command parameter. Command rows do not have column headings. Commands control the overall setup and record structures of the template.Blank rows can be inserted anywhere in a table to improve readability. Most often, they are used in the setup table, between commands. Blank rows are ignored by Oracle BI Publisher when the template is parsed.Data column headers specify the column headings for data fields (such as Position, Length, Format, Padding, and Comments). A column header row usually follows the LEVEL command in a table (or the sorting command, if one is used). The column header row must come before any data rows in the table. Additional empty column header rows can be inserted at any position in a table to improve readability. The empty rows are ignored at run time.Data rows contain data fields to correspond to the column header rows.

Page 268: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 26

Copyright © 2008, Oracle. All rights reserved.

Setup Command Tables

A template always begins with a table that defines global attributes and program elements. The setup commands are:• Template type• Output character set• New record character• Invalid characters• Replace characters• Define level• Define sequence• Define concatenation

Setup Command TablesA template always begins with a table that specifies setup commands. Setup commands define global attributes (such as template type and output character set) and program elements (such as sequencing and concatenation).

Page 269: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 27

Copyright © 2008, Oracle. All rights reserved.

Constructing Data Tables

• Data tables contain a combination of command rows and data field rows.

• Each data table must begin with a LEVEL command row that specifies its XML element.

• Each record must begin with a NEW RECORD command that specifies the start of a new record and the end of a previous record (if any).

• The required columns for the data fields vary, depending on the template type.

Page 270: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 28

Copyright © 2008, Oracle. All rights reserved.

Command Rows

Command rows always have two columns:• Command name• Command parameter

The supported commands are:• LEVEL• NEW RECORD• SORT ASCENDING• SORT DESCENDING• DISPLAY CONDITION

Command RowsLEVEL CommandThe LEVEL command associates a table with an XML element. The parameter for the LEVELcommand is an XML element. The level is printed once for each instance that the XML element appears in the data input file.LEVEL commands define the hierarchy of the template. For example, Payment XML data extracts are hierarchical. A batch can have multiple child payments, and a payment can have multiple child invoices. This hierarchy is represented in XML as nested child elements within a parent element. By associating the tables with XML elements through the LEVEL command, the tables also have the same hierarchical structure.Similar to the closing tag of an XML element, the LEVEL command has a companion end-level command. The child tables must be defined between the LEVEL and end-level commands of the table that is defined for the parent element.An XML element can be associated with only one level. All records belonging to a level must reside in the table of that level or within a nested table belonging to that level. The end-level command is specified at the end of the final table.

Page 271: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 29

Command Rows (continued)NEW RECORD CommandThe NEW RECORD command signifies the start of a record and the end of the previous one, if any. Every record in a template must start with the NEW RECORD command. The record continues until the next NEW RECORD command, or until the end of the table or the end of the LEVEL command.A record is a construct for the organization of elements belonging to a level. The record name is not associated with the XML input file.A table can contain multiple records, and therefore multiple NEW RECORD commands. All records in a table are at the same hierarchy level. They are printed in the order in which they are specified in the table.SORT ASCENDING and SORT DESCENDING CommandsUse the SORT ASCENDING and SORT DESCENDING commands to sort the instances of a level. Enter the elements you want to sort by in a comma-separated list. This is an optional command. When used, it must come right after the (first) LEVEL command, and it applies to all records of the level, even if the records are specified in multiple tables.DISPLAY CONDITION CommandThe DISPLAY CONDITION command specifies when the enclosed record or data field group must be displayed. The command parameter is a Boolean expression. When it evaluates to true, the record or data field group is displayed. Otherwise, the record or data field group is skipped.The DISPLAY CONDITION command can be used with either a record or a group of data fields. When used with a record, the DISPLAY CONDITION command must follow the NEW RECORD command. When used with a group of data fields, the DISPLAY CONDITIONcommand must follow a data field row. In this case, the display condition applies to the rest of the fields through to the end of the record.Consecutive DISPLAY CONDITION commands are merged as AND conditions. The merged display conditions apply to the same enclosed record or data field group.

Page 272: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 30

Copyright © 2008, Oracle. All rights reserved.

Structure of Data Rows

The output record data fields are represented in the template by table rows. In FIXED_POSITION_BASED templates, each row has the following attributes (or columns):• Position• Length• Format• Pad• Data• Comments

Structure of Data RowsThe first five columns (listed in the slide) are required and must be declared in the order stated.The Comments column is optional and ignored by the system. You can insert additional information columns if you want; however, all columns after the required ones are ignored.

Page 273: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 31

Copyright © 2008, Oracle. All rights reserved.

Structure of Data Rows

The output record data fields are represented in the template by table rows. In DELIMITER_BASED templates, each row has the following attributes (or columns):• Maximum length• Format• Data• Tag• Comments

Structure of Data Rows (continued)The first three columns are required and must be declared in the order stated.The last two columns are optional. The Comments column is ignored by the system. You can insert additional information columns if you want; however, all columns after the required ones are ignored.

Page 274: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 32

Copyright © 2008, Oracle. All rights reserved.

Using Template Viewer

You can use BI Publisher Template Viewer to view templates, forms, and style sheets.

Using Template ViewerBI Publisher Template Viewer is a Java application that facilitates the rapid development of format templates for use with Oracle BI Publisher. The application requires Java Runtime Environment (JRE) version 1.5.x or later installed on your desktop.Template Viewer enables you to preview:

• RTF templates • PDF forms• eText templates• XSL-FO style sheets

Why Use Template Viewer?In general, Template Viewer is a tool that is used when using editors other than Word or when advanced tags are used.Note: If you are using Word, you can view the results of your report directly in Oracle BI Publisher Desktop. But Template Viewer reproduces the same capabilities, and it has capabilities that are not available to you through Word (namely, viewing PDF templates).

Page 275: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 33

Copyright © 2008, Oracle. All rights reserved.

Viewing an eText Template

3

21

4

Viewing an eText TemplateBrowse and select a working directory that contains the XML files and the corresponding template files. To generate an output, perform the following steps:

1. Select the XML file (listed on the left side).2. Select a template (listed on right side).3. Select an output format (such as PDF, HTML, and so on) from the drop-down list.4. Click the Start Processing button.

The bottom pane shows information about logging or errors during the processing phase. Note: Double-click the XML to spawn the XML in a browser. Double-click the template to start your RTF editor (for example, Microsoft Word or Adobe Acrobat, depending on the template type).ExampleIn this example, your working directory is the following: D:\Program Files\Oracle\BI Publisher Desktop\samples\eText templates\example1\

Page 276: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 34

Copyright © 2008, Oracle. All rights reserved.

Viewing the Output

Viewing the OutputThe output is displayed in the format you chose (in the example, PDF format).

Page 277: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 35

Copyright © 2008, Oracle. All rights reserved.

Summarizing eText Templates

eText templates are specific to the application (EDI or EFT) andare rigidly and tightly controlled. Because of this, eText template creation is not trivial. The Oracle BI Publisher User’s Guide must be consulted.

Page 278: D54122

Oracle BI Publisher 10g R3: Fundamentals 8 - 36

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to describe the following features of Oracle BI Publisher:• The basics of PDF templates• The advanced capabilities of PDF templates• The basics of eText templates

Page 279: D54122

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher Server: Administration

Page 280: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:• Describe BI Publisher–supported security models• Configure the following:

– Data sources– Users – Roles and permissions– Delivery options

• Perform other administrative tasks

Page 281: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 3

Copyright © 2008, Oracle. All rights reserved.

Administration Options

Using the BI Publisher Administration interface, you can:• Set up:

– Data sources– Users and roles– Delivery options– The server configuration file

• Refresh the metadata• Set up integration with Oracle BI Presentation Services and

Oracle BI Discoverer

Page 282: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 4

Copyright © 2008, Oracle. All rights reserved.

Logging In to BI Publisher Server

Logging In to BI Publisher ServerYou must log in to BI Publisher as administrator to perform administrative tasks. The default username and password are Administrator/Administrator.Log in to BI Publisher in one of the following ways:

• Enter the URL for BI Publisher in a browser window, which is of the following format:http://<hostname>:<port>/xmlpserver/

• If you have installed BI Publisher along with Oracle BI Enterprise Edition, select All Programs > Oracle Business Intelligence > BI Publisher from the Start menu.

Note: (This topic was discussed in the lesson titled “Introduction to XML Standards.”) If you installed BI Publisher in stand-alone mode, select All Programs > Oracle - OracleHome > BI Publisher Server from the Start menu to log in.OracleHome refers to the name of the Oracle Home, where you installed Oracle BI Publisher.

Page 283: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 5

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Home Page

BI Publisher Home PageThe BI Publisher Home page displays the Reports, Schedules, and Admin tabs. The Admin tab is displayed for users who have administrative privileges. The page displays folders and reports associated with the user.Reports: You can create, edit, view, schedule, and manage your reports from this page. You can also create folders to organize your reports. Also, you can install developer tools such as Excel Analyzer and Template Builder.Schedules: You can schedule your reports, manage scheduled reports, and view the scheduled report results and history from this page. This tab is activated only when BI Publisher Scheduler is configured.Note: The schedule link for a report or the Schedules tab is activated only when BI Publisher Scheduler is configured.Admin: You can perform all administrative tasks for BI Publisher Server on this page. These are discussed in detail in the following pages.

Page 284: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 6

Copyright © 2008, Oracle. All rights reserved.

Administration Settings

Administration SettingsThe BI Publisher Enterprise Home page displays three tabs. Click Admin to see the administration settings that can be configured. These administrative tasks are covered in the following pages.

Page 285: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 7

Copyright © 2008, Oracle. All rights reserved.

Data Sources

Data SourcesClick one of the data source links to create a connection to a data source. In BI Publisher, you can create connections based on one of the following three data sources:

• JDBC Connection: This option enables you to create a connection to a database based on the JDBC driver.

• JNDI Connection: This option enables you to define a connection to the JNDI data source.• File: The file data source option enables you to define a mapping to a local directory on

your file system, to which BI Publisher can connect. You can then place XML files in this directory to use as data input to your reports.

These options are discussed in the following pages.

Page 286: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 8

Copyright © 2008, Oracle. All rights reserved.

Setting Data Sources: JDBC

Setting Data Sources: JDBCJava Database Connectivity (JDBC) is an object-oriented API that provides a common means for accessing a relational database. So the default assumption is that the connection is to an Oracle 10g database; but in general it can connect to any database that supports the JDBC API. Click Add Data Source, and enter the following information to create a JDBC connection:Data Source Name: A display name for the data sourceURL:

• For Oracle databases, the connect string has the following format:jdbc:oracle:thin:@server:port:sid

• For Microsoft SQL Server, the connect string has the following format:jdbc:sqlserver://server

Username: The database username that is required to access the data sourcePassword: The password that is associated with the usernameDatabase Driver Class:

• For Oracle databases: oracle.jdbc.driver.OracleDriver• For Microsoft SQL Server:com.microsoft.jdbc.sqlserver.SQLServerDriver

Page 287: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 9

Copyright © 2008, Oracle. All rights reserved.

Testing the JDBC Connection

Testing the JDBC ConnectionAfter defining the details, click Test Connection to see whether the connection is established successfully. If the test is successful, the confirmation message “Connection established successfully” is displayed. If a connection error occurs, the message “Could not establish connection” is displayed. If your test is successful, click Apply to save your changes.

Page 288: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 10

Copyright © 2008, Oracle. All rights reserved.

Setting Data Sources: JNDI

Setting Data Sources: JNDIJava Naming and Directory Interface (JNDI) is an object-oriented API that provides a common means for accessing different names and directory servers, including Common Object Request Broker Architecture (CORBA), Java Remote Method Invocation (RMI), Enterprise JavaBeans (EJB), and directory services such as Lightweight Directory Access Protocol (LDAP). On the Admin page, click JNDI Connection, and click Add Data Source to add a JNDI connection. Specify the following information:

• Data Source Name: Enter a display name for the data source. • JNDI Name: Enter the JNDI name of the data source.• Use Proxy Authentication: Select this check box to enable proxy authentication. This

applies to Oracle 10g deployments only. Note: For more information, see the Oracle Database Security Guide 10g.

Page 289: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 11

Copyright © 2008, Oracle. All rights reserved.

Setting Data Sources: Files

Setting Data Sources: FilesOn the Admin page, select File to display the list of existing file sources. Click the Add Data Source button. Enter the following fields for the new File data source:

• Data Source Name: A display name for the data source• Path: The full path to the directory on your file system

Page 290: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 12

Copyright © 2008, Oracle. All rights reserved.

Viewing or Updating a Data Source

Viewing or Updating a Data SourceOn the Admin page, select the data source type to update. Select the name of the connection to view or update that connection. All fields are updatable. Select Apply to apply any changes or Cancel to exit the update page.

Page 291: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 13

Copyright © 2008, Oracle. All rights reserved.

BI Publisher: Supported Security Models

BI Publisher: Supported Security ModelsYou can configure the security model in BI Publisher by selecting the Security Configuration

option in the Security Center section on the Admin page.BI Publisher supports the following options for implementing user security:

• BI Publisher Security: Use BI Publisher’s Users and Roles paradigm to control access toreports and data sources.

• LDAP: Set up the BI Publisher roles in your LDAP server and configure BI Publisher to integrate with it.

• Oracle E-Business Suite: Upload a DBC file to recognize your Oracle E-Business Suite users.

• Oracle BI Server: Set up BI Publisher roles in your BI Server Administration tool and configure BI Publisher to integrate with it.

Note• This lesson covers BI Publisher security. However, when you select BI Publisher Security

as the Security Model, the Users link is displayed under Security Center section on the Admin page of BI Publisher (so that you can create and configure users).

• For more information about how to set up the other security models, refer to the Oracle Business Intelligence Publisher User's Guide.

Page 292: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 14

Copyright © 2008, Oracle. All rights reserved.

BI Publisher Security Model: Security Center

BI Publisher Security Model: Security CenterUsing the Security Center options, you can create users and roles for implementing BI Publisher native security. Users: Controls who can run reportsRoles: Determines a user’s permissions (for example, the folders that can be accessed) and how each folder controls what reports a user can run

Page 293: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 15

Copyright © 2008, Oracle. All rights reserved.

Users and Roles

Users and RolesA user can be granted one or multiple roles. A role defines a user’s access to folders and functions. A role can be assigned one or multiple folders to which access is granted. Reports are contained within the folders. You can create a hierarchy of roles by assigning roles to other roles. In this way, the privileges of multiple roles can be applied to higher-level roles. The graphic in the slide shows an example of the hierarchy structure of User, Role, and Folder.

Page 294: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 16

Copyright © 2008, Oracle. All rights reserved.

Functional Roles

View, History, Grants access to the Online AnalyzerBI Publisher Online Analyzer

View, Edit, Schedule, History, Configure Folder, Report Tasks, Excel Analyzer, Online AnalyzerAdmin tab, and all administration tasks Enables logon from the Template Builder

BI Publisher Administrator

View, History, Edit, Configure Folder, and Report Tasks, Enables logon from the Template Builder

BI Publisher Developer

View, History, Enables logon from Template BuilderBI Publisher Template Designer

BI Publisher Scheduler

BI Publisher Excel Analyzer

No roles assigned

Role

View (online reports only)

View, Schedule, History

View, History, Grants access to the Excel Analyzer

Privileges

Functional RolesOracle BI Publisher provides six different functional roles for granting access to specific tasks within the application. Assign these roles to users based on their need to perform the associated tasks. These roles cannot be updated or deleted. The table in the slide shows the privileges granted to each functional role.Note: The default user Administrator has the BI Publisher Administrator role.

Page 295: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 17

Copyright © 2008, Oracle. All rights reserved.

Setting Up Users, Roles, and Permissions

Setting Up Users, Roles, and PermissionsAdding a User

• From the Security Center, click the Users tab. This invokes the Security Center Users page. Here, you see the list of existing users.

• Select Create User. • Add the username and password for the user.• Select Apply.

Updating a User• From the Security Center, click the Users tab. This invokes the Security Center Users page.

Here, you see the list of existing users. • Select the username. You can update both the username and the password. • Select Apply.

Adding a Role to a User• From the Security Center, select the Users tab. This invokes the Security Center Users page.

Here, you see the list of existing users. • Click Assign Roles for the user. • On the Assign Roles page, select the role from the Available Roles list, and move the role to

the Assigned Roles list. After you assign all roles, select Apply.

Page 296: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 18

Copyright © 2008, Oracle. All rights reserved.

Setting Up Roles and Permissions

Setting Up Roles and PermissionsCreating a Role

• From the Security Center, click the Roles and Permissions tab. This invokes the Roles and Permissions page in Security Center. Here, you see the list of existing roles and permissions.

• Select Create Role.• Enter a role name and description, and click Apply.After a role is created, you can add folders, data sources, and other roles to it:

Adding a Folder to a Role• Click the Add Folders icon for the role that you created. • Select a folder from the Available Folders list, and move it to the Allowed Folders list. • Note that the folders are presented as the directory structure that is set up in your system.

Selecting the top-level folder grants access to all subfolders. Selecting just the subfolder entry allows access only to the subfolder.

• Click Apply.

Page 297: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 19

Setting Up Roles and Permissions (continued)Adding a Data Source to a Role

• Click the Add Data Sources icon for the role that you created. • Move selections from the Available Data Sources list to the Allowed Data Sources list.• Users with this role are allowed to run only reports that access data sources on the Allowed

Data Sources list.Adding a Role to a Role

• Click the Add Roles icon for the role that you created. • Select a role from the Available Roles list and move it to the Included Roles list.• Click Apply.

Note: On the Digital Signature page in the Security Center, you can also set up digital signatures for a user.

Page 298: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 20

Copyright © 2008, Oracle. All rights reserved.

Delivery Options

Delivery OptionsYou can configure your BI Publisher reports to be delivered to various media, such as Email, Printer, Fax, and FTP.

Page 299: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 21

Copyright © 2008, Oracle. All rights reserved.

Setting Up Delivery Options: Configuration

Setting Up Delivery Options: ConfigurationOn the Admin page, select Delivery Configuration under Delivery.Enter the following properties:

• SSL Certificate File: If secure sockets layer (SSL) is enabled for your installation, you can leave this field empty to use the default certificates built in with BI Publisher. SSL works with the default certificate if the server uses the certificate signed by a trusted certificate authority such as Verisign. This field is mandatory only if the user uses the SSL with a self-signed certificate. The self-signed certificate indicates that the certificate is signed by anontrusted certificate authority (usually, the user).

• Email From Address: Enter the From address that you want to display on email reportdeliveries from the BI Publisher Server. The default value is [email protected].

• Delivery Notification Email From Address: Enter the From address that you want to display on notifications delivered from the BI Publisher Server. The default value is [email protected].

• Notification Subject: Enter the subject line that you want to display on the email messages for each of the following delivery types: Success, Warning, and Failure.

Page 300: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 22

Copyright © 2008, Oracle. All rights reserved.

Setting Up Delivery Options: Printer

Setting Up Delivery Options: PrinterOn the Admin page, select Printer to show the list of servers already added. Click Add Server.Enter the server name and host for the new server. Note: For optional printer options information, see the next page.

Page 301: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 23

Setting Up Delivery Options: Printer (continued)Enter the following optional information, if appropriate:

• General fields: Filter- Filter: You can call a conversion utility to convert PDF to Postscript or PDF to TIFF

(for fax) for Windows-based print servers. To specify the filter, pass the native OS command string with the two placeholders for the input and output file names: {infile} and {outfile}.

- This is especially useful if you are trying to call Internet Printing Protocol (IPP) printers directly or IPP printers on Microsoft Internet Information Service (IIS). Unlike Common UNIX Printing System (CUPS), those print servers do not translate the print file to a format that the printer can recognize. Therefore, only limited document formats are supported. With the filter functionality, you can call any native OS command to transform the document to the format that the target printer can recognize.

- For example, to transform a PDF document to a Postscript format, enter the following PDF-to-PS command in the Filter field:pdftops {infile} {outfile}

- To call an HP LaserJet printer setup on a Microsoft IIS from Linux, you can set Ghostscript as a filter to transform the PDF document into the format that the HP LaserJet can recognize. To do this, enter the following Ghostscript command in the Filter field:

gs -q -dNOPAUSE -dBATCH -sDEVICE=laserjet –sOutputFile={outfile} {infile}

- For fax servers, you can use the filter to transform the file to tag image file format (TIFF).

- Note that this functionality works only if the buffering mode is True and a valid temporary directory is specified.See the “Setting up Delivery Options” topic in the Oracle Business Intelligence Publisher User’s Guide for more information.

• Security fields: Username (required), Password (required), Authentication Type (None, Basic, or Digest), and Encryption Type (None, SSL)

• Proxy Server fields: Host, Port, Username, Password, and Authentication Type (None, Basic, or Digest)Note: An asterisk ‘*’ beside a field name indicates that it is a mandatory field.

Page 302: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 24

Copyright © 2008, Oracle. All rights reserved.

Setting Up Delivery Options: Fax

Setting Up Delivery Options: Fax On the Admin page, select Fax to show the list of servers already added. Click Add Server.Enter the name and host for the new server.Optional: Enter the following information, as appropriate:

• Port • URI• Filter • Security • Proxy server

Page 303: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 25

Copyright © 2008, Oracle. All rights reserved.

Setting Up Delivery Options: WebDAV

Setting Up Delivery Options: WebDAVWeb-based Distributed Authoring and Versioning (WebDAV) is a standard promoted by the Internet Engineering Task Force (IETF), which provides extensions to HTML that allow for collaborative editing and management of files on remote Web servers. It provides its features via XML properties for metadata, locking, namespace manipulation, and remote management of files on the server

• On the Admin page, select WebDAV. This shows the list of servers already added. Click Add Server.

• Enter the name and host for the new server. • Optional: Enter the following information, if appropriate:

General fields: PortSecurity fields: Authentication Type (None, Basic, or Digest) and Encryption Type (None or SSL).Proxy Server fields: Host, Port, User Name, Password, and Authentication Type (None, Basic, or Digest)

Note: You must enter a unique name for each server regardless of the type (printer, fax, email, WebDAV, or FTP).

Page 304: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 26

Copyright © 2008, Oracle. All rights reserved.

Setting Up Delivery Options: Email or FTP

Setting Up Delivery Options: Email or FTP• On the Admin page, select Email or FTP to show the list of servers already added. Click

Add Server.• Enter the server name and host for the email server.• Optional: Enter the following information, if appropriate:

- General fields: Port - Security fields: Username and Password (required)

Page 305: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 27

Copyright © 2008, Oracle. All rights reserved.

System Maintenance

System MaintenanceUnder System Maintenance, perform the following administration tasks:

• Set the report repository.• Set server configuration options.• Set scheduler configuration options. (This topic is covered in the lesson titled “Scheduling

Reports and Analyzing Data.”)• Refresh the metadata.

Page 306: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 28

Copyright © 2008, Oracle. All rights reserved.

Defining Report Repository

Defining Report RepositoryThe report repository can be set up in either the file system or the XML database.Defining a File System-Based Repository

• Under Report Repository, select File System as the repository type.• Enter the absolute path—for example, /home/bipublisher/repository.

Defining an XML Database Repository• Under Report Repository, select XML DB as the repository type.• Enter the absolute path—for example, /public/Reports.• Select the connection type: JDBC or JNDI.• If you select JNDI, enter the JNDI connection pool name.• If you select JDBC (not recommended), enter the following:

- URL Example: jdbc:oracle:thin:@rpts.mycompany.com:1521:ora10g

- Username- Password- Database Driver Class

Example: oracle.jdbc.driver.oracleDriverNote: The JDBC connection type is not recommended for the XML DB repository. If you stop and start or restart the database that contains your BI Publisher repository, you must also restart your BI Publisher Server.

Page 307: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 29

Copyright © 2008, Oracle. All rights reserved.

Server Configuration

Server ConfigurationDefining General Properties

• Debug Level: Controls the amount of debug information generated by the system. If set to Exception (the default setting), only error information is generated. If set to Debug, all system output is generated.

• Report Viewer Height: Sets the size of the report-viewing frame in your browser. Enter a value in pixels. The default is 600.

• Report Scalable Threshold: Sets the threshold at which data is cached on the disk. When the data volume is very large, caching the data saves memory, but results in slower processing. Enter a value in kilobytes. The default is 10000000 (10 megabytes).

• Output Formats: Select the formats that you want displayed to the user by default for every RTF template–based report. This server-level setting is overridden by the Output Format types selected in the report definition.

Page 308: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 30

Server Configuration (continued)Setting Cache SpecificationsSet the following properties to configure the BI Publisher cache:

• Cache Expiration: Enter the expiration period for the data set cache in minutes. The default is 30.For data sets returned by a SQL query, HTTP, or Oracle BI Answers, you have the option of caching the data set returned by the query. The returned data set remains in cache for the period specified by this property.

• Cache Size Limit: Enter the maximum number of data sets to maintain in the cache. The default is 1000.

• Maximum Cached Reports: Enter the maximum number of reports to maintain in the cache. The default is 50.

Page 309: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 31

Copyright © 2008, Oracle. All rights reserved.

Scheduler Configuration

Scheduler ConfigurationSelect the Scheduler Configuration tab to configure the BI Publisher scheduler. More details about configuring BI Publisher scheduler and scheduling reports are discussed in the lesson titled “Scheduling Reports and Analyzing Data.”

Page 310: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 32

Copyright © 2008, Oracle. All rights reserved.

Refreshing the Metadata

Refreshing the MetadataThe metadata for this server is kept in the following location:

E:\<OraHome>\xmlp\XMLP\ReportsTo delete an object from the Home page on the BI Publisher Server, delete the objects from the file system and refresh the metadata.

Page 311: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 33

Copyright © 2008, Oracle. All rights reserved.

Integration with BI Products

Integration with BI ProductsBI Publisher is integrated with other BI products, such as Oracle BI Enterprise Edition and Oracle BI Discoverer. You can set up integration with these products by using the Integration options on the Admin page. By setting up integration with Oracle BI Presentation Services, you enable connection to Oracle BI Answers requests as data sources for your reports. With this integration, you can also create BI Publisher reports based on Oracle BI Server subject areas. Similarly, when you set up integration with Discoverer, this integration enables BI Publisher to access the Discoverer worksheet content as a data source for BI Publisher reports. These integrations are covered in more detail in the lessons titled “Creating Reports by Defining XML Data Templates” and “Oracle BI Publisher Integration Features.”Note: If you installed BI Publisher Enterprise along with your Oracle BI Enterprise Edition installation, the Oracle BI installer sets the integration automatically—that is, it sets up the Presentation Services host name, port, and URL values. However, you must manually enter the Presentation Services username and password here.

Page 312: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 34

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:• Describe BI Publisher–supported security models• Configure the following:

– Data sources– Users – Roles and permissions– Delivery options

• Perform other administrative tasks

Page 313: D54122

Oracle BI Publisher 10g R3: Fundamentals 9 - 35

Copyright © 2008, Oracle. All rights reserved.

Practice 9: Overview

This practice covers the following topics:• Defining data sources (file data source)• Creating users and roles in BI Publisher Enterprise• Configuring the Email Server

Page 314: D54122
Page 315: D54122

Copyright © 2008, Oracle. All rights reserved.

Scheduling Reports and Analyzing Data

Page 316: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:• Schedule reports• View the saved output and history• Manage scheduled reports• Schedule reports to be burst• Analyze data in reports

Page 317: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 3

Copyright © 2008, Oracle. All rights reserved.

Scheduling BI Publisher Reports

In BI Publisher Server:• Configure the BI Publisher Scheduler• Schedule reports • View the saved output and history• Manage scheduled reports

Scheduling BI Publisher ReportsScheduling is a very important feature for any reporting system. It enables you to schedule long-running queries or reports to be run at a specified time and date. This enables you to select a time and date at which the load on the system is low to run your daily/weekly and/or monthly reports. The tasks listed in the slide are explored in detail on the following pages.

Page 318: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 4

Copyright © 2008, Oracle. All rights reserved.

Configuring BI Publisher Scheduler

Configuring BI Publisher SchedulerPerform the following steps to configure the scheduler:

1. Log in to SQL Plus and create a user (for example, bipsched) in the database to install scheduler tables.Note: You can install scheduler tables in any existing user schema, but it is recommended that you create a separate user.

2. Log in to BI Publisher as Administrator (Password: Administrator). Click the Admin tab.3. On the Admin page, click the Scheduler Configuration link in the System Maintenance

section. On the Scheduler Configuration page:- Select Oracle 10g from the Database Type drop-down list- Enter the connection string in the format: jdbc:oracle:thin:@<Host name>: <Port>:<SID>For example, a sample connection string may look like: jdbc:oracle:thin:@myhost:1521:orcl.

- Enter the username and password for the scheduler user (in this example, bipsched).- Ensure that oracle.jdbc.driver.OracleDriver is selected as the database driver class.

4. Click Test Connection to check whether the database connection can be successfully established for the scheduler user.

5. Click Install Schema to install the required scheduler schema tables. After the scheduler tables are installed, it displays a message indicating success. (See the slide.)

6. Restart BI Publisher Server (or OC4J services).Note: If there are changes to the configuration, you must restart BI Publisher Server.

Page 319: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 5

Copyright © 2008, Oracle. All rights reserved.

Scheduling a Report

Scheduling a ReportAfter configuring the BI Publisher scheduler, you can schedule reports. Perform the following steps:

1. In BI Publisher, click the Reports tab to see the Reports page. 2. Navigate to your working folder (in this case, My Folders > Learn).

Click the Schedule link displayed below the report name (for example, the “Based on theOracleDB” report that you created earlier).Note: The Schedule link for the reports is activated after you have configured the BI Publisher scheduler.

3. On the Schedule Report page, select a template and a format (for example, PDF) for the report to be scheduled.

4. Enter a name (for example, Based on OracleDB-Scheduled) as the job name, and select language and time options as per your requirements. Also, ensure that the Save Data for Republish and Save Output options are selected. (Observe the screen in the slide.)

5. In the Time section of the Schedule Report page, select the frequency of the report to be run (for example, Run Daily/Weekly). Select the check box beside Wed to run the report every Wednesday, select a run time (for example, 22 to run the report at 10 PM), and choose an active start date and active end date. Click Submit to create the schedule job.

Page 320: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 6

Copyright © 2008, Oracle. All rights reserved.

Scheduling a Report

Scheduling a Report (continued)This displays a message indicating that the scheduling job is created successfully. Also, note that the scheduled job is now displayed on the Schedules tabbed page. You can also see that the job is run at the scheduled time.

Page 321: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 7

Copyright © 2008, Oracle. All rights reserved.

Viewing the Saved Output and History

Viewing the Saved Output and HistoryAfter the scheduled report is run, click the History tab to view the scheduled report history. Note that the Data XML and Document columns are shown in the history table. Click the icon in the Document column to see the saved report. This displays the report generated when the schedule was executed, using the template and format that you selected while scheduling the report. Also, you can view the job information by clicking the job name.Note: If you want to see the data of the scheduled report in XML form, click Data XML. If you want to republish—that is, take the data from the scheduled job and generate a new document by using the same template (or a different one)—select the Republish option.

Page 322: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 8

Copyright © 2008, Oracle. All rights reserved.

Managing Scheduled Reports

Managing Scheduled ReportsYou can manage scheduled jobs as well as job histories in BI Publisher. For example, to delete the job history for a specific job, on the History tabbed page, select the job and click Delete. Similarly, you can suspend, resume, or delete a scheduled job from the Schedules tabbed page.

Page 323: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 9

Copyright © 2008, Oracle. All rights reserved.

Scheduling Reports with Advanced Options

• Scheduling a report to be delivered as an email attachment• Scheduling a report to burst:

– To a file location – To email

Scheduling Reports with Advanced OptionsYou can schedule a report to use more advanced features. You can schedule a report to be delivered as an email attachment (assuming that email is configured) or you can schedule a report to be burst to a local directory on your system or other delivery media (such as email) that are configured. These options are discussed in detail in the following pages.

Page 324: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 10

Copyright © 2008, Oracle. All rights reserved.

Scheduling a Report to be Delivered as an Email Attachment

Scheduling a Report to be Delivered as an Email AttachmentTo schedule a report and deliver it as an email attachment, perform the following steps:

1. In BI Publisher, open the report to be scheduled. Click the Schedule link to schedule the report. On the Schedule Report page, perform the following tasks:

- Select a template and a format as viewing options. - Enter a name as the job name for the scheduled report.

2. In the Notification section, set the following:- Enter the mail ID of the user for whom you have configured the mail server (for

example, [email protected]).- Select the option to notify when the report is completed.- Select the Run Immediately option and click Add Destination in the Delivery section to

add email as the destination.3. This displays all the destinations configured. Select the Email option. This displays the

screen with email options with text fields to enter data such as To, CC, Subject, and Body of the email. Enter the data and click Submit.Note: You should have configured the email server and the user before scheduling the report to be delivered as email. Only then is the Email option displayed in Delivery Media.

Page 325: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 11

Copyright © 2008, Oracle. All rights reserved.

Scheduling a Report to be Delivered as an Email Attachment

Scheduling a Report to be Delivered as an Email Attachment (continued)Viewing the Schedule and the Email Attachment

4. This scheduled job is displayed on the Schedules page. Click the Schedules tab and click History to see whether the report is scheduled and delivered successfully.

5. Open Outlook Express (or your configured mail client) and log in to the mail as the user configured. When the report is successfully completed and delivered to the inbox, you can see both the notification mail and the scheduled report.

6. Open the attachment in the mail to see the scheduled report.

Page 326: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 12

Copyright © 2008, Oracle. All rights reserved.

PowerPoint

HTML

Excel

RTF

PDF

BI Publisher

Data

Templates Deliver

Split

Bursting a Report

Bursting a ReportWhat is Bursting?Bursting is an important and useful feature of BI Publisher that makes it flexible to deliver reports in various formats (RTF, HTML,PDF, and so on) through different delivery channels (Email, Fax, file, printer, and so on). BI Publisher provides a powerful bursting engine, which enables you to split the data in the report based on a key in the report data and deliver the report based on a second key in the report data through various delivery channels. For example, the salary report of employees can be split by Department, but can be delivered to employees by using the delivery key of the employee ID. Driven by the delivery key, you can apply a different template, output format, delivery method, and locale to each split segment of your report. Following are some example scenarios where bursting can be implemented:

• Invoice generation and delivery based on customer-specific layouts and delivery preference • Financial reporting to generate a master report of all cost centers, and bursting individual

cost center reports to the appropriate manager • Generation of pay slips to all employees based on one extract and delivered via email

Page 327: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 13

Copyright © 2008, Oracle. All rights reserved.

Scheduling a Report to Burst to a File Location

1. Create a report with appropriate fields for the split key and the delivery key.

2. Upload an RTF template for the report.3. Define bursting properties for the report.4. Schedule the report to burst to a file location.5. View the schedule and the report.

Scheduling a Report to Burst to a File Location The steps listed in the slide for bursting a report to a file location are discussed in detail in the following pages.

Page 328: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 14

Copyright © 2008, Oracle. All rights reserved.

Step1: Creating a Report with Appropriate Fields

Step1: Creating a Report with Appropriate FieldsIt is not mandatory to create a report. However, you must have a suitable query, which has the appropriate split key and delivery key fields. (For example, you can create a report based on a SQL query, which contains salary expenses of the direct reports of all managers by department in the organization, so that you can split by department name and deliver by manager. Then you use this report to burst to a file location.)

1. In BI Publisher, create a report and enter a name for the report. (For example, enter Bursting to File as the name of the report.) Edit the report to create a data model for the report.

Page 329: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 15

Copyright © 2008, Oracle. All rights reserved.

Step1: Creating a Report with Appropriate Fields

Step1: Creating a Report with Appropriate Fields (continued)2. When defining the data model, ensure that you enter the following query in the SQL Query

section:select e.first_name || ' ' || e.last_name name, e.first_name, e.last_name, e.salary, e.salary*12 ANNUAL_SALARY, e.salary*12*0.28 FED_WITHHELD, j.job_title, d.department_name, m.first_name || ' ' || m.last_name manager from employees e,employees m,departments d,jobs j where e.department_id = d.department_id and j.job_id = e.job_id and e.manager_id = m.employee_id and e.department_id = nvl(:dept,e.department_id) and e.employee_id = nvl(:emp,e.employee_id) order by e.department_id, e.manager_id

Save the report.Note: Click View to see whether the query is returning valid XML data.

Page 330: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 16

Copyright © 2008, Oracle. All rights reserved.

Step 2: Uploading an RTF Template for the Report

Step 2: Uploading an RTF Template for the Report3. In Word, open the Salary Expenses by Manager. RTF template file that is

provided with this course. You can find this file in D:\Labs\ BIP_10.1.3.3._Labs\Templates.

4. In Word, log in to BI Publisher as Administrator. Load the data from the Bursting report that you created earlier. Ensure that BI Publisher is selected as the workspace.

5. Preview the report and upload this template for the report. (Select the Upload Template As option from the Oracle BI Publisher menu in Word.)

Page 331: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 17

Copyright © 2008, Oracle. All rights reserved.

Step 3: Defining Bursting Properties for the Report

Step 3: Defining Bursting Properties for the Report6. In BI Publisher, open the report that you want to burst to the file location (in the example,

the Bursting to File report) in Edit mode.7. On Report Properties, click the Bursting node in the Report section on the left to define

bursting properties for the report. This displays Bursting Properties on the right. 8. In the General Properties section, select the Enable Bursting option, and select the

department name in the Split By and Deliver By fields (for example, select ROWSET/ROW/DEPARTMENT_NAME from the Split By drop-down list and ROWSET/ROW/DEPARTMENT_NAME from the Deliver By drop-down list).

9. In the Delivery Data Source section, select demo as the data source, and add the following query in the SQL Query section:

select d.department_name KEY, 'Template1' TEMPLATE, 'RTF' TEMPLATE_FORMAT, 'en-US' LOCALE, 'PDF' OUTPUT_FORMAT, 'FILE' DEL_CHANNEL, ‘C:\BIP' PARAMETER1, d.department_name || '.pdf' PARAMETER2 from departments d The syntax of this query is explained in the next page.

10. Click the Save icon to save the changes.

Page 332: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 18

Step3: Defining Bursting Properties for the Report (continued) Important Notes: Based on the SQL query that you provide in the Delivery Data Source section on the Bursting Properties page, BI Publisher builds the delivery XML data set. For example, in the query that you defined:• department_name is the delivery key. (This must match your Split By field of the

Bursting Properties.)• 'Template1' is the template to be used with the report. • 'RTF' is the template source format.• 'en-US' (US English) is the locale.• 'PDF' is the output format for the report.• 'File' is the delivery channel.

- C:\BIP is Parameter1, which is the local directory path where the report files will be bursted. Note: This should be an existing folder on your local file system. Create a folder BIP in C:\ , or use any existing folder (including the Temp folder).

- Parameter2 defines the file name format. (This must match your Deliver By field). In the query defined, the delivery is done to files with names in the format: <department_name>.pdf.)

Page 333: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 19

Copyright © 2008, Oracle. All rights reserved.

Step 4: Scheduling the Report to Burst to a File Location

Step 4: Scheduling the Report to Burst to a File Location11. Ensure that you saved the report after defining the bursting properties, and click Schedule

to schedule this report to burst to the file location defined. This takes you to the Schedule page.

12. Click Schedule a New Job to define the scheduling job. On the Schedule Report page, define the following:

- In the Job Properties section, select the Burst Report option (and in the Notification section, you can optionally provide the email ID of the user to be notified when the report completes or fails. Use the mail ID of the user that you configured—for example, [email protected]).

- In the Time section, select the Run immediately option, and click Submit. (For demo or practice purposes, select the Run Immediately option, but you can actually schedule the report to be run daily/weekly or monthly according to your requirements.)

This displays the message that indicates that the job has been successfully created. (The job is also displayed on the Schedules page.)

Page 334: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 20

Copyright © 2008, Oracle. All rights reserved.

Step 5: Viewing the Schedule and the Report

Step 5: Viewing the Schedule and the Report13. Click the Schedules tab, and click History to see whether the schedule was run

successfully.14. Now go to the C:\BIP folder (the delivery destination folder that you provided in the

query). You can see that the PDF files, which have <Department Name>.PDF as the names, are bursted to this file location.(Open one of the files to see the report—for example, Sales.pdf.)

Note: You can also connect to the mail client as the configured user and see the notification sent when the job is scheduled successfully.

Page 335: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 21

Copyright © 2008, Oracle. All rights reserved.

Scheduling a Report to Be Burst as Email

Scheduling a Report to Be Burst as EmailThe steps for scheduling a report to be burst to email are similar to scheduling a report to be burst to a file location, except that the syntax and parameters in the query to be defined in the Delivery Data Source section differ when you define the bursting properties for the report (the delivery medium in this case is email, and not file location).When you define bursting properties:

1. Ensure that the Enable Bursting option is selected, and that the appropriate split by and deliver by keys are also selected (in the example, ROWSET/ROW/DEPARTMENT_NAME)

2. In the Delivery Data Source section, select demo as the data source, and add the following query in the SQL Query section:select d.department_name KEY,'Template1' TEMPLATE,'RTF' TEMPLATE_FORMAT,'en-US' LOCALE,'PDF' OUTPUT_FORMAT,'EMAIL' DEL_CHANNEL, '[email protected]' PARAMETER1,'[email protected]' PARAMETER2,'[email protected]' PARAMETER3,'SUBJECT: Bursting to Email Test' PARAMETER4,'BODY: Test Report Body' PARAMETER5,'true' PARAMETER6,'[email protected]' PARAMETER7 from departments d

Page 336: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 22

Scheduling a Report to Be Burst as Email (continued)3. Click Save to save the changes to the report. The parameter mapping for bursting a report to

email is shown in the following screenshot:

Note1. Parameter 6 must be set to true if the delivery format selected is PDF. 2. Also, note that the other steps such as scheduling the report and viewing the schedule and

report are similar to the steps involved in bursting a report to a file location.3. Instead of creating a report, for demonstration and practice purposes, copy the Bursting to

File report that you created earlier, rename it Bursting to Email, and edit the report to burst to email.

Page 337: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 23

Copyright © 2008, Oracle. All rights reserved.

Analyzing Data in Reports

• Online Analyzer:– Analyzing data– Saving and sharing layouts

• Excel Analyzer:– Installing Excel Analyzer– Analyzing data in Excel

Analyzing Data in ReportsBI Publisher enables you to analyze data in the reports by using Online Analyzer. You can also analyze data by using Excel Analyzer, an add-in provided for Excel. These features are discussed in more detail in the following pages.

Page 338: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 24

Copyright © 2008, Oracle. All rights reserved.

Using Online Analyzer

• The Online Analyzer interface• The Analyzer toolbar

Using Online AnalyzerWith Online Analyzer, you can quickly create a pivot table and analyze the data in the report online. Use the interface to analyze your report data by dragging the data items into the cross-tab structure. Then quickly rearrange data by dragging items to different row, column, or summary positions. Also, you can filter the data displayed in your pivot table by defining page-level data items. Drag a field to the Page item area, and choose from the values that immediately populate the list. After selecting all data items for the table, choose whether to view the sum, average, or count of the data itemsTo use the Online Analyzer with a BI Publisher report, perform the following steps:

1. (If not logged in) Log in to BI Publisher, and open a report that you want to analyze in View mode. (Click the View link below the name of the report.)

2. Click Analyzer to open the online cross-tab analyzer. (The Analyzer interface displays the list of data fields in the left pane and an empty cross-tab structure on the adjacent pane, as shown in the slide.)

3. On the BI Publisher Online Analyzer page, from the ROWSET fields displayed on the left, drag the appropriate items to Row Fields, Data Items, and Column Fields to create the cross-tab.

4. You can also save your analysis as a template for the report by using the Save or Save As options displayed in the Online Analyzer toolbar. Close the Online Analyzer after your analysis is done.Note: You can also change the structure of the cross-tab according to the requirements of your data analysis to come up with some important business decisions or initiatives.

Page 339: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 25

Copyright © 2008, Oracle. All rights reserved.

Excel Analyzer

• Prerequisites• Features• Installation

Excel AnalyzerExcel Analyzer is an add-in provided for Excel. Prerequisites

The following are required to use Excel Analyzer: • Microsoft .NET Framework 2.0. If it is not installed on your computer, you are prompted to

download it the first time that you use Excel Analyzer.• Microsoft Excel 2000 or later

FeaturesUsing Excel Analyzer, you can:

• Export the results of the report query to an Excel spreadsheet• Log in to Oracle BI Publisher Enterprise from Excel to refresh your data, apply new

parameters, and apply a template to the report data• Access and run your reports from an Excel session

Installing Excel AnalyzerYou do not have to install Excel Analyzer separately. If you are launching Excel Analyzer for the first time (that is, when you click the Excel Analyzer link for a report), or if you do not have the latest version of Excel Analyzer on your system, you are prompted to install the latest version. Follow the instructions and install it. (This installation should not take more than a couple of minutes.)

Page 340: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 26

Copyright © 2008, Oracle. All rights reserved.

Using Excel Analyzer

Using Excel AnalyzerTo use Excel Analyzer with a BI Publisher report, perform the following steps:

1. Open the report that you want to analyze in View mode. 2. Click Analyzer for Excel. You will be prompted to save or open the <report name>.xls file.

3. Click Open to open the file, and select Enable Macros from the Microsoft Excel dialog box. Note: You must enable macros to use the Analyzer for Excel.

4. The report data is rendered in the Excel application window and the Oracle BI Publisher menu appears on the Excel menu bar. (A sample report is shown in the slide.)Note: The report data rendered in Excel is the result of the report query with no template and with default filtering applied. You can now format the data as you want in Excel. Also, note that if the report has parameters, the parameter names appear at the top of the worksheet. But you must log in to BI Publisher from Excel to apply new parameter values.

Page 341: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 27

Copyright © 2008, Oracle. All rights reserved.

Using Excel Analyzer: BI Publisher Menu and Toolbar

Using Excel Analyzer: BI Publisher Menu and ToolbarUsing Oracle BI Publisher MenuYou must log in to enable all menu options in the BI Publisher menu. After logging in to BI Publisher, you can see that the various options in the BI Publisher menu are active. Note: If this is the first time that you are using Analyzer for Excel, or if you do not have the latest version of Analyzer for Excel, you are prompted to install the latest version. Using the menu options, you can perform tasks such as viewing the report online, showing the parameters, updating a template, uploading a new template, and so on. For example, when you select Oracle BI Publisher > Show Report Parameters, the available templates and updatable parameters (if the report has parameters) for the report are displayed in a toolbar. Also, you can make modifications in the Excel template to update the template or add it as a new Excel template. (For example, you can add a pie chart in the report worksheet, and add it as a new template.) You can publish the template by selecting Oracle BI Publisher > Add as New Excel Template. The next time that you log in to the BI Publisher Server, you can see this new template added to the report.

Page 342: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 28

Using Excel Analyzer: BI Publisher Menu and Toolbar (continued)Using Analyzer for Excel ToolbarYou can select the templates and parameters to be used with the report data in Excel from the toolbar: (The toolbar is highlighted in the screen in the previous slide.)

• To apply a template, select the template, and select Refresh Formatted Data to download the report in HTML format into a new worksheet. Select the new worksheet to see the data with the new template applied.

• To update the data, select a new parameter value (if your report has parameters), and selectRefresh Data to refresh the data in the current sheet.

Page 343: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 29

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:• Schedule reports• View the saved output and history• Manage scheduled reports• Schedule reports to be burst• Analyze data in reports

Page 344: D54122

Oracle BI Publisher 10g R3: Fundamentals 10 - 30

Copyright © 2008, Oracle. All rights reserved.

Practice 10: Overview

This practice covers the following topics:• Scheduling BI Publisher reports

– Scheduling a report– Managing scheduled reports

• Scheduling using advanced features– Scheduling a report to burst to a file location– Scheduling a report to deliver as an email attachment

• Analyzing data in reports– Using Online Analyzer– Using Excel Analyzer

Page 345: D54122

Copyright © 2008, Oracle. All rights reserved.

Translating Reports

Page 346: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this module, you should be able to do the following:• Describe the type of translations and options for translating

reports by using BI Publisher• Create translation files by using BI Publisher Desktop• Create translation files by using the BI Publisher Enterprise

Server

Page 347: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 3

Copyright © 2008, Oracle. All rights reserved.

Translations: Types and Options

Translations are of two types:• Template translations:

– Create a separate translated rich text format (RTF) template.– Generate an XML Localization Interchange File Format

(XLIFF) file from the original template.Note: Both must follow the same naming standards.

• Report file translations:– Create translated report description files.– The naming standards are different from templates.

Translations: Types and OptionsTranslations are of two types:Template TranslationsThere are two options for adding translated templates to your report:

• Create a separate RTF template that is translated (localized template).• Generate an XLIFF file from the original template.

Important Note: Regardless of which option you choose, you must name your translated templates according to the naming standard that Oracle BI Publisher can recognize at run time.Report File TranslationsYou can add translated report description files so that your users can view the report description and any parameter labels in the language they selected for their UI preference. Upload translated report description files to the same location as the translated template files. Note that the translated report description files follow a naming standard that is slightly different from the translated template file standard.The naming standards are discussed later in this lesson.

Page 348: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 4

Copyright © 2008, Oracle. All rights reserved.

BI Publisher

EmployeeReport.xml

Output report in French

Employes

Localized (or translated)

Template

Data

EmployeeTemplate_fr_FR.xlf

Localized Template Option

Use this option when you want a specific translation to have adifferent layout.

`

Localized Template OptionThe diagram in the slide illustrates the first option of creating a separate, localized template for your report definition. Use this option if the translated template requires a different layout from the original template.

Page 349: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 5

Copyright © 2008, Oracle. All rights reserved.

BI Publisher

EmployeeReport.xml

EmployeeTemplate.rtf

EmployeeTemplate_fr_FR.xlf

Output report in French

Employees

Translated Text Strings

Base Template

( in English)

Data

XLIFF File Option

Use this option when you want to use the same layout and apply specific translations.

`

XLIFF File OptionThe diagram in the slide illustrates the second option of generating an XLIFF file from the original template. At run time, the original template is applied for the layout, and the XLIFF file is applied for the translation. Use the XLIFF option only if you require translation of text strings of the template layout.Note: XLIFF stands for XML Localization Interchange File Format. It is the standard format used by localization providers.

Page 350: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 6

Copyright © 2008, Oracle. All rights reserved.

Structure of the XLIFF File

Structure of the XLIFF FileThe XLIFF file generated by Oracle BI Publisher has the following structure:

<xliff><file>

<header><body>

<trans-unit><source><target><note>

Page 351: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 7

Copyright © 2008, Oracle. All rights reserved.

Updating the XLIFF File

Updating the XLIFF File<source> and <target> ElementsEach <source> element contains a translatable string from the template in the source language of the template. Example: <source>Total</source>

When you initially export the XLIFF file for translation, the source and target elements are identical. To create the translation for this template, enter the appropriate translation for each source element string in its corresponding <target> element.Therefore, if you were translating the sample template into German, you would enter the following for the Total string:<source>Total</source><target>Gesamtbetrag</target>

Page 352: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 8

Copyright © 2008, Oracle. All rights reserved.

Naming Standards

• For the XLIFF and RTF template translation files:– TemplateName_<language code>_<TERRITORY CODE>.xlf

or .rtf

Or– TemplateName_<language code>.xlf or .rtf

• For the report translation files:– ReportName_<language_code>.xlf

– ReportName_<language_code>_<TERRITORY CODE>.xlf (only for Chinese and Portuguese [Brazil])

Naming Standards The naming conventions are slightly different for the RTF/XLIFF translation template files and the report file translations.RTF/XLIFF Translations: Your translated XLIFF and RTF files must be named according tothe following standard:

TemplateName_<language code>_<TERRITORY CODE>.xlf or .rtf

orTemplateName_<language code>.xlf or .rtf

where: • TemplateName is the original template name.• language code is the two-letter ISO language code (in lowercase).• TERRITORY CODE is the two-letter ISO country code (in uppercase).

For example, if your original template is named EmployeeTemplate and you are uploading a translation for Japanese-Japan, name the file EmployeeTemplate_ja_JP.xlf

Page 353: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 9

Naming Standards (continued)Report Translations: For report translations, the naming standard is:• ReportName_<language_code>.xlf (for all languages except Chinese and

Portuguese [Brazil])• ReportName_<language_code>_<TERRITORY CODE>.xlf (only for Chinese

and Portuguese [Brazil]) where: • ReportName is the report file name.• language_code is the two-letter ISO language code (in lowercase).

Example:If your report name is Employee Salaries, the template name for French (Switzerland) must be Employee Salaries_fr.xlf. If the translation file is for Portuguese, the template file must be named Employee Salaries _pt_BR.xlf.Important Note: Except for the three locales in the following list, do not include the territory code in the file name for other languages for report translations:

• Chinese (China): File name is <ReportName>_zh_CN. xlf.• Chinese (Taiwan): File name is <ReportName>_zh_TW. xlf.• Portuguese (Brazil): File name is <ReportName>_pt_BR. xlf.

Page 354: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 10

Copyright © 2008, Oracle. All rights reserved.

Locale Selection Logic

Oracle BI Publisher follows this hierarchy for selecting thetranslation for the chosen locale:1. It first tries to match the RTF template that has the same

language-territory options as the chosen locale.2. If a match is not found, it tries to match the XLIFF file for the

locale (language-territory).3. If a match is not found, it tries to match only the language

(first RTF, and then XLIFF).4. If a match is not found, it applies the available RTF

template.

Locale Selection LogicBI Publisher applies a translation based on the user’s selected report locale. BI Publisher first tries to match an RTF template named for the locale, and then an XLIFF file named for the locale. If an exact match on language-territory is not found, BI Publisher tries to match on language only. For example, if you have a report for which the base template is called EmployeeTemplate.rtf and the locale selected is French (France), BI Publisher selects the translation to apply according to the following hierarchy: • EmployeeTemplate_fr_FR.rtf• EmployeeTemplate_fr_FR.xlf• EmployeeTemplate_fr.rtf• EmployeeTemplate_fr.xlf• EmployeeTemplate.rtf

Note that with the same set of translations, if the locale selected is French (Switzerland), EmployeeTemplate_fr_FR.rtf would be applied.

Page 355: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 11

Locale Selection Logic (continued)If the available translations were limited to the following set:• EmployeeTemplate_fr_FR.rtf• EmployeeTemplate_fr_FR.xlf• EmployeeTemplate.rtf

And if the locale selected is French (Switzerland), EmployeeTemplate.rtf would be applied. Even though there is a language match, BI Publisher does not try to match the different locales.Therefore, if you want to ensure that a French translation is used when French is the selected language, regardless of the selected locale, you must include either an rtf or xlf file named for the language only (that is, EmployeeTemplate_fr.rtf or EmployeeTemplate_fr.xlf).

Page 356: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 12

Copyright © 2008, Oracle. All rights reserved.

Translating Templates in BI Publisher Desktop

To generate an XLIFF file from an RTF template, perform the following steps:1. Open your template in Microsoft Word with Oracle BI

Publisher Desktop for Word installed.2. From the Oracle BI Publisher Desktop menu, select

Tools > Translations > Extract Text. Oracle BI Publisher extracts translatable strings from the template and exports them to an XLIFF (.xlf) file.

3. Save the file to the preferred location.This XLIFF file can then be sent to a translation provider. Or, by using a text editor, you can enter the translation for each string.

Translating Templates in BI Publisher DesktopBI Publisher does not perform the actual process of translation. It provides a standardized file that can then be translated by a third-party software or a translation service.

Page 357: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 13

Copyright © 2008, Oracle. All rights reserved.

Report File Translations

To add a report file translation, perform the following steps:1. Open the report in BI Publisher Enterprise.2. In the report editor, select Generate XLIFF.3. Save the .xlf file to a local directory.4. Send the file to a localization provider or add the translated

text.5. Name the translated report file according to the naming

standards.

Report File TranslationsThe steps for creating a report file translation are listed in the slide.

Page 358: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 14

Copyright © 2008, Oracle. All rights reserved.

Generating XLIFF in BI Publisher Enterprise

Generating XLIFF in BI Publisher EnterpriseEdit the report, and select Generate XLIFF.

Page 359: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 15

Copyright © 2008, Oracle. All rights reserved.

Saving the XLIFF File

Saving the XLIFF FileWhen the XLIFF file is generated, you are prompted to save the file. Save it in your local file system.

Page 360: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 16

Copyright © 2008, Oracle. All rights reserved.

Uploading the XLIFF File

Uploading the XLIFF FileYou can upload the XLIFF files and associate them with a report in BI Publisher Enterprise.

Page 361: D54122

Oracle BI Publisher 10g R3: Fundamentals 11 - 17

Copyright © 2008, Oracle. All rights reserved.

Summary

In this module, you should have learned how to:• Describe the type of translations and options for translating

reports by using BI Publisher• Create translation files by using BI Publisher Desktop• Create translation files by using the BI Publisher Enterprise

Server

NoteThere are no practices in this lesson. However, you are advised to go through the translation demonstration provided with BI Publisher Desktop to have an understanding of the features. From the program menu in Windows, select BI Publisher Desktop> Demos> Localization Demo.

Page 362: D54122
Page 363: D54122

Copyright © 2008, Oracle. All rights reserved.

Creating Reports by DefiningXML Data Templates

Page 364: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this module, you should be able to do the following:• Describe the BI Publisher XML data template• Create an XML data template• Associate that data template with a rich text format (RTF)

template• View the report

Page 365: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 3

Copyright © 2008, Oracle. All rights reserved.

XML Data Template

An XML document whose elements collectively define how the data engine processes the template to generate the XML

Data engine process instructions

XML Data TemplateWith the Oracle BI Publisher data engine, you can rapidly generate any kind of XML data structure against any database in a scalable, efficient manner. The data template is the method by which you communicate your request for data to the data engine.

Page 366: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 4

Copyright © 2008, Oracle. All rights reserved.

Data Extraction Engine

Data engine utility

Dat

a Ex

trac

tion

Engi

ne

XML output

Default RTF

XML schema

Report-generatingengine

Data engine processor

Data template

Data Extraction EngineThe Data Template, which defines how the data engine processes its information, is:

• Used by the data engine processor to generate XML output• Associated with an RFT document or XML schema by the data engine utility

The XML output and RFT template / XML schema are used by the report generation engine to produce the report.

Page 367: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 5

Copyright © 2008, Oracle. All rights reserved.

What Functionality Is Supported?

The data engine supports the following functionality:• Schema generation• Default RTF template generation• Single and multiple data queries• Query links• Parameters• Aggregate functions (SUM, AVG, MIN, MAX, COUNT)• Event triggers• Multiple data groups

What Functionality Is Supported?This lesson covers only the functionality that is supported in a stand-alone instance.

Page 368: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 6

Copyright © 2008, Oracle. All rights reserved.

Supported Functionality

The XML output generated by the data engine supports the following:• Unicode for XML output

Unicode is a global character set that enables multilingual text to be displayed in a single application. With this, you candevelop a single multilingual application and deploy it worldwide.

• Canonical formatThe data engine generates date elements by using the canonical ISO date format: YYYY-MM-DDTHH24:MI:SS.FF3TZH:TZM for a mapped date element, and ######.## for number elements in the data template XML output.

Page 369: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 7

Copyright © 2008, Oracle. All rights reserved.

Report Migration

Oracle Reportsfiles

PL/SQL developer code

XML data template

RDF-2-Data Template

Migration Tool

Data query

Parameters

Groups/summary

PL/SQL reference

Report MigrationOracle Reports files can be migrated to BI Publisher by using the RDF-2 Data Template Migration Tool.

Page 370: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 8

Copyright © 2008, Oracle. All rights reserved.

Data Template Definition

The data template is an XML document that consists of four basic sections.

Data Template DefinitionAs shown in the sample figure, the data template consists of:

• A <parameters> section in which parameters are declared in child <parameter>elements

• A <dataQuery> section in which the SQL queries are defined in child <sqlStatement> elements

• A <dataTrigger> section, in which trigger events are stored• A <dataStructure> section in which the output XML structure is defined

See the next page for a table of elements.

Page 371: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 9

Copyright © 2008, Oracle. All rights reserved.

Data Template Structure Diagram

Parameters

Lexicals

Data Query

Data Triggers

Data Structure

Name

sqlStatement

dataType

defaultType

type

name

comment

link

name

source

group

group

DataTemplate

name

source

groupFilter

— - — -

— -

Data Template Structure DiagramElement DescriptiondataTemplate (Required) Attributes are:

name (Required)descriptionversion (Required)defaultPackagedataSourceRef

parameters Consists of one or more <parameter> elementsparameter Attributes are:

name (Required)dataType

Lexicals * Consists of one or more lexical elements to support flexfields* (Only used with Enterprise Business Suite)

lexical Four types: KFF segments, KFF, KFF where, and KFF order bydataQuery (Required) Consists of one or more <sqlStatement> elementssqlStatement (Required) Attributes are:

name (Required) dataSourceRef

Page 372: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 10

Data Template Structure Diagram (continued)Element Description

link Attributes are:parentQueryparentColumnchildQuerychildColumncondition

dataTrigger The trigger and the event that it fires on. Attributes are:name (Required)source (Required)

dataStructure Required for multiple queries groupConsists of one or more <element> elements and sub <group> elements. Attributes are:

name (Required)source (Required)groupFilter

element The tag name to assign the element in the XML data output Attributes are:

namevalue (Required)function

Page 373: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 11

Copyright © 2008, Oracle. All rights reserved.

Data Template Declaration

Data Template DeclarationThe data template element provides essential information about the template, and is the root element in the data template. It contains two required and three optional attributes.

Page 374: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 12

Copyright © 2008, Oracle. All rights reserved.

Defining Parameters

Defining ParametersA parameter is a variable whose value can be set at run time. Parameters are especially useful for modifying SELECT statements and setting PL/SQL variables at run time. The Parameters section of the data template is optional.How to Define ParametersThe <parameter> element is placed between the open and close <parameters> tags. The <parameter> element has a set of related attributes. These are expressed within the <parameter> tag. For example, the name, dataType, and defaultValue attributes are expressed as follows:

<parameters>

<parameter name="department" dataType="number“defaultValue="10"/>

</parameters>

Page 375: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 13

Defining Parameters (continued)How to Pass ParametersTo pass parameters (for example, to restrict the query), use bind variables in your query.Example

Query:SELECT * FROM EMP WHERE deptno=:department

At run time, the value of the department is passed to the query:SELECT * FROM EMP WHERE deptno=10

Page 376: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 14

Copyright © 2008, Oracle. All rights reserved.

Defining Queries

Defining QueriesThe <sqlStatement> element is placed between the open and close dataQuery tags. The <sqlStatement> element has a related attribute and name. It is expressed within the <sqlStatement> tag. The query is entered in the CDATA section. Note: The Data Query section is mandatory.Example

<dataQuery>

<sqlStatement name="Q1">

<![CDATA[SELECT DEPTNO,DNAME,LOC from dept]]>

</sqlStatement>

</dataQuery>

Page 377: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 15

Copyright © 2008, Oracle. All rights reserved.

Data Query

How to define queries:• Use <sqlStatement name=""> to define a query.• Performing operations in SQL is faster than performing them

in a data template or PL/SQL. The following are the most common cases in which using SQL improves performance:

– Use a WHERE clause instead of a group filter to exclude records.

– Perform calculations directly in your query rather than in the template.

Data QueryIf your column names are not unique, you must use aliases in your SELECT statements to ensure the uniqueness of your column names. If you do not use an alias, the default column name is used. This becomes important when you specify the XML output in the data structure section. To specify an output XML element from your query, you declare a value attribute for the element tag that corresponds to the source column.Tip: Performing operations in SQL is faster than performing them in the data template or PL/SQL. It is recommended that you use SQL for the following operations:

• Use a WHERE clause instead of a group filter to exclude records.• Perform calculations directly in your query rather than in the template.

Page 378: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 16

Data Query (continued)Lexical ReferencesYou can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, or HAVING. Use a lexical reference when you want the parameter to replace multiple values at run time.Create a lexical reference by using the following syntax:

&parametername

Define the lexical parameters as follows:• Before creating your query, define a parameter in the PL/SQL default package for each

lexical reference in the query. The data engine uses these values to replace the lexical parameters.

• Create your query containing lexical references.Example

Package employeeAS

where_clause varchar2(1000);.....

Package body employeeAS

..... where_clause := 'where deptno=10';

.....

Data template definition:<dataQuery>

<sqlStatement name="Q1"> <![CDATA[SELECT ENAME, SAL FROM EMP

&where_clause]]></sqlStatement>

</dataQuery>

Page 379: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 17

Copyright © 2008, Oracle. All rights reserved.

Example: Data Query

<parameters>

<parameter name="p_DeptNo" dataType="character" />

</parameters>

<dataQuery>

<sqlStatement name="Q1">

<![CDATA[

SELECT d.DEPTNO,d.DNAME,d.LOC,

EMPNO,ENAME,JOB,MGR,HIREDATE,SAL

from dept d, emp e

where d.deptno=e.deptno

AND d.deptno = nvl(:p_DeptNo,d.deptno) ]]>

</sqlStatement>

</dataQuery>

Page 380: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 18

Copyright © 2008, Oracle. All rights reserved.

Defining a Data Link Between Queries

Defining a Data Link Between QueriesThe dataQuery section can contain multiple SQL statements. If you have multiple queries, you must link them to create the appropriate data output.

Page 381: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 19

Copyright © 2008, Oracle. All rights reserved.

Query Linking Options

Two ways of linking are supported:• Bind variables in your query• Link elements <link name="" ……../>

Bind variables are usually more efficient than link elements.

Query Linking OptionsIn the data template, there are two methods for linking queries: using bind variables or using the <link> element to define the link between queries. For building data queries in the data template, BI Publisher tests have shown that bind variables is more efficient than the link tag.Bind Variable

<dataQuery><sqlStatement name="Q1">

<![CDATA[SELECT EMPNO, ENAME, JOB from EMP WHERE DEPTNO = :DEPTNO]]>

</sqlStatement></dataQuery>

Link TagThe <link> element has a set of attributes. Use these attributes to specify the required link information. You can specify any number of links, as in the following example:

<link name="DEPTEMP_LINK" parentQuery="Q1" parentColumn="DEPTNO" childQuery="Q_2“childColumn="DEPARTMENTNO"/>

Page 382: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 20

Copyright © 2008, Oracle. All rights reserved.

Query Linking: Bind Variable Example

<dataQuery>

<sqlStatement name="Q1">

<![CDATA[

SELECT DEPTNO,DNAME,LOC from dept where &pwhereclause

order by deptno ]]>

</sqlStatement>

<sqlStatement name="Q2">

<![CDATA[

SELECT EMPNO,ENAME,JOB,MGR,HIREDATE,SAL

from EMP

WHERE DEPTNO = :DEPTNO ]]>

</sqlStatement>

</dataQuery>

Page 383: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 21

Copyright © 2008, Oracle. All rights reserved.

Query Linking: <link> Tag Example

<dataQuery>

<sqlStatement name="Q1">

<![CDATA[

SELECT DEPTNO,DNAME,LOC from dept where &pwhereclause

order by deptno ]]>

</sqlStatement>

<sqlStatement name="Q2">

<![CDATA[

SELECT EMPNO,ENAME,JOB,MGR,HIREDATE,SAL

from EMP ]]>

</sqlStatement>

<link name="DEPTEMP_LINK" parentQuery="Q1" parentColumn="DEPTNO" childQuery="Q2" childColumn=“DEPTNO“condition="="/>

</dataQuery>

Page 384: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 22

Copyright © 2008, Oracle. All rights reserved.

Distributed Queries

Data engine

Customers

Invoices

Distributed QueriesWith the BI Publisher data engine, you can perform distributed queries. This enables you to access data from multiple disparate data sources.For example, you can extract your customer data from one database and the customer’s invoice data from another system, and then bring them together into a combined hierarchical XML result set.Note: The only supported method to link distributed queries is the bind variable method. (The <link> tag is not supported.)For more information about creating distributed queries, see the BI Publisher Administration and Developer Guide.

Page 385: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 23

Copyright © 2008, Oracle. All rights reserved.

Data Triggers

Data Triggers Data triggers execute PL/SQL functions at specific times during execution and generation of the XML output. Using the conditional processing capabilities of PL/SQL for these triggers, you can perform initialization tasks, access the database, and so on.

Page 386: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 24

Copyright © 2008, Oracle. All rights reserved.

Using Data Triggers

• Data triggers can be used to: – Perform initialization tasks– Build dynamic queries

• Data trigger types– beforeReport trigger: Fires before the data query is

executed.– afterReport trigger: Fires after you exit and after XML

output is generated.Example:<dataTrigger name="beforeReport" source="employee.beforeReport()"/>

<dataTrigger name="beforeReport" source="employee.beforeReport(:Parameter)"/>

Using Data TriggersThe location of the trigger indicates at what point the trigger fires:

• Place a beforeReport trigger anywhere in your data template before the <dataStructure> section. A beforeReport trigger fires before dataQuery is executed.

• Place an afterReport trigger after the <dataStructure> section. An afterReport trigger fires after you exit and after the XML output is generated.

Data triggers are optional, and you can have as many <dataTrigger> elements as necessary.The <dataTrigger> element has a set of related attributes. These are expressed within the <dataTrigger> tag. For example, the name and source attributes are expressed as follows:

<dataTrigger name="beforeReport" source="employee.beforeReport()"/>

<dataTrigger name="beforeReport" source="employee.beforeReport(:Parameter)"/>

Page 387: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 25

Copyright © 2008, Oracle. All rights reserved.

Data Structure Section

In the data structure section, you define what the XML output will be and how it will be structured. You can: • Define a group hierarchy• Create break groups• Apply group filters• Create summary columns

Data Structure SectionIn the data structure section, you define what the XML output will be and how it will be structured. The complete group hierarchy is available for output. You can specify all columns within each group and break the order of those columns; you can use summaries and placeholders to further customize within the groups. The data structure section is required for multiple queries and optional for single queries. If omitted for a single query, the data engine generates flat XML.For more information about how to build this section, see the BI Publisher User’s Guide.

Page 388: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 26

Copyright © 2008, Oracle. All rights reserved.

Data Structure: Example

<group name="G_DEPT" source="Q1" groupFilter="empdata.G_DEPTFilter(:DEPT_NUMBER)">

<element name="DEPT_NUMBER" value="DEPTNO" />

<element name="DEPTSAL" value="G_EMP.SALARY" function="SUM()"/>

<group name="G_EMP" source="Q2">

<element name="EMPLOYEE_NUMBER" value="EMPNO" />

<element name="NAME" value="ENAME"/>

<element name="JOB" value="JOB" />

<element name="SALARY" value="SAL"/>

</group>

</group>

Data Structure: ExampleThe data structure contains:

• Break groups: Order By in SQL query must be set.• Group filters: WHERE clause must be used instead of a group filter. • Summary column: These include the Sum, Average, Count, Maximum, and Minimum

columns.

Page 389: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 27

Copyright © 2008, Oracle. All rights reserved.

Creating an XML Data Template

1

2

3

Creating an XML Data TemplateTo create a data template in BI Publisher Enterprise, perform the following steps:

1. Click the “Create a new report” link in the Folder and Report Tasks pane, enter a report name (Based on Data Template) in the box, and click Create.

2. Click the Edit link below the name of the report created to open the Report Properties page. 3. On the Report Properties page, click the Data Model node on the left and click the New

icon. In the General Settings pane that appears on the right, select Data Template from the Type drop-down list.

Result: The basic structure for the data template appears in the Data Template window. The XML code for your data template can be added here.

Page 390: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 28

Copyright © 2008, Oracle. All rights reserved.

Viewing the XML Data

Viewing the XML DataAt any time, click View to see the XML data. If the data is properly rendered to the report, the XML is correct.

Page 391: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 29

Copyright © 2008, Oracle. All rights reserved.

Associating the XML Data Templatewith an RTF Template

Associating the XML Data Template with an RTF TemplateNormally, you associate a BI Publisher report with an RTF template file. In this case, the XML data template is treated as a “report,” and you associate it with an RTF template.

Page 392: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 30

Copyright © 2008, Oracle. All rights reserved.

Viewing the Report

Viewing the ReportAfter the XML data template is associated with an RTF template, the resulting report can be viewed in BI Publisher Desktop or BI Publisher Enterprise.

Page 393: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 31

Copyright © 2008, Oracle. All rights reserved.

Summary

In this module, you should have learned how to:• Describe the BI Publisher XML data template• Create an XML data template• Associate that data template with an RTF template• View the report

Page 394: D54122

Oracle BI Publisher 10g R3: Fundamentals 12 - 32

Copyright © 2008, Oracle. All rights reserved.

Practice 12: Overview

This practice covers the following topics:• Creating a simple data template• Creating a data template with parameters• Creating a data template with a list of values

Page 395: D54122

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher Integration Features

Page 396: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to:• Create a BI Publisher report from a BI Answers request in:

– BI Publisher Enterprise– BI Publisher Desktop

• Create a BI Publisher report from the BI Server• Create a BI Publisher report from the BI Discoverer

worksheet content• Add BI Publisher reports to BI Interactive Dashboards

Page 397: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 3

Copyright © 2008, Oracle. All rights reserved.

Oracle BI Publisher Integration

BI Publisher

Enterprise Edition Discoverer

Oracle BI Publisher IntegrationOracle BI Publisher is integrated with Oracle BI Enterprise Edition (BI EE) and Oracle BI Discoverer. The following integration features are available:

• BI EE- Create a BI Publisher report from a BI Answers request.- Create a BI Publisher report from the BI Server.- Add BI Publisher reports to BI Interactive Dashboards.

• BI Discoverer- Create a BI Publisher report from the BI Discoverer worksheet content.

Page 398: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 4

Copyright © 2008, Oracle. All rights reserved.

Creating a BI Publisher Report from an Answers Request by Using BI Publisher Enterprise

1. Create a BI Publisher report.2. Specify a BI Answers data set for the report.3. Associate an existing template with the report.4. View the report.

Creating a BI Publisher Report from an Answers Request by Using BI Publisher Enterprise

In BI Publisher, create a report and a data set that accesses an Answers request. Next, associate a template with the request and publish it in any format supported by BI Publisher. You can also access the report from BI Publisher and display it in a BI dashboard.

Page 399: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 5

Copyright © 2008, Oracle. All rights reserved.

1. Creating a BI Publisher Report

Create a report:

2

3

1

4

1. Creating a BI Publisher ReportSelect a folder in which to create a report, and then perform the following steps:

1. Click the “Create a new report” link.2. Enter a name for the report.3. Click Create.4. Click the report’s Edit link to specify its properties.

Page 400: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 6

Copyright © 2008, Oracle. All rights reserved.

2. Specifying a BI Answers Data Set for the Report

Select Data Model, and click New to create an Oracle BI Answers data set.

1

2

3

5

4

2. Specifying a BI Answers Data Set for the ReportAdd a new data model for the report, and perform the following steps in the Data Set pane:

1. Enter a name for the data set.2. Select Oracle BI Answers as the type.3. In the Details section, click the flashlight icon to open the Oracle BI Catalog window.4. In the Oracle BI Catalog window, navigate through the BI Presentation Catalog folders and

select the request on which you want to base your Publisher report.5. Verify that the Oracle BI Answers request appears in the data set details.6. Click Save.

Note: You can now view the XML output of the request in BI Publisher by selecting the View option for the report.

Page 401: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 7

Copyright © 2008, Oracle. All rights reserved.

3. Associating an Existing Templatewith the Report

Select Layouts, and click New to create a layout.

1

2

3

3. Associating an Existing Template with the ReportAdd a new layout for the report:

1. (Optional) If you need to upload a template file that you created, select Layouts in the selection pane and, in the Manage Template Files section of the Create Layouts pane, click Browse. Navigate to the template file that you want to upload in the Choose File dialog box, and then click Open. Click Upload to upload the file.

2. Select the new layout that you created, enter a name for it, and select a file from the Template drop-down list.

3. Set the Template type.

Page 402: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 8

Copyright © 2008, Oracle. All rights reserved.

4. Viewing the Report

Select the new report and click View.

4. Viewing the reportClick View to view the report.

Page 403: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 9

Copyright © 2008, Oracle. All rights reserved.

Creating a BI Publisher Report from anAnswers Request by Using BI Publisher Desktop1. Log in to BI Publisher from Oracle BI Publisher Template

Builder for Word.2. Select an Answers request as the data source and save it

as a BI Publisher report.3. Create a template.4. Upload the template.5. View the report.

Creating a BI Publisher Report from an Answers Request by Using BI Publisher Desktop

In BI Publisher, create a report and a data set that accesses an Answers request. Next, associate a template with the request and publish it in any format that is supported by BI Publisher. You can also access the same report from BI Publisher and display it in a BI dashboard.

Page 404: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 10

Copyright © 2008, Oracle. All rights reserved.

1. Logging In to BI Publisher from the Template Builder for Word

Open Word, select Oracle BI Publisher > Logon, and log in to BI Publisher.

1

2

1. Logging In to BI Publisher from the Template Builder for Word1. Open Word and select Logon from the Oracle BI Publisher menu.2. On the Oracle BI Publisher Login page, enter a username and password. Click Login.

Page 405: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 11

Copyright © 2008, Oracle. All rights reserved.

2. Selecting an Answers Request as the Data Source and Saving It as a BI Publisher Report

Select the request in the Open Template dialog box and save it.

1

2 3

4

2. Selecting an Answers Request as the Data Source and Saving It as a BI Publisher Report

1. Select the Oracle BI workspace. By default, the BI Publisher workspace is selected, and the BI Publisher folders are displayed in the left pane. Notice that the Oracle BI Presentation Catalog folders are now displayed in the left pane.

2. Select the appropriate Presentation Catalog folder.3. In the right Reports pane, select the Answers request that you want to save as a BI Publisher

report.4. In the Save As Oracle BI Publisher Report dialog box, select the appropriate BI Publisher

folder in which to save the report, and click Save. Notice that the folders available in this dialog box are from Oracle BI Publisher rather than from the Presentation Catalog.

Page 406: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 12

Copyright © 2008, Oracle. All rights reserved.

3. Creating a Template

In Word, enter text, graphics, and other common word processing elements, and insert fields, charts, and tables to create a BI Publisher template.

Page 407: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 13

Copyright © 2008, Oracle. All rights reserved.

4. Uploading the Template

From Word, upload the template.

1

2

4. Uploading the TemplateTo upload the template, perform the following steps:

1. Select Oracle BI Publisher > Upload Template As.2. In the “Upload as new” dialog box, specify a template name and click OK.

Page 408: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 14

Copyright © 2008, Oracle. All rights reserved.

5. Viewing the Report

Select the new report and click View.

5. Viewing the ReportBefore viewing the report, associate the uploaded template with the report by performing the steps described earlier in the lesson. To view the report, select it in BI Publisher Enterprise and click View.

Page 409: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 15

Copyright © 2008, Oracle. All rights reserved.

Creating a BI Publisher Report from the BI Server

1. Create a report that queries the BI Server metadata.2. Build the query by using the Query Builder.3. Associate a template with the request and view the report.

Creating a BI Publisher Report from the BI ServerIn this case, instead of picking a request from Answers, the query is built directly against the metadata in the Oracle BI Server. Because the query is built against the logical data model, there is no need to define joins between the tables because they are defined in the Oracle BI Server metadata. After the query is built, associate a template with it and then view the report in either BI Publisher or an interactive dashboard.

Page 410: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 16

Copyright © 2008, Oracle. All rights reserved.

1. Creating a Report that Queries the BI Server Metadata

Create a report and specify a SQL query data set for the report.

2

3

1

4

1. Creating a Report that Queries the BI Server MetadataCreate a report. Add a new data model for the report and perform the following steps in the Data Set pane:

1. Enter a name for the data set.2. Select SQL Query as the type.3. In the Details section, select Oracle BI EE as the data source.4. Click the Query Builder button.

Page 411: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 17

Copyright © 2008, Oracle. All rights reserved.

2. Building the Query by Using the Query Builder

Select tables and columns to include in the query.

2. Building the Query by Using the Query BuilderA new window is displayed with subject areas in the drop-down list in the left pane. Select the subject area for your report. After you select the subject area, all logical tables in that subject area are displayed. Double-click tables to add them to the upper-right pane. When a table is added to the right pane, all its columns are displayed. Select columns from the tables. There is no need to create joins because the columns are picked from logical tables in the repository in the BI Server.

Page 412: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 18

Copyright © 2008, Oracle. All rights reserved.

2. Building the Query by Using the Query Builder

Select the Conditions tab to set conditions, including sorting and grouping.

2. Building the Query by Using the Query Builder (continued)Specifying Query ConditionsConditions enable you to filter and identify the data that you want to work with. As you select columns within an object, you can specify conditions on the Conditions tab. You can use these attributes to modify the column alias, apply column conditions, sort columns, or apply functions.

Page 413: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 19

Copyright © 2008, Oracle. All rights reserved.

2. Building the Query by Using the Query Builder

View the SQL that you created and click Save.

2. Building the Query by Using the Query Builder (continued)Click the SQL tab to view the SQL query that you created. Click Save to save the query.

Page 414: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 20

Copyright © 2008, Oracle. All rights reserved.

3. Associating an Existing Template with the Request and Viewing the Report

As shown previously:• If necessary, create a template.• Associate a template with the report based on the BI Server

metadata.• View the report.

Page 415: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 21

Copyright © 2008, Oracle. All rights reserved.

Creating a BI Publisher Report fromthe Discoverer Worksheet Content

1. Log in to BI Publisher from BI Publisher Desktop.2. Save a Discoverer worksheet as a BI Publisher report. (This

identifies Worksheet content as the data set for the report.)3. Create a template for the report.4. Preview the report output.5. Upload the template to BI Publisher Enterprise.

Creating a BI Publisher Report from the Discoverer Worksheet ContentTo use the Discoverer Worksheet content as a BI Publisher data source, select the appropriate Discoverer Public Connection. This action provides access to all workbooks and associated worksheets for that connection. Next, select a worksheet and save it as a BI Publisher report.After saving it as a BI Publisher report, you can modify it, and the underlying Discoverer data from the worksheet serves as the data source.You can use BI Publisher Desktop to create and publish a template for the report, just like any other BI Publisher data source. You can view the report in any of the supported report output formats.

Page 416: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 22

Copyright © 2008, Oracle. All rights reserved.

Discoverer Worksheet

• Is ideal for ad hoc,end-user analysis

• Includes Relational or OLAP data

• Displays one table and one graph

• Supports multiple graph types

Discoverer WorksheetA Discoverer Worksheet is a container for an Oracle BI Discoverer report. The information for Discoverer reports may come from either Oracle relational or Oracle online analytical processing (OLAP) data sources.The Discoverer Worksheet environment is ideal for creating reports that enable ad hoc and end-user analysis. Data elements, including measures, dimensions, and dimension members, may be dragged to and from the worksheet area to create cross-tabs, tables, and graphs of business intelligence data. A graph or a cross-tab (or table), or both, may be displayed in a worksheet. Over 70 graph types are available.Several worksheets may be collected in a Discoverer Workbook. To access the worksheets in a workbook, you must create a Discoverer Public Connection for the user who owns the workbook. This public connection is used to display the associated worksheets as data sources for BI Publisher.

Page 417: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 23

Copyright © 2008, Oracle. All rights reserved.

1. Logging In to BI Publisher

1

2

1. Logging In to BI PublisherIn the example, BI Publisher is launched from Word.

Page 418: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 24

Copyright © 2008, Oracle. All rights reserved.

2a. Selecting Discoverer and a Public Connection

The Open Template window is automatically displayed.Choose Discoverer and select a Discoverer Public Connection.

1

2

2a. Selecting Discoverer and a Public ConnectionAfter you log in to BI Publisher, the Open Template window appears. To select the appropriate BI Discoverer Connection, perform the following steps:

1. Choose Discoverer from the Workspace drop-down list.2. Select a Discoverer connection from the Select Data Connection window, and click Select

Connection.Result: The Open Template window is refreshed with the available Discoverer workbooks.

Page 419: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 25

Copyright © 2008, Oracle. All rights reserved.

2b. Selecting a Discoverer Worksheet

All Discoverer workbooks and associated worksheets for the selected connection are displayed.

2b. Selecting a Discoverer WorksheetThe Open Template window is refreshed with a list of the Discoverer workbooks that are available for the selected connection.To select a worksheet, perform the following steps:

1. Click a workbook to display its associated worksheets in the Reports list.2. Double-click a worksheet.

Result: The Save As BI Publisher Report window appears.

Page 420: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 26

Copyright © 2008, Oracle. All rights reserved.

2c. Saving the Worksheet as a BI Publisher Report

2c. Saving the Worksheet as a BI Publisher ReportIn the Save As BI Publisher Report window, perform the following steps:

1. Select the appropriate folder or subfolder, or both.2. Click Save.

Result: The Worksheet contents (data items) are available as a BI Publisher report.

Page 421: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 27

Copyright © 2008, Oracle. All rights reserved.

3a. Creating a Template for the Report

Complete the wizard steps.

3a. Creating a Template for the ReportUse the Template Builder in BI Publisher Desktop to create a template for the Discoverer worksheet data. As discussed earlier in this lesson, you can apply any Word formatting and layout tools to the template to create a sophisticated presentation layout.In the example, the Table Wizard is used to create a simple template for the Annual Sales, Profits by Region City worksheet that was previously selected as the Discoverer data source.

Page 422: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 28

Copyright © 2008, Oracle. All rights reserved.

3b. Modifying the Template

Additional content items and MS Word formatting are added to the template.

3b. Modifying the TemplateIn the example, the original template was modified in a number of ways:

• Word formatting was used to improve the presentation of the table headings and data.• A data header was added to provide a sum of Revenue for the particular page item (Region).• Two graphs were added: one displays Sales data, and the other displays Profits.• A report header was added.

Page 423: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 29

Copyright © 2008, Oracle. All rights reserved.

4. Previewing the Report Output

4. Previewing the Report OutputIn the example, PDF format is chosen as the output format for the report. The report appears in the selected format.The slide example shows a PDF preview of the report output by using the modified template.

Page 424: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 30

Copyright © 2008, Oracle. All rights reserved.

5. Uploading the Template

5. Uploading the TemplateUpload the template to BI Publisher Enterprise as discussed earlier in this lesson.

Page 425: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 31

Copyright © 2008, Oracle. All rights reserved.

Viewing the Report in BI Publisher Enterprise

Viewing the Report in BI Publisher EnterpriseThe BI Discoverer report can now be viewed, scheduled, and delivered like any other BI Publisher Enterprise report.

Page 426: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 32

Copyright © 2008, Oracle. All rights reserved.

Adding BI Publisher Reports toInteractive Dashboards

Select Dashboard > Page Option > Edit Dashboard.

1 2 3

4

Adding BI Publisher Reports in Interactive DashboardsYou can add any BI Publisher report to a BI Interactive Dashboard, including reports with data sources from Oracle BI EE and Oracle BI Discoverer.To add a BI Publisher report to a dashboard, perform the following steps:

1. From within Oracle BI EE, click the Dashboard link, and click Page Option in the upper-right corner. Select Edit Dashboard from the drop-down list to open the dashboard editor.

2. From Dashboard Objects, drag the BI Publisher Report object to a section in the editor workspace.

3. Click the Properties link for the BI Publisher object. The BI Publisher Report Properties dialog box is displayed.

4. Browse and select your BI Publisher report. Click OK. The report with the associated template is displayed. Note that a dashboard page can contain only one Oracle BI Publisher report.

Page 427: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 33

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:• Create a BI Publisher report from a BI Answers request in:

– BI Publisher Enterprise– BI Publisher Desktop

• Create a BI Publisher report from the BI Server• Create a BI Publisher report from the BI Discoverer

worksheet content• Add BI Publisher reports to BI Interactive Dashboards

Page 428: D54122

Oracle BI Publisher 10g R3: Fundamentals 13 - 34

Copyright © 2008, Oracle. All rights reserved.

Practice 13: Overview

This practice covers building a BI Publisher report by using an Oracle BI Server Subject Area.

Page 429: D54122

Copyright © 2008, Oracle. All rights reserved.

Creating Reports Based on Other Data Sources

Page 430: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 2

Copyright © 2008, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:• Create a BI Publisher report based on Web Services• Create a BI Publisher report based on RSS feeds• Create a BI Publisher report based on a file

Page 431: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 3

Copyright © 2008, Oracle. All rights reserved.

Data Sources Supported by BI Publisher

You can build BI Publisher reports based on the following data sources: • SQL Query (Database)• HTTP (XML/RSS Feeds)• Web Service• Data Template• Oracle BI Answers• Oracle BI Discoverer• File (XML files)

Data Sources Supported by BI PublisherBI Publisher supports a variety of data sources from which reports can be created. These data sources are listed in the slide. So far, you have created reports based on Oracle Database and data templates. You have also explored how the integration of BI Publisher with other BI products, such as Oracle Business Intelligence Enterprise Edition and Oracle BI Discoverer, help you to create reports based on BI Answers Request, BI Server Subject Area, and BI Discoverer Worksheets. In this lesson, you learn to create reports based on Web Services, XML/RSS feeds, and XML sample files from the local file system.Note: BI Publisher also enables you to create a report from multiple data sources. That is, you can pull the data into a single report based on multiple data sources; for example, for the employee details report, you may also want to show the stock information for your organization. You create two data models for a single report, and then select Concatenated SQL Data Source as the data set for the report. This topic is discussed in the Oracle By Example titled Exploring Advanced Features of BI Publisher, which is available on OTN.

Page 432: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 4

Copyright © 2008, Oracle. All rights reserved.

Introduction to Web Services

Web Services :• Are open, standard-based Web applications• Integrate applications across platforms to exchange data

Web Service standards:• WSDL• SOAP• UDDI

Introduction to Web ServicesWeb Services are open, standard–based Web applications that interact with other Web applications for the purpose of exchanging data. Web Services help to quickly integrate applications across multiple platforms, systems, and businesses in an easier and cheaper way than ever before. Some of the Web Services standards are Simple Object Access Protocol (SOAP), Web Services Description Language (WSDL), and Universal Description, Discovery and Integration (UDDI), which enable system-to-system communication that is platform-independent. Some of the popular Web Services implementations are those that exchange information about stock quotes, currency converters, and global weather.

Page 433: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 5

Copyright © 2008, Oracle. All rights reserved.

XML/RSS Feeds

Web sites provide XML/RSS or other types of feeds. They:• Provide XML or a flavor of XML • Support Web content syndication or aggregation

RSS feeds are popular for use with news and blogs.

XML/RSS FeedsAs discussed earlier in the course, Extensible Markup Language (XML) is a general-purpose markup language, and its primary purpose is to facilitate the sharing of structured data across different information systems, particularly via the Internet. By adding semantic constraints, application languages such as XHTML and RSS can be implemented in XML.Many Web sites have links labeled “XML,” “RSS,” or others. All these are ways of saying that you can find out about updates to that site without having to visit the site in your Web browser. This feature is referred to as “syndication” or “aggregation.” All these feeds provide XML or various flavors of XML.About RSS Feeds: RSS (Really Simple Syndication) is “a group of XML-based Web-content distribution and republication (Web syndication) formats that are primarily used by news sites and Web-logs (popularly known as blogs).” Essentially, an RSS feed is a hosted XML file from which your RSS newsreader pulls headlines, URLs, and other content as it is updated. Users of RSS content use software programs called “feed readers” or “feed aggregators.” The user subscribes to a feed by entering a link to the feed into the reader program. The reader can then check the user’s subscribed feeds to see whether any of those feeds have new content since the last time it was checked, and if so, retrieve that content and present it to the user.

Page 434: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 6

Copyright © 2008, Oracle. All rights reserved.

Proxy Settings

When the WSDL and RSS/XML feed URLs are outside the firewall, then:• Add proxy settings in the server startup file

(the xmlpserverstart.bat or oc4j.cmd file)• Restart the services

Proxy SettingsSometimes, the WSDL and the RSS/XML feed URLs that you use for your BI Publisher reports may be outside your organization’s firewall. In this case, you must set proxy parameters for BI Publisher and restart the services to avoid access problems with the Web Services and RSS data set reports:

• In the server startup file (that is, xmlpserverstart.bat or oc4j.cmd), modify the following line that defines JAVA_HOME (observe the proxy parameters in bold): "%JAVA_HOME%\bin\java" %JVMARGS% -jar -Dhttp.proxyHost= <myproxy.mycompany.com> -Dhttp.proxyPort=<Port> "%OC4J_JAR%" %CMDARGS%

• Restart xmlpserver or oc4j as the case may be.

Page 435: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 7

Copyright © 2008, Oracle. All rights reserved.

Creating a BI Publisher Report Based on Web Services

1. Create a report and define the data set information.2. Define a parameter and add it to the data set.3. View the XML data. 4. Use a predefined template for the report to view data.

Creating a BI Publisher Report Based on Web ServicesYou can create a BI Publisher report based on Web Services. You can do this by selecting Web Service as the data set type in BI Publisher when creating the report. The steps listed in the slide are discussed in more detail on the following pages. Note: BI Publisher supports document or literal Web Service data sources that return XML as a string. The example used in this lesson shows creating a BI Publisher report based on a Web Service, which provides stock quotes. A predefined RTF template is used to view data (the template is provided with this course).

Page 436: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 8

Copyright © 2008, Oracle. All rights reserved.

Step 1: Creating a Report and Defining the Data Set

Step 1: Creating a Report and Defining the Data Set1. Log in (if not logged in) to BI Publisher as Administrator (password: Administrator).2. Navigate to the folder where you created the previous reports (Learn folder), and click

“Create a new report.” Enter a name (for example, Based on Web Services) for the report.

3. Click the Edit link below the name of the report to open it in Edit mode.4. Select the Data Model node on the left, and click New to define a new data model for the

report. Select the new data set that is created and define the following: - Select Web Service from the Type drop-down list.- Enter the URL for the Web Service in the WSDL URL field:

(The example uses http://www.webservicex.net/stockquote.asmx?WSDL.)

- Enter GetQuote as the method name. 5. Click the Save icon to save the changes to the report.

Note: WebserviceX.NET provides on-demand XML Web Services for Financial, Distribution, Retail, Health Care, Manufacturing, Telecom, Government, and Educational organizations or industries.

Page 437: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 9

Copyright © 2008, Oracle. All rights reserved.

Step 2: Defining a Parameter and Adding It to the Data Set

Step 2: Defining a Parameter and Adding It to the Data Set6. Click Parameters, and click New to add a parameter for the stock symbol. 7. On the Parameter page that appears:

- Enter quote as the identifier. - Select String from the Data Type drop-down list. - Enter orcl as the default value, and Text as the parameter type. - Enter Enter Stock Symbol: in the Display Label field.

8. Select the data set for the Web Services report, and edit the data model to add the parameter. Ensure that Quote is selected in the Parameters drop-down list. The Data Set page should look like the image in the slide.

9. Click the Save icon to save the changes to the report.

Page 438: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 10

Copyright © 2008, Oracle. All rights reserved.

Step 3: Viewing the Report XML Data

Step 3: Viewing the Report XML Data10. View the XML data to see whether the stock quotes for Oracle Corporation are being

returned to the report.Note: You can also view the stock quotes for other corporations by entering appropriate stock symbols, such as msft (Microsoft) and GE (General Electric).

Page 439: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 11

Copyright © 2008, Oracle. All rights reserved.

Step 4: Viewing the Data by Using a Predefined Template

Step 4: Viewing the Data by Using a Predefined Template11. In Word, open the WebServices.rtf template file. (You can find this template file in

D:\Labs\ BIP_10.1.3.3._Labs\Templates.)12. Log in to Oracle BI Publisher in Word. This opens the Open Template window. Navigate

to your working folder (My Folders > Learn). Select the Based on Web Services report,and click Open Report.

13. Select BI Publisher > Preview Template > PDF from the menu to preview the data in the report by using this template.

14. Select BI Publisher > Upload Template As to publish the template for this report. Enter a name as the template name and click OK. Click OK again when the confirmation message is displayed.

Page 440: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 12

Copyright © 2008, Oracle. All rights reserved.

Creating a BI Publisher Report Based on RSS Feeds

1. Create a report and define the data set information.2. View the XML data.3. Use a predefined template to view the data in the report.

Creating a BI Publisher Report Based on RSS FeedsYou can create a BI Publisher report based on XML/RSS feeds available on the Web. You can do this by selecting HTTP as the data set type in BI Publisher when creating the report. The steps listed in the slide are discussed in more detail on the following pages. In this lesson, a simple site with RSS feed links (The New York Times) is used to show how the data is rendered to a BI Publisher report. However, note that the RSS readers or aggregators are not discussed here because they are out of the scope of this course.

Page 441: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 13

Copyright © 2008, Oracle. All rights reserved.

Step 1: Creating a Report and Defining the Data Set

Step1: Creating a Report and Defining the Data Set1. In BI Publisher, navigate to your working folder (My Folders > Learn), and click “Create a

new report.” Enter a name (such as Based on HTTP-RSS) for the report, and click Create.

2. Click the Edit link below the name of the report to open it in Edit mode. Select the Data Model node on the left, and click New to define a new data model for the report.

3. Select the new data set created and define the following on the Data Set page on the right:- Enter a name (say, News) in the Name field.- Select HTTP (XML Feed) from the Type drop-down list.- Enter the URL for the XML/RSS feed: http://www.nytimes.com/services/xml/rss/nyt/Business.xml

- Select GET from the Method drop-down list. Note: You can select the POST method, and specify a username, password, and realm as per your requirement.

- Select Cache Results. 4. Click Save to save the report.

Page 442: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 14

Copyright © 2008, Oracle. All rights reserved.

Step 2: Viewing the Report XML Data

Step 2: Viewing the Report XML DataYou can view the XML data to check whether this news site is rendering valid data to the report.

5. Click View to open the report in View mode, and click View again to see the XML data in the report.

Page 443: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 15

Copyright © 2008, Oracle. All rights reserved.

Step 3: Using a Predefined Template to View the Data

Step 3: Using a Predefined Template to View the Data6. In Word, open the HTTP-RSS.rtf template file (found in the D:\Labs\

BIP_10.1.3.3._Labs\Templates folder). 7. Connect (if not already connected) to Oracle BI Publisher as Administrator in Word.8. This opens the Open Template window. Open the “Based on HTTP-RSS” report from My

Folders > Learn.9. Preview the report data in PDF (select Preview > PDF).10. Select BI Publisher > Upload Template As to publish the template for this report. Enter a

name for the template and click OK. Click OK again when the confirmation message is displayed. Note: A simple RSS feed site is used here. You can try creating reports by using the RSS feeds available on the Oracle site at http://www.oracle.com/rss/index.html or on Yahoo at http://news.yahoo.com/rss, or other RSS feeds.

Page 444: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 16

Copyright © 2008, Oracle. All rights reserved.

Creating a Report Based on a File

1. Ensure that the demo files location is defined as a file data source.

2. Create a report and define the data set information.3. View the XML data.4. Use a sample template provided to view the data.

Creating a Report Based on a FileTo create a report based on file data set, use the XML demo files provided with BI Publisher. Note: The demo files are generally found in the <Oracle Home>/ xmlp/XMLP/DemoFiles directory.The steps listed in the slide are discussed in detail on the following pages. You use the purchase order XML file from the demo files, and upload a predefined template for the report.

Page 445: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 17

Copyright © 2008, Oracle. All rights reserved.

Step 1: Checking the Demo Files Data Source

Step 1: Checking the Demo Files Data SourceBefore creating a report based on the file data set, you must check whether the location of the data files is defined as a data source on the Admin page. (By default, the <Oracle Home>/xmlp/XMLP/DemoFiles directory is defined as the file data source.)

1. Log in to BI Publisher as Administrator, and click the Admin tab.2. In the Data Sources section, click File (to see whether the data source is defined).3. Check whether the demo files directory is added as the file data source. (The default name

is demo files.)Note: If this data source is not defined, define the file data source by adding the correct directory path for the demo files. (Click Add Data Source.)

Page 446: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 18

Copyright © 2008, Oracle. All rights reserved.

Step 2: Creating a Report and Defining the Data Set

Step 2: Creating a Report and Defining the Data Set4. Navigate to your working folder and create a report. Enter a name for the report (such as Based on File).

5. Open the report in Edit mode and define a new data source for the report. (Click Data Model, and click New to define the data source.)

6. Select the new data set that is created, and specify the following details on the Data Set page:

- Select File from the Type drop-down list. - Ensure that “demo files” is selected as the data source and enter PODataSample.xml as the file name.

7. Click Save to save the report.

Page 447: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 19

Copyright © 2008, Oracle. All rights reserved.

Step 3: Viewing the XML Data

Step 3: Viewing the XML Data8. Check whether the report is returning valid XML data. Click View to go to View mode of

the report, and click View again to view the XML data. A portion of the sample purchase order XML data is shown in the slide.

Page 448: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 20

Copyright © 2008, Oracle. All rights reserved.

Step 4: Using a Sample Template to View the Data

Step 4: Using a Sample Template to View the DataBI Publisher ships with many sample template files (.rtf files) along with the sample XML files. These are found in the following path:

<Oracle Home>/xmlp/XMLP/ReportsSo far, you have uploaded templates for reports by using BI Publisher Desktop in Microsoft Word. You can also upload files directly in BI Publisher Enterprise Server by performing the following steps:

1. Go to Edit mode of the report. (If you are in View mode of the report, click the Edit link to go back to Edit mode.)

2. Click Layouts in the Report pane on the left to display the Create Layouts section on the right. Click Browse in the Manage Template Files section to browse and upload a predefined RTF template.

- Navigate to the <Oracle Home>/xmlp/XMLP/Reports> Supply Chain management>Purchase Order folder.

- Select the POTemplateSample.rtf file and click Open. - Click Upload to upload this RTF template for the report.

Click Save to save the layout changes to the report. 3. Click Layouts again, and click New to create a report layout to associate it with the

template that you uploaded.4. In the Layout section that is displayed on the right, ensure that POTemplateSample.rtf is selected from the Template drop-down list and All formats is selected as the output format. Save the changes to the report layout.

Page 449: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 21

Copyright © 2008, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:• Create a BI Publisher report based on Web Services• Create a BI Publisher report based on RSS feeds• Create a BI Publisher report based on a file

Page 450: D54122

Oracle BI Publisher 10g R3: Fundamentals 14 - 22

Copyright © 2008, Oracle. All rights reserved.

Practice 14: Overview

This practice covers the following topics:• Creating a BI Publisher report based on Web Services• Creating a BI Publisher report based on XML/RSS feeds• Creating a report based on a sample XML file