Академический Документы
Профессиональный Документы
Культура Документы
D17075GC10
Production 1.0
June 2004
D39520
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Authors Copyright 2004, Oracle. All rights reserved.
Ellen Gravina This documentation contains proprietary information of Oracle Corporation. It is
Smitha Keshav provided under a license agreement containing restrictions on use and disclosure and
is also protected by copyright law. Reverse engineering of the software is prohibited.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Technical Contributors If this documentation is delivered to a U.S. Government Agency of the Department of
Defense, then it is delivered with Restricted Rights and the following legend is
and Reviewers applicable:
Cem Ayberkin
Restricted Rights Legend
Christian Bauwens
Alena Bugarova Use, duplication or disclosure by the Government is subject to restrictions for
commercial computer software and shall be deemed to be Restricted Rights software
Kathryn Cunningham under Federal law, as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013,
Laurent Dereac Rights in Technical Data and Computer Software (October 1988).
Mark Fleming This material or any portion of it may not be copied in any form or by any means
Warren Lord without the express prior written permission of Oracle Corporation. Any other copying
is a violation of copyright law and may result in civil and/or criminal penalties.
Marcelo Manzano
If this documentation is delivered to a U.S. Government Agency not within the
Darren McBurney Department of Defense, then it is delivered with Restricted Rights, as defined in
Paul Narth FAR 52.227-14, Rights in Data-General, including Alternate III (June 1987).
Daphne Nougier The information in this document is subject to change without notice. If you find any
Miyuki Ohsato problems in the documentation, please report them in writing to Education Products,
Oracle Corporation, 500 Oracle Parkway, Box SB-6, Redwood Shores, CA 94065.
Ligia Jasmin Robayo Oracle Corporation does not warrant that this document is error-free.
Jim Safcik All references to Oracle and Oracle products are trademarks or registered trademarks
Rie Saitoh of Oracle Corporation.
Navneet Singh All other products or company names are used for identification purposes only, and
Sarah Spicer may be trademarks of their respective owners.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Contents
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Preface
I Introduction
Course Objectives I-2
Course Content I-3
1 Introduction to Oracle Reports Developer
Objectives 1-2
Business Intelligence 1-3
Enterprise Reporting 1-5
Web Publishing 1-9
Paper Publishing 1-10
Oracle Reports Developer 1-11
Benefits 1-12
Oracle 10g Products 1-13
Oracle Database 10g 1-14
Oracle Developer Suite 10g 1-15
Oracle Application Server 10g 1-18
Oracle Reports Developer 1-20
OracleAS Reports Services 1-22
OracleAS Reports Services Architecture for the Web 1-23
Summary 1-25
2 Designing and Running Reports
Objectives 2-2
Understanding User Requirements 2-3
Designing Reports 2-5
Tabular 2-7
Master-Detail 2-8
Master with Two Details 2-9
Matrix 2-10
Retrieving and Sharing Data 2-11
Running a Report 2-13
Previewing Reports 2-15
Print Preview 2-16
Supported File Types 2-19
Summary 2-21
Practice 2 Overview 2-22
3 Working in Oracle Reports Developer
Objectives 3-2
Reports Developer Executables 3-3
Invoking Reports Builder 3-5
Reports Builder Modules 3-6
Report Data and Layout 3-7
Reports Builder Components 3-8
Main Menu Structure 3-10
Wizards 3-12
Report Editor 3-13
PL/SQL Development Environment: Syntax Palette 3-15
iii
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Object Navigator 3-16
Report-Level Objects 3-17
Data Model Objects 3-18
Paper Layout Objects 3-19
Paper Parameter Form Objects 3-20
Object Interrelationship 3-21
Customizing Your Oracle Reports Developer Session 3-22
Saving Preferences 3-23
Oracle Reports Environment Variables 3-24
Using the Online Help System 3-26
Summary 3-28
Practice 3 Overview 3-29
4 Creating a Paper Report
Objectives 4-2
Report Module Components 4-3
Building a Paper Report 4-4
Invoking the Report Wizard 4-5
Choosing the Layout Type 4-6
Creating a Tabular Report 4-7
Selecting the Data Source Type 4-9
Using Query Builder 4-10
Building a Query 4-11
Query Builder Functions 4-12
Selecting Displayed Fields 4-14
Totals and Labels 4-15
Selecting a Report Template 4-16
Viewing the Paper Report Output 4-17
Saving the Report Definition 4-18
Reentering the Wizard 4-19
Creating a New Report 4-21
Creating Break Reports 4-22
Break Report Labels 4-23
Creating Mailing Labels and Letters 4-24
Creating a Matrix Report 4-26
Previewing a Paper Report in a Browser 4-28
Summary 4-30
Practice 4 Overview 4-31
5 Enhancing a Basic Paper Report
Objectives 5-2
What Is the Paper Design? 5-3
The Paper Design Window 5-4
Modifying a Report 5-5
Aligning Columns 5-6
Setting a Format Mask 5-7
Manipulating Objects 5-9
iv
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying Visual Attributes 5-10
Applying Conditional Formatting 5-12
Inserting Page Numbers, Dates, and Times 5-14
Customizing Dates 5-16
Summary 5-17
Practice 5 Overview 5-18
6 Managing Report Templates
Objectives 6-2
Using Report Templates 6-3
Modifying a Template 6-4
Customizing the Template Margin 6-6
Customizing the Template Body 6-7
Adding Web Links to a Template for Report HTML Output 6-8
Predefining Your Own Templates 6-10
Adding a Template Preview Image 6-12
Summary 6-13
Practice 6 Overview 6-14
7 Creating a Web Report
Objectives 7-2
What Is JSP Technology? 7-3
JSP Advantages 7-4
Simple JSP Example 7-6
Building a Web Report 7-7
Using the Report Wizard 7-8
Report Editor: Web Source View 7-9
JSP Tags 7-11
Web Source Example 7-13
Generating Output 7-15
Image Format Support 7-17
Summary 7-19
Practice 7 Overview 7-20
8 Enhancing Reports Using the Data Model: Queries and Groups
Objectives 8-2
The Data Model Objects 8-3
Modifying Properties of a Query 8-5
More Properties 8-8
Applying Changes 8-10
Changing the Group Structure 8-12
Group Hierarchy 8-14
Ordering Data in a Group 8-16
Query Modifications 8-18
Filtering Data in a Group 8-20
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using a Packaged Filter 8-21
Summary 8-22
Practice 8: Overview 8-23
vi
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Resetting Summary Values 10-17
Creating a Formula Column 10-18
Creating a Placeholder Column 10-20
Populating a Placeholder Column 10-22
Summary 10-24
Practice 10 Overview 10-25
11 Enhancing Reports Using the Paper Layout
Objectives 11-2
Viewing the Paper Layout 11-3
Viewing the Section Areas 11-5
Designing Multipanel Reports 11-6
Printing Multipanel Reports 11-8
Different Objects in the Paper Layout 11-9
The Paper Layout Layers 11-11
Avoiding Layout Errors 11-13
Report Processing 11-15
Creating Layout Objects 11-17
Paper Layout Tools 11-19
Report Bursting 11-20
Bursting on a Repeating Group 11-22
Creating an Additional Layout 11-24
Distributing a Report 11-26
Tracing the Report Distribution 11-28
Creating Variable Length Lines 11-30
Summary 11-32
Practice 11 Overview 11-33
12 Controlling the Paper Layout: Common Properties
Objectives 12-2
Modifying Paper Layout Object Properties 12-3
Comparing Properties 12-5
Common Layout Properties 12-6
Sizing Objects 12-7
Anchors 12-9
Layout Object Relationships 12-11
Pagination Icons in the Paper Layout 12-14
Using Page Break Before 12-16
Using Page Break After 12-18
Using Page Protect 12-20
Controlling Print Frequency 12-22
Using Format Triggers 12-24
Layout Object Properties for Web Support 12-25
Summary 12-27
Practice 12 Overview 12-28
vii
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
13 Controlling the Paper Layout: Specific Properties
Objectives 13-2
Properties of a Repeating Frame 13-3
Specifying Print Direction 13-4
Controlling the Number of Records per Page 13-6
Controlling Spacing Between Records 13-7
Minimum Widow Records 13-8
Column Mode 13-9
Properties of a Field 13-10
System Variables 13-12
Page Numbering 13-13
Valid Source Columns 13-15
Displaying File Contents 13-17
When Are the Contents Updated? 13-19
Linking and Importing Files 13-20
Comparing a File Link and a File Column 13-21
Specifying the Format Order 13-22
PDF Document Taxonomy Properties 13-24
Summary 13-25
Practice 13 Overview 13-26
14 Web Reporting
Objectives 14-2
High Quality Web Publishing 14-3
Comparing Static and Dynamic Reporting 14-5
Adding Dynamic Content 14-7
Creating a Report Block 14-9
Invoking the Report Block Wizard 14-11
Examining the Web Source Code 14-12
rw:foreach Tag 14-14
rw:field Tag 14-15
Customizing Reports JSPs 14-16
Customizing Reports JSPs Using Style Sheets 14-17
Customizing Reports JSPs Using HTML Tags and Attributes 14-19
Customizing Reports JSPs Using Reports Custom Tags 14-20
Summary 14-24
Practice 14 Overview 14-25
15 Extending Functionality Using XML
Objectives 15-2
Why Use XML Report Definitions? 15-3
Creating XML Report Definitions 15-5
Partial Report Definitions: Format Modification Example 15-7
Partial Report Definitions: Format Exception Example 15-9
viii
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Full Report Definition: Data Model Modification Example 15-11
Running XML Report Definitions 15-15
Debugging XML Report Definitions 15-19
Summary 15-21
Practice 15 Overview 15-22
16 Creating and Using Report Parameters
Objectives 16-2
Creating User Parameters 16-3
Referencing Parameters in a Report Query 16-6
Using Bind References 16-8
Using Lexical References 16-10
Hints and Tips When Referencing Parameters 16-12
Creating a List of Values 16-14
Referencing System Parameters 16-18
Building a Paper Parameter Form 16-20
Customizing a Paper Parameter Form 16-22
Using Parameter Form HTML Extensions 16-24
Parameter Form Header and Footer 16-26
Summary 16-27
Practice 16 Overview 16-28
17 Embedding a Graph in a Report
Objectives 17-2
Adding a Graph to a Paper Report 17-3
Adding a Graph to a Web Report 17-5
Selecting the Graph Type 17-6
Selecting the Graph Data 17-7
Adding Options to the Graph 17-8
Customizing Web Graphs 17-10
The rw:graph Tag 17-11
Customizing Graphs Using the Graph.XML File 17-13
Using Graph Hyperlinks 17-15
Summary 17-18
Practice 17 Overview 17-19
18 Enhancing Matrix Reports
Objectives 18-2
The Matrix Data Model 18-3
The Matrix Paper Layout 18-5
Creating Matrix Summaries 18-7
Creating the Matrix Manually 18-9
The Matrix with Group Data Model 18-11
The Matrix with Group Layout 18-12
Building a Nested Matrix 18-13
Nested Matrix Paper Layout 18-15
ix
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Nested Matrix Summaries 18-17
Displaying Zeros 18-19
Summary 18-21
Practice 18 Overview 18-22
19 Coding PL/SQL Triggers
Objectives 19-2
Types of Triggers in Reports 19-3
Trigger Code 19-5
Using Report Triggers 19-6
Using Data Model Triggers: PL/SQL Group Filter 19-10
Using Data Model Triggers: Parameter Validation 19-12
Using Layout Triggers 19-14
Using a Format Trigger on a Frame 19-16
Using a Format Trigger on a Repeating Frame 19-18
Using a Format Trigger on a Field 19-20
Using a Format Trigger in a Web Layout 19-21
Using a Format Trigger on a Boilerplate Object 19-22
Writing Common Code 19-24
Event-Based Reporting 19-26
Event-Driven Publishing API 19-27
Invoking a Report from a Database Event 19-29
Summary 19-31
Practice 19 Overview 19-33
20 Extending Functionality Using the SRW Package
Objectives 20-2
Contents of the SRW Package 20-3
Outputting Messages 20-5
Executing a Nested Report 20-7
Restricting Data 20-11
Initializing Fields 20-13
Creating a Table of Contents 20-15
Performing DDL Statements 20-17
Setting Format Attributes 20-19
Using Format Attributes in a Web Layout 20-22
Summary 20-24
Practice 20 Overview 20-25
21 Maximizing Performance Using OracleAS Reports Services
Objectives 21-2
Running Reports Using OracleAS Reports Services 21-3
Report Request Methods 21-5
Oracle Application Server Components 21-7
Enabling Single Sign-On Access 21-9
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running the Web Layout: JSP Run-time Architecture 21-11
Running the Paper Layout: Servlet Run-time Architecture 21-12
Running a Paper Report on the Web 21-13
Running a Report from the Command Line 21-15
The OUTPUTIMAGEFORMAT Parameter 21-16
The Schedule Parameter 21-17
Reports Caching 21-19
Using Oracle Enterprise Manager 21-20
Managing and Monitoring OracleAS Reports Services 21-21
What Is the Queue Manager? 21-22
Queue Manager 21-23
Using the Queue Manager 21-25
Summary 21-26
Practice 21 Overview 21-27
Glossary
xi
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Preface
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Profile
Before You Begin This Course
Before you begin this course, you should have:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Thorough knowledge of creating SQL query statements
Working experience of:
Creating PL/SQL constructs, including conditional statements, procedures and
functions
Creating PL/SQL stored (server) procedures and functions
Using a graphical user interface (GUI)
Prerequisites
The following instructor-led training (inClass) courses:
Oracle Database 10g: SQL Fundamentals I
Oracle Database 10g: PL/SQL Fundamentals
Oracle Database 10g: Develop PL/SQL Program Units
Or the following Self-Study CD courses:
Introduction to Oracle9i: SQL
Oracle SQL: Basic SELECT Statements
Oracle SQL: Data Retrieval Techniques
Oracle SQL: DDL and DML
Oracle9i PL/SQL Fundamentals
PL/SQL: Basics
Oracle9i: Develop PL/SQL Program Units
PL/SQL: Database Programming
PL/SQL: Procedures, Functions and Packages
Note: Use the Oracle9i Self-Study CD courses until the equivalent Oracle Database
10g courses become available.
Suggested
Oracle Database 10g: SQL Fundamentals II (inClass)
Suggested Follow-up Courses
Oracle9i Reports: Create Reports for the Web and Portals (eClass)
Oracle9i Reports: Integrate Pluggable Data Sources (eClass)
Oracle9iAS Reports Services: Deploy Internet Reports (eClass)
Preface - 3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
How This Course Is Organized
Oracle Reports Developer 10g: Build Reports is an instructor-led course featuring lecture
and hands-on exercises. Online demonstrations and written practice sessions reinforce the
Oracle University Internal and TransAmerica Training Management Inc Partner use only
concepts and skills introduced.
Preface - 4
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Executing Reports Using Reports Services with Oracle Developer Suite 10g
Oracle Developer Suite 10g contains an embedded Oracle Container for J2EE (OC4J) and
OracleAS Reports Services. This enables developers to test the reports deployment without
Oracle University Internal and TransAmerica Training Management Inc Partner use only
installing Oracle Application Server. This environment is provided as a testing environment
only, and is not a replacement for an appropriate production environment using Oracle
Application Server.
To test your reports:
1. Create the following directories:
a. $ORACLE_HOME\reports\j2ee\reports_ids\web\test
b. $ORACLE_HOME\reports\j2ee\reports_ids\web\test\css
c. $ORACLE_HOME\reports\j2ee\reports_ids\web\test\images
2. Copy the template images and style sheets as follows:
a. Copy $ORACLE_HOME\reports\docroot\css to
$ORACLE_HOME\reports\j2ee\reports_ids\web\test\css
b. Copy $ORACLE_HOME\reports\docroot\images to
$ORACLE_HOME\reports\j2ee\reports_ids\web\test\images
3. Add the $ORACLE_HOME\reports\j2ee\reports_ids\web\test directory
to the "REPORTS_PATH" environment variable using Start > Run > regedit
4. Start OC4J using Start > Programs > Oracle Developer Suite oracle_home >
Reports Developer > Start OC4J instance
Note: Do not close the DOS window since it is being used by the running OC4J
instance.
5. Copy your reports to $ORACLE_HOME\reports\j2ee\reports_ids\web\test
6. Locate your computer name using Start > Settings > Control Panel > System >
Network Identification Tab
7. Locate the Web site port number by inspecting the file $ORACLE_HOME
\j2ee\DevSuite\config\default-web-site.xml (e.g. 8889)
8. Test your paper reports using the reports servlet, for example,
http://Computer_Name:port_number/reports/rwservlet?report=
myReport.jsp&userid=username/password@dbName&destype=cache
&desformat=PDF
9. Test your Web reports using the JSP Engine, for example,
http://Computer_Name:port_number/reports/test/
myReport.jsp?userid=username/password@dbName
Note: The first time a Web report executes using the JSP engine, the OC4J needs to
compile the JSP report and it typically takes some time. All the subsequent report
executions using the JSP engine are fast.
Preface - 5
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Resources
Oracle Publications
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Title Part Number
Oracle Reports Tutorial B10612-01
Oracle Developer Suite 10g (9.0.4) Release Notes for Windows and B10668-01
UNIX [Chapter 9: Oracle Reports]
Oracle Application Server Reports Services Publishing Reports to B10314-01
the Web
Additional Publications
System release bulletins
Installation and users guides
read.me files
International Oracle Users Group (IOUG) articles
Oracle Magazine
Web Sites
Oracle Technology Network: http://otn.oracle.com
Oracle Reports Frequently Asked Questions (FAQ):
http://otn.oracle.com/products/reports/htdocs/faq.htm
Oracle Reports whitepapers, presentations, and viewlets:
http://otn.oracle.com/products/reports/content.html
Getting Started with Oracle Reports:
http://otn.oracle.com/products/reports/htdocs/getstart/
GettingStarted/index/index.html
Preface - 6
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Typographic Conventions
Typographic Conventions In Text
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Convention Element Example
Bold Emphasized words and phrases To navigate within this application, do not
in Web content only click the Back and Forward buttons.
Bold italic Glossary terms (if there is a The algorithm inserts the new key.
glossary)
Preface - 7
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Typographic Conventions (continued)
Typographic Conventions In Text (continued)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Convention Object or Term Example
Courier New, Code output, Code output: debug.seti (I,300);
case sensitive SQL and PL/SQL SQL code elements: Use the SELECT command to view
code elements, Java
information stored in the last_name column of the emp
code elements,
table.
directory names,
filenames, Java code elements: Java programming involves the
passwords, String and StringBuffer classes.
pathnames, URLs, Directory names: bin (DOS), $FMHOME (UNIX)
user input,
usernames Filenames: Locate the init.ora file.
Passwords: Use tiger as your password.
Pathnames: Open c:\my_docs\projects.
URLs: Go to http://www.oracle.com.
User input: Enter 300.
Usernames: Log on as scott.
Initial cap Graphics labels Customer address (but Oracle Payables)
(unless the term is a
proper noun)
Italic Emphasized words Do not save changes to the database.
and phrases in print For further information, see Oracle7 Server SQL
publications, titles of Language Reference Manual.
books and courses,
variables Enter user_id@us.oracle.com, where user_id is
the name of the user.
Plus signs Key combinations Press and hold these keys simultaneously:
[Control] + [Alt] + [Delete]
Quotation Lesson and chapter This subject is covered in Unit II, Lesson 3, Working with
marks titles in cross Objects.
references, interface
elements with long Select the Include a reusable module component and
names that have only click Finish.
initial caps
Use the WHERE clause of query property.
Preface - 8
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Typographic Conventions (continued)
Typographic Conventions in Navigation Paths
Oracle University Internal and TransAmerica Training Management Inc Partner use only
This course uses simplified navigation paths, such as the following example, to direct you
through Oracle Applications.
Example:
Invoice Batch Summary
(N) Invoice > Entry > Invoice Batches Summary (M) Query > Find (B) Approve
This simplified path translates to the following:
1. (N) From the Navigator window, select Invoice > Entry > Invoice Batches Summary.
2. (M) From the menu, select Query > Find.
3. (B) Click the Approve button.
Notation:
(N) = Navigator (I) = Icon
(M) = Menu (H) = Hyperlink
(T) = Tab (B) = Button
Preface - 9
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Introduction
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Course Objectives
Course Objectives
This course enables you to design and build a variety of standard and custom Web and
paper reports using Oracle Reports Developer. You learn how to retrieve, display, and
format data from any data source in numerous reporting styles and publish the output to
any destination.
During the course, you learn how to add dynamic content to a static Web page and publish
reports to the Web. You also learn how to customize more complex reports, embed
graphical charts, and use OracleAS Reports Services to deploy your reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Course Content
Day 1:
Introducing Oracle Reports Developer
Designing and running reports
Working in Oracle Reports Builder
Creating and modifying paper reports using the
Wizard
Enhancing a paper report in the Paper Design view
Day 2:
Managing templates
Creating a Web report
Enhancing report structure
Course Content
The lesson titles show the topics covered in this course and the usual sequence of lessons.
However, the daily schedule is an estimate, and may vary for each individual class.
Day 1
Course Introduction
Introduction to Oracle Reports Developer
Designing and Running Reports
Working in Oracle Reports Developer
Creating a Paper Report
Enhancing a Basic Paper Report
Day 2
Managing Report Templates
Creating a Web Report
Enhancing Reports Using the Data Model: Queries and Groups
Enhancing Reports Using the Data Model: Data Sources
Enhancing Reports Using the Data Model: Creating Columns
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Course Content
Day 3:
Using the paper layout
Modifying properties
Using Web reporting
Extending functionality using XML
Day 4:
Customizing reports with parameters
Embedding graphs
Enhancing matrix reports
Adding PL/SQL code
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Course Content
Day 5:
Extending functionality using the SRW package
Using OracleAS Reports Services
Efficiency and performance guidelines
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Introduction to Oracle Reports Developer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
Oracle Reports Developer is a powerful enterprise reporting tool that allows developers to
rapidly develop and deploy sophisticated high quality reports from any data source, in any
format, to any destination.
This lesson identifies the key features and benefits of Oracle Reports Developer and its
relationship with Oracles end-to-end business intelligence solution.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Business Intelligence
Discoverer Server Reports Server
XML
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
What Is Business Intelligence? (continued)
Oracles set of integrated BI tools allow you to seamlessly move between the roles of
Oracle University Internal and TransAmerica Training Management Inc Partner use only
information consumer and information investigator:
Oracle Warehouse Builder (OWB) is designed to consolidate disparate data sources,
performs any required data transformations, manage warehouse lifecycle, and
integrate with analysis tools.
OracleAS Discoverer, the powerful ad hoc query and analysis tool, can be unleashed
to reveal potential opportunities and risks associated with your products, customers,
and marketplace.
Oracle Reports, the high-fidelity enterprise reporting tool, enables businesses to give
immediate access to information to all levels within and outside of the organization in
a scalable and secure environment. Oracle Reports is the solution for Web and paper
publishing, enabling you to publish any data, in any format, anywhere. Oracle Reports
delivers high-quality information to users with only an Internet browser in open
Internet document standards. Authentication is handled through single sign-on, and
scalability is guaranteed through OracleAS Reports Services.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enterprise Reporting
Enterprise Reporting
For as long as there has been electronic data storage, there has been reporting. In the
mainframe computing era a one-report-fits-all metaphor was used. Reports were
expensive to develop and were typically generated in overnight batch jobs. With the
advent of the personal computer and its rich graphical user interface and fourth generation
languages, reports were easier to produce. Report developers could now write reports
tailored to the needs of particular information consumers. Most companies however
shifted from a one-fits-all model to a paradigm of one-report-fits-one. Reports were
stored on an individual PC, or at best shared across small work groups. Enterprise
reporting grew out of a business need for better, faster, and more flexible delivery of
individually tailored information to a very large number of users. No environment is
better suited to fulfill this than the Internet.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Enterprise Reporting (continued)
Enterprise reporting offers a number of important benefits. These include:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Widening the reach of information access:
The ability to provide information electronically to a large and often geographically
distributed user base, in a timely manner, picking up live data on-demand, means that
everybody is kept informed at all times.
Lowering the cost of computing:
Costs are minimized through a centrally managed architecture. This approach takes
the labor out of the computing infrastructure, and lowers the maintenance needs and
associated costs.
Allowing for extensible business intelligence:
Reporting is the delivery of information. Delivery alone however is not enough. If, for
example, a possible trend is identified, such as a drop or rise in sales, you must find
out why and be able to move seamlessly from mere consumer to investigator.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enterprise Reporting
Reporting
Ad hoc query
Advanced
Web Client analysis
Data Server
Application Server
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Enterprise Reporting (continued)
Reduced time to market:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In Internet-based environments, information consumers have a low tolerance for
delays in information delivery. The key to reducing development time is to take the
hard labor out of report development. Oracle Reports does not require the report
developer to write numerous lines of code or manually format complex layout
structures. The entire development environment is wizard driven and Oracle Reports
Developer generates the code automatically, making this an extremely productive
development environment.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Web Publishing
GIF89a
hyperlinks
JavaScript
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Paper Publishing
8.5
GIF89a
hyperlinks
11
JavaScript
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Reports Developer
JDBC
OLAP
XML
TEXT
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Benefits
Benefits
Oracle Reports enables you to publish data from any source in any format with high
fidelity.
In addition to SQL, PL/SQL, and Express, you can publish data from Java Database
Connectivity (JDBC) sources, XML, text files, or your own data sources that you have
defined. Report output can go anywhere you wish: the Web, e-mail, the printer,
wireless devices, and so forth.
Develop your report once, deploy it anywhere.
- Output formats include HTML, HTMLCSS, XML, PDF, Postscript, RTF,
delimited, character, etc.
- The Web layout is optimized for HTML.
- The paper layout is designed for PDF and Postscript.
- Share a single data model among all output formats.
- Customize the appearance and content of your output at runtime by applying XML
customization files.
Oracle Reports uses a standards-based, modular architecture.
- Use the Reports Java APIs to define your own plug-ins for data sources, output
destinations, security infrastructure, cache management, engines, and so on.
- Take advantage of the industry standards used in Oracle Reports: JavaServer
Pages (JSPs), servlets, JavaBeans, CORBA, and IIOP information protocol.
- Flexible design fits any middle-tier configuration.
Oracle Reports Developer 10g: Build Reports 1-12
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle 10g Products
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Database 10g
Documents
Multimedia
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Developer Suite 10g
Application Development
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle Developer Suite 10g (continued)
For application development, Oracle Developer Suite 10g provides capabilities in:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modeling: Oracle Designer 10g delivers dramatic increases in productivity for
database application developers. Oracle Designer provides a complete toolset to
model, design, generate, and capture the enterprise application requirements.
Rapid Application Development (RAD): RAD capabilities in Oracle Developer
Suite feature integrated builders, reentrant wizards, live previewers, and property
inspectors.
Oracle JDeveloper is an integrated development environment with end-to-end support
for modeling, developing, debugging, optimizing, and deploying Java applications and
Web services. Oracle JDeveloper 10g introduces a new approach to J2EE
development with features that enable visual and declarative development. The
innovative Oracle Application Development Framework simplifies J2EE
development. Oracle Jdevelopers productivity with choice offers a choice of:
development approach, technology scope, and deployment platform.
J2EE and Web Services: Oracle Developer Suite supports the latest J2EE application
programming interfaces (APIs) including Enterprise Java Beans (EJB), JavaServer
Pages (JSP), and servlets. Web services support Simple Object Access Protocol
(SOAP), Web Service Definition Language (WSDL), and Universal Description,
Discovery, and Integration (UDDI).
Team Support: Oracle Software Configuration Management provides versioning,
dependency management, and impact analysis for all objects and file types.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Developer Suite 10g
Business Intelligence
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Application Server 10g
Oracle DB
Browser Non-Oracle
Packaged
Wireless Apps
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle Application Server 10g (continued)
Business Logic Services: Oracle Application Server provides several ways to develop
Oracle University Internal and TransAmerica Training Management Inc Partner use only
business logic, utilizing both Java development approaches and high level, model-
driven techniques. These approaches include Java 2 Platform Enterprise Edition
(J2EE), Enterprise JavaBeans (EJB), and Oracle Business Components for Java
(BC4J), as well as rich GUI oriented approaches such as Oracle Forms Developer and
Oracle Reports Developer.
Data Management Services: To reduce the load on the database instance and to
avoid network roundtrips for read-only data, Oracle Application Server includes
Oracle Application Server Web Cache.
System Services: To provide system management and security services, Oracle
Application Server includes Oracle Enterprise Manager and Oracle Advanced
Security. These system services provide a comprehensive management framework for
your entire Oracle environment and network security using Secure Sockets Layer
(SSL)-based encryption and authentication facilities.
Technical Note
For more information on Oracle Application Server, refer to the Oracle Technology
Network: http://otn.oracle.com.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Reports Developer
User-friendly wizards
Pluggable data sources
Customizable report templates
WYSIWYG live editor for paper reports
Dynamic Web publishing using JSP/HTML
Run-time customization
Dynamic SQL execution
Portal integration
Event-based reporting
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
What Is Oracle Reports Developer? (continued)
Web publishing tools that dynamically generate Web pages based on your data
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Standard report output formats such as HTML, HTMLCSS, XML, PDF, PCL (Printer
Control Language), Postscript, and ASCII
The ability to apply run-time customization
The ability to execute dynamic SQL statements within PL/SQL procedures
Support for Oracle objects
Seamless integration of Oracle Reports with OracleAS Portal for administering report
security
The ability to publish report output to portlets
Report execution based on database events
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
OracleAS Reports Services
Flexible reporting
Reduced overhead
Fast distribution
Real time publishing
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
OracleAS Reports Services Architecture
for the Web
HTTP
CORBA/IIOP CORBA/IIOP
Reports
OracleAS
Engine
Reports Services
PDS
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
OracleAS Reports Services Architecture (continued)
The major components of OracleAS Reports Services include:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
OracleAS HTTP Server: This is the Web server. It incorporates an OpenSSL module
to provide support for Secure Socket Layers (SSL) and HTTP Secure Sockets Layer
(HTTPS). It also provides a servlet engine to support the running of Java servlet
applications.
Reports Servlet and JSP: These components process custom (JSP) report tags and
deliver information between the HTTP Server and the Reports Server.
Reports Server: The Reports Server processes client requests, including user
authentication, scheduling, caching, and report distribution.
Reports Engine: The Reports Engine fetches data from the data source, formats the
report, send output to cache, and notifies the Reports Server that the job is ready.
Reports Cache: The Reports Cache stores completed jobs.
Note: OracleAS Reports Services and report deployment will be covered in more detail in
a later lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
A business intelligence solution provides a set of integrated tools that enable you to
move seamlessly between the roles of information consumer and information
investigator.
Enterprise reporting grew out of a business need for better, faster, and more flexible
delivery of individually tailored information to a very large number of users. The
conduit of choice is the Internet.
Effective publishing requires an understanding of the features and limitations of the
different medium. Reports need to be designed for the specific output medium. Web
publishing and paper publishing differ.
Oracle Reports Developer enables you to create and deploy reports using any data, in
any format, for any medium.
The Oracle 10g products provide the infrastructure to easily develop, deploy, and
manage Internet applications and Web sites. Oracle Reports Developer is a component
of the Oracle Developer Suite. Reports created with Oracle Reports are deployed by
Oracle Application Server, specifically OracleAS Reports Services.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Designing and Running Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
Your reports need to satisfy the requirements of your business. To help you begin the
process of translating report requirements into Reports Developer solutions, you need to
understand the users needs, the potential range of report styles, the distribution and
output requirements, and gain an appreciation of the underlying report structure. This
helps you to make the right decision about which style to use for the report.
This lesson discusses understanding the user requirements, standard report design styles,
and describes options to execute reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Understanding User Requirements
Web or Charts
Paper Drill down
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Understanding User Requirements (continued)
Helpful questions to help you determine the user requirements:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
What data will people want, and in what priority?
How is the data stored?
Is there a corporate standard that must be met? If so, define standard templates.
Will users want Web reports, paper reports, or both?
For Web reports, will the reports be static or dynamic?
Will users want charts in the report? If so, what data will be used in the graph?
Will users want to drill down on data? If so, plan on using hyperlinks.
Will users want to specify input parameters? If so, you need to create the necessary
parameters and establish the validation rules.
Will users want a report to be embedded in a form? If so, you will have to call the
report from a form and have the form pass the data to the report.
Will the same report serve different types of users? If so, you need to think about
report sectioning and report distribution.
Are there any administration or security issues? If so, you need to set up the necessary
specifications in the OracleAS Portal Reports Security option.
Will the users want run-time customizations? If so, plan on using XML files.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Designing Reports
Specification
Data retrieval
Common features
Structure
Style
Publishing
Medium
Designing Reports
Before you create a report using any report-writing software, you must first consider the
type of report that you are being asked to produce. You will have a specification of the
needs, required output, and the expected publishing medium, but you also need to know
the underlying structure that supports the requirement and the most efficient way to
retrieve data.
Also, consider whether this is a one-time requirement, or whether this specification shares
common features with other reports, especially where multiple reports are required in the
same application.
There are a few standard styles of reports that form the majority of all reporting
requirements. This section teaches you to recognize the common styles in order to enable
you to interpret your report requirements and choose the correct style when developing
report definitions.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Designing Reports (continued)
The majority of report requirements fall into the following categories:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Tabular
Master-detail
Master and multiple details
Matrix
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Tabular
List of Products
Product
Number Description Price
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Master-Detail
Outstanding Customer Items
Customer Name
Product
Number Price
Customer Name
Product
Number Price
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Master with Two Details
Customer Statistics
Customer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Matrix
Customer Matrix
Product ID
Customer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Retrieving and Sharing Data
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Retrieving and Sharing Data (continued)
Report Structures
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The report style also affects the number of queries required. A master with multiple detail
groups requires an additional query for each extra sibling group. Matrix reports can
contain one or several queries.
The following table shows the number of queries you can use to create the reports in this
lesson.
Report Name Number of Queries
List of Products 1
Outstanding Customer Items 1 or 2
Customer Statistics 2 or 3
Customer Matrix 1, 2, or 3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running a Report
Your browser
OracleAS Portal application
Command line (Start > Run)
OracleAS Reports Queue Manager
Java application
Database trigger
Menu integrated with a Forms application
Button in a Forms application
Running a Report
There are many ways of running a report, depending on the application design. You can
call a report from:
A Web browser
An OracleAS Portal application
The command line, using the Start > Run option in Windows
The OracleAS Reports Queue Manager
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Running a Report (continued)
A Java application
Oracle University Internal and TransAmerica Training Management Inc Partner use only
A database trigger
A customized menu in a Forms application
A button in a Forms application
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Previewing Reports
Previewing Reports
In Reports Builder, there are a number of ways in which you can preview your report.
Run Web Layout
Reports Builder provides the option of previewing your Web report in a browser. Select
Program > Run Web Layout from the menu, or click the Run Web Layout iconic button
on the horizontal toolbar.
Run Paper Layout
To preview your paper report, select Program > Run Paper Layout from the menu, or click
the Run Paper Layout iconic button on the horizontal toolbar. Your output displays in the
Report Editor, which you will learn more about later in this course.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Print Preview
1
2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Print Preview
1 2 3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Previewing Reports (continued)
Zoom in and zoom out buttons are available on the toolbar. Select the large plus sign to
Oracle University Internal and TransAmerica Training Management Inc Partner use only
zoom in and the small minus sign to zoom out.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Supported File Types
RDF
REP
JSP
HTML
XML
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Supported File Types (continued)
Reports defintions RDF and REP are owned by Oracle Reports. In other words, you will
Oracle University Internal and TransAmerica Training Management Inc Partner use only
need to use Oracle Reports to modify the definiton of these reports. Report defintions JSP,
HTML, and XML are saved and can be retrieved in a textual format. This gives you the
flexibility to use third party text editors and HTML tools to modify the module definition.
Technical Note
Another file type REX is supported in Oracle Reports for backward compatibility. A REX
file contains a report definition in stored in text (e.g., ASCII or EBCDIC) format. A REX
file is not executable and cannot be directly modified in Reports Builder. You can convert
a .rex file to a .rdf by selecting Tools > File Conversion from the menu.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Designing Reports
Make sure you fully understand and document the user requirements, and then pick a
report style and structure that maps to the need.
By discussing the report styles and structures, you should now be able to:
Appreciate the principle of groups and frequencies of data
Describe simple report styles and their underlying structures
Realize the importance of database access and report performance, and consider this
for every report you design
Consider usage of common code and objects at the very early stages of development
Executing Reports
You have learned that there are a number of different ways to run a report, including a
Web browser, an OracleAS Portal application, and the command line. You can preview a
report in Reports Builder using the Run Web Layout, Run Paper Layout, and Print
Preview options.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 2 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 2
1. Invoke the Reports Builder executable.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
2. Open the report called p2q2.jsp. Run the Web layout.
a. Examine the report in your browser. Among the styles discussed in this lesson as
a reference, what style of report is it?
b. How many groups of data are there in this report?
c. In the browser, use the scroll bars to move up and down the report to see all of
the data.
d. Close the browser window. You are now back in Reports Builder.
3. Open report p2q3.rdf and run the paper layout.
a. In the Paper Design view, move to the next page. Notice that this report has a
header page with text.
b. What style of report is this?
c. Close the Paper Design view. From the File menu, select Print Preview. In the
Previewer window, experiment with the horizontal and vertical split screen
features.
d. Close the Previewer window.
4. Open report p2q4.jsp and run the Web layout.
a. What style of report is this?
b. How many groups of data are in this report?
c. How many pages are there in this report?
d. Close the browser.
5. Open report p2q5.jsp and run the Web layout.
a. What style of report is this?
b. How many groups of data are in this report?
c. Close the browser window.
6. Open report p2q6.rdf and run the paper layout.
a. Notice the Parameter Form. You are requested to enter a customer ID. The report
will display order information based on your input.
b. Specify a valid customer ID and run the report. Valid values include 101, 118,
148 and 170; pick one of these and then select Run Report.
c. What do you think would be a better method of providing valid values to a user?
d. Close the Paper Design view.
e. Run the paper layout again. This time do not specify a customer ID.
i. What is the result?
ii.In a production situation, what should happen in this instance?
f. Close the Paper Design view.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 2 (continued)
g. Run the paper layout again. This time enter Customer ID 999.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
i. What is the result?
ii. In a production situation, what should happen in this instance?
h. Close the Paper Design view.
7. Open report p2q7.rdf and run the paper layout.
a. In the Parameter Form, notice the list of values for the customer information. The
report displays order information based on your input.
b. Select a valid customer name and run the report.
c. Close the Paper Design view.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Working in Oracle Reports Developer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
This lesson describes the Oracle Reports executables and gives an overview of Reports
Builder, including a high-level description of its components and object hierarchy.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Reports Developer Executables
Developer
Reports Builder Reports Runtime Reports Converter
rwbuilder rwrun rwconverter
Reports Services
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Reports Developer Executables (continued)
The main Reports Developer executables are:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
NT Filename Executable Title Description
Technical Note
A servlet is a Java application that runs in a Web server or application server and provides
server-side processing, typically to access a database or perform e-commerce processing.
Servlets provide an alternative to CGI (Common Gateway Interface) scripts. Because they
are written in Java, servlets are portable between servers and operating systems. Servlets
are also more efficient than CGI scripts as they can remain running inside the servlet
engine of the Web listener, waiting for new requests, instead of being shut down once a
request is processed, and then restarted when a new request is issued.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Invoking Reports Builder
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Reports Builder Modules
Reports Builder
The Reports Builder interface enables you to create a number of different types of
modules, and it provides a Report Editor in which you can view the structure and objects
in a report module.
The Reports Builder module types are:
Module Type Description
Report A report definition
Template A skeleton definition containing common style and standards; can
include graphics; provides a standard format to enable quick and easy
development of professional standard look-and-feel reports
PL/SQL A stand-alone library containing PL/SQL program unitsprocedures,
Library functions, packagesthat can be called from multiple reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report Data and Layout
Paper
Web
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Reports Builder Components
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Reports Builder Components (continued)
Property Inspector
Oracle University Internal and TransAmerica Training Management Inc Partner use only
All objects in a module, including the module itself, have properties that you can see and
modify in the Property Inspector. Features include:
Expandable and collapsible nodes
In-place property editing
Search features
Multiple selection of objects
Complex property dialogs
Ability to invoke multiple instances of the Property Inspector
PL/SQL Editor
The PL/SQL Editor enables you to create and compile program units such as procedures,
functions, and packages within the current report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Main Menu Structure
Feature Description
Underline Shortcut key: [Alt]+letter
Ellipsis (...) Additional input, usually by dialog box
> Menu option has a submenu
Windows menu List of open windows; choose any window to make it active
Help List of Help facilities, such as online Help text and Quick Tour
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Navigating Around the Oracle Reports Main Menu (continued)
The main menu options in Reports Builder are:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Menu Item Description
File Common file utilities, such as open, save, connect, administration
Edit Cut, copy, paste, other editing functions; session preferences
View Switch view in current window; options vary greatly depending on
context
Insert Add dynamic data to a static HTML page; add fields and layout objects to
paper reports
Format Change the style and appearance of objects in the Paper Layout view
Layout Arrange and reshape objects in the Paper Layout view
Program Includes compilation, run options for Web and paper, and the Java
Importer
Tools Includes wizards and access to PL/SQL editors
Note: Some menu items are selectable depending on the current context. For example, the
items in the Layout menu are selectable only when the context is the Paper Layout view.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Wizards
Report Wizard
Data Wizard
Graph Wizard
Report Block Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report Editor
Data Model
Web Source
Paper Layout
Paper Design
Paper Parameter Form
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
The Report Editor (continued)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
View Description
Paper Displays output for paper reports and allows you to make many
Design commonly required, simple modifications to the layout, such as
spacing, formatting fields, color, and editing text, without having to open
the Paper Layout view.
Paper Displays the layout of the Paper Parameter Form that, at run time, allows
Parameter user input of parameter values.
Form
You can create many fully functional paper reports simply by using the Wizard and
modifying the report in the Paper Design view. However, this course also teaches you in
later lessons how to use the Data Model, Paper Layout, and Paper Parameter Form so that
you can create more complex paper reports. You will also learn how to use the Web
Source view to add dynamic content to HTML pages to create reports for Web publishing.
Technical Note
Oracle Reports is integrated with Oracle JDeveloper to enable Java developers to leverage
the powerful publishing capabilities of Oracle Reports within their Java applications. You
can create a new JSP-based Web report or a Pluggable Destination from within Oracle
JDeveloper. You can also debug a Reports JSP from within JDeveloper. For more
information, see the Oracle Technology Network (http://otn.oracle.com).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
PL/SQL Development Environment:
Syntax Palette
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Object Navigator
Object Categories
The Report Module consists of many objects that fall into the following four categories:
Report level
Data Model
Paper Layout
Paper Parameter Form
The hierarchy of object categories can be viewed in the Object Navigator.
This section gives an overview of the objects in each category.
Note: All the objects mentioned in this section are discussed in greater detail in later
lessons.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report-Level Objects
Properties
Triggers
PL/SQL Program Units
Attached Libraries
Object Description
Properties Define page dimensions and Previewer settings, for example
Triggers Allow PL/SQL to be executed at different stages of the report
execution
PL/SQL Program Contain functions and procedures that can be called from
Units report-level objects in the same report
Attached Libraries External PL/SQL library file that contains sets of PL/SQL
program units that are independent of a report definition
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Data Model Objects
Parameters
Queries
Groups
Columns
Data Links
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Paper Layout Objects
Frames
Repeating frames
Fields
Boilerplate
These and other layout objects are discussed later in the course.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Paper Parameter Form Objects
Fields
Boilerplate
Object Description
Field Contains parameter values
Boilerplate Contains constant text or graphics that appear on the run-
time paper parameter form
Note: The Paper Parameter Form controls the layout of the run-time paper parameter
form. The objects are similar to paper layout objects. The source of a parameter field
comes from a parameter that is a Data Model object. Parameters appear in the Object
Navigator, not in the Data Model view.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Object Interrelationship
1
Select
...
2
3
1 Each query fetches data records and structures them in the group hierarchy.
2 Each group is the source of a repeating frame.
3 Each column is a source of a field.
Object Interrelationship
Now that you know the different categories of objects, it is also important to understand
the relationship between these objects. The diagram above shows the relationships
between some of the most common objects, explained in terms of a simple tabular report.
Data Model Objects
A query fetches records from the data source.
Each fetched record becomes an instance of the related group.
Each data source value is fetched into the related column.
Paper Layout Objects
A column provides the value that is displayed in one or more layout fields.
A field must display all instances of its related column value; therefore, each record
instance of a group is represented by a repeating frame.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Your Oracle Reports
Developer Session
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Saving Preferences
1 2
Saving Preferences
There are four tab pages in the Reports Preferences dialog box. Press the Help key ([F1]
in Windows) in the Preferences dialog box to see a description of each preference.
As well as session preferences, Reports Builder preferences enable you to set run-time
options when running your report within the builder.
The following table describes a few example preferences. Others are introduced when
applicable throughout the course.
Tab Preference Name Description
General Suppress Report Do not display the Report Editor when opening a
Editor on Open report. This saves you time when opening several
reports to make changes in the Object Navigator.
Unit of Set the unit of measurement that you want to use for
Measurement new reports that you create. Altering this setting
does not affect existing report definitions.
Wizards Welcome Dialog Check box to suppress or display the first Welcome
dialog box. There are several similar check boxes.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Reports Environment Variables
REPORTS_PATH
REPORTS_TMP
REPORTS_RESOURCE
ORACLE_PATH
REPORTS_CLASSPATH
Windows: Modify in Registry
Variable Description
REPORTS_PATH A path that Reports searches for files at run time
REPORTS_TMP A path that will be used to create temporary files
REPORTS_RESOURCE A path that contains the location of the Reports
resource files, such as icon files
REPORTS_CLASSPATH A path that Reports searches to locate Java objects
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle Reports Environment Variables (continued)
Generic Oracle Path
Oracle University Internal and TransAmerica Training Management Inc Partner use only
ORACLE_PATH is an additional path that all Oracle Developer Suite components search
if they cannot find a file in their own specific path.
Modifying Environment Variables
In a Windows 32-bit environment, use the Windows Registry to modify these paths.
Registry path: HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using the Online Help System
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Technical Note
In Oracle Reports Builder Developer 10g, the Quick Tour option in the Help menu that
Oracle University Internal and TransAmerica Training Management Inc Partner use only
was available in earlier releases such as Oracle Reports Builder 9.0.2.0.1, has been
changed to Getting Started.
The Oracle Reports online Help system is also accessible through the Oracle Technology
Network (http://otn.oracle.com).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Oracle Reports Developer provides a number of executables for developing and deploying
reports, including Reports Builder.
The Reports Builder interface allows you to develop three types of modules, including
report definitions.
Reports Builder provides a Report Editor in which you can view and modify the objects
that the wizard creates. You can also create your own objects to enhance your report
structure and layout.
The Report Editor enables you to switch views, depending on the objects that you want to
modify. For Web reports, use the Web Source view.
Objects in a Report module fall into four categories: Report, Data Model, Paper Layout,
and Paper Parameter Form.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 3 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 3
1. Start Reports Builder and open the existing report: p3q1.jsp. Run the paper layout.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
2. Using the same report, display the Data Model view of the Report Editor.
In the Object Navigator, select Q_1.
Hint: Move the Data Model window to the right so that you can also see the Object
Navigator. Use the Find field at the top of the Object Navigator to locate Q_1.
Notice the object that is selected in the Data Model view.
3. Using the same report, switch to the Paper Layout view of the Report Editor.
In the Object Navigator, select F_CUSTOMER_ID.
Hint: Use the Find field at the top of the Object Navigator.
Notice the object that is selected in the Paper Layout view.
Fully expand the Paper Layout node and select R_G_ORD_ID.
Notice the object that is selected in the Paper Layout view.
4. Using the same report, run the Web layout.
5. Use Help Contents to answer the following questions:
a. What is RWSERVLET?
b. What is RWCLIENT?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Paper Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
In this lesson, you learn how to create a simple tabular paper report and modify the report
by adding data and altering the report style. This lesson covers how to create other styles
of reports that are available from the Report Wizard. You will also learn how to preview a
paper report on the Web.
Oracle Reports enables you to easily model, design, and publish high fidelity Web reports.
You will learn about this in a later lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report Module Components
Data Model
Web Source
Paper Layout
Paper Parameter Form
Program Units
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Building a Paper Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Invoking the Report Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Choosing the Layout Type
Wizard Pages
Report Style
Data Source
Type
Data Source
Definition
Fields
Totals
Labels
Template
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Tabular Report
Wizard Pages
Report Style
Data Source
Type
Data Source
Definition
Fields
Totals
Labels
Template
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Tabular Report Using the Wizard (continued)
Wizard Pages
Oracle University Internal and TransAmerica Training Management Inc Partner use only
When you choose the Tabular style of report, the Wizard takes you through the following
pages.
Page Name Description
Data Source Select the data source type on which you want to base your
Type report.
Data Source Define the data you want to retrieve for your report.
Definition
Fields Select the fields that you want to display in the output.
Totals Select the fields that you want to summarize.
Labels Alter the labels that appear for each field and the width of each
field.
Template Select the template that you want to use for this paper report. A
template contains formatting information and can also contain
standard information such as company logo, date, and so on.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Selecting the Data Source Type
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Query Builder
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Building a Query
Building a Query
To build a query using Query Builder:
1. Select Query Builder from the Query page in the Report Wizard.
2. Enter your username, password, and alias in the Connect dialog box that appears if
you have not already connected to the database.
3. Select the data tables to build the query.
4. Click Include. The tables appear in the selection area.
5. Click Close to close the Select Data Tables window.
6. In each table, double-click the column names that you want in the query, or use the
check boxes. To select all columns, double-click the Table title bar.
7. Click OK.
Query Builder copies the query syntax into the Report Wizard. You can modify the query
by reentering Query Builder or by modifying the SQL query statement text.
Note: If you prefer to write your own SQL statement, enter the syntax directly in the SQL
query statement area of the Query page. Alternatively, you can import the contents of a
file by clicking Import SQL Query.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Query Builder Functions
1 2 3 4
1 Column sequence
2 Define column
3 Sort
4 Logical operators for conditions
5 Conditions box for WHERE and HAVING clauses
6 Object type (T=Table, V= View, S=Synonym, A=Alias)
Query Builder Functions
This course does not teach the detailed functionality of Query Builder. You can find
comprehensive help in the Reports Builder online Help.
You can use Query Builder to build almost any query that you can write as a SQL
SELECT statement.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Query Builder Functions (continued)
You can select from a table, view, or synonym. The letter T, V, or S appears in the object
Oracle University Internal and TransAmerica Training Management Inc Partner use only
title bar to indicate which it is. If you define the same table more than once, Query
Builder creates an alias (A).
The following is a brief description of some Query Builder toolbar buttons and functions.
Function Description
Column sequence Defines the sequence of column names in the SELECT clause
Define column Defines a new, derived, or calculated column to be included in the
SELECT clause; use this definition to calculate and retrieve
derived values from the server
Sort Defines the ORDER BY clause; select the columns that you want
to be sorted, and choose ascending or descending sorting order
WHERE and Place the cursor in the Conditions box on the left side of the Query
HAVING clauses Builder window. Type a condition. Use the AND, OR, and NOT
buttons to create compound conditions.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Selecting Displayed Fields
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Totals and Labels
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Selecting a Report Template
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Viewing the Paper Report Output
1 Magnify tool
2 Page buttons
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Saving the Report Definition
xxx.rdf yyy.rdf
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Reentering the Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating Other Report Styles (continued)
When you reenter the Report Wizard, you see a tab for each page. You can navigate
Oracle University Internal and TransAmerica Training Management Inc Partner use only
directly to the page you want to modify instead of clicking Next to move through each
page in turn.
Click Finish at any time to apply the changes.
Creating a Form Report
There are three significant features in the Form style that differ from the Tabular style.
Labels appear to the left of each field.
Each field appears to the right of the previous field, across the page.
Each record appears on a new page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a New Report
2 1
1 Reports node
2 Create object button
Creating a New Report
To create a new report with the Wizard when you are already in Reports Builder:
1. Select the Reports node in the Object Navigator.
2. Select the green plus sign in the vertical toolbar.
3. Select the Use the Report Wizard check box.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Break Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Break Report Labels
Group Left
Group Above
Location Id xxxx
Department Name xxxxxx
Last Name Job Id
xxxx xxxxx
xxxxxxx xxxx
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Mailing Labels and Letters
Wizard pages:
Style
Data
Text
Template
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating Mailing Labels and Letters (continued)
You can type directly into the text area instead of selecting from the Available Fields list.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
However, remember to prefix each field name (variable) with an ampersand.
Any word that you type without an ampersand appears as a text string in your mailing
label output. For example:
The optional angled brackets allow you to display two variables side by side with no
separating space.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Matrix Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Matrix Report (continued)
Creating a Matrix for Each Group Record
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Select the Matrix with Group report style. This provides a similar group structure to the
Group Above report.
In your Regional report, you can select CITY in the Group page so that the Wizard
structures the Department/Job_ID matrix for each record.
The differences from a nested matrix are:
Only the relevant Departments and Job_IDs are displayed for each city.
If you create summaries for a Matrix with Group style, the Wizard calculates and
displays summaries for each group as well as the report total. The report total is
displayed at the end of the report, in the bottom left corner.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Previewing a Paper Report in a Browser
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Previewing a Paper Report in a Browser
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Report Styles
There are eight common styles of report that you can create by using the Report Wizard.
The Wizard steps you through a variety of pages, depending on your chosen report style.
Query Builder
The built-in Query Builder provides a user-friendly graphical interface for you to build the
SQL queries to retrieve your report data. Alternatively, you can write the SQL statement
yourself, or import the contents of a file.
Predefined Templates
Predefined templates offer standard fonts, colors, formats, and images that enable you to
create many reports with a professional appearance and a standard look and feel very
quickly and easily.
Reentrant Wizard
The Report Wizard is reenterable; it retains all your previous settings, and enables you to
modify any settings by selecting the relevant tabbed page.
Paper Reports on the Web
While Oracle Reports does offer the solution for creating true Web reports, you are able to
publish a paper report on the Web.
Oracle Reports Developer 10g: Build Reports 4-30
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 4 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 4
1. Create a tabular report, paper layout only, containing the following data. Use Query
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Builder to build the query.
DEPARTMENTS: DEPARTMENT_NAME
EMPLOYEES: FIRST_NAME, LAST_NAME, JOB_ID, SALARY
2. Using the reentrant Report Wizard, make the following modifications.
a. Modify the query to sort the data in descending order of salary.
b. Add a summary to show the total salary value.
c. Ensure the width of SALARY and TOTAL is 6.
d. Select the Green template.
e. Save the report to a file named p4q2.rdf.
3. Using the reentrant Wizard, modify the report to create a break report.
a. Select the report style Group Above.
b. Modify the query and remove the join clause so that the report contains all
employees and not just managers.
c. Group the report by the department name.
d. Save the report as p4q3.rdf.
4. Create a new report as follows:
a. Using the Report Wizard, create a paper layout and select the Mailing Label
style.
b. Enter the query in the data source definition window:
select c.cust_first_name || c.cust_last_name Name,
c.cust_address
from customers c
This query text is available in the file p4q4.sql.
c. In the text area, include each of the following fields on a new line: NAME,
STREET_ADDRESS, CITY, and STATE_PROVINCE. Include
COUNTRY_ID, and POSTAL_CODE on the same line.
d. Select No template and click Finish.
e. Save the report to a file named p4q4.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 4 (continued)
5. Using the reentrant Wizard, modify the report to create a Form Letter style.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Modify the query to include order information for each customer:
select c.cust_first_name || c.cust_last_name Name,
c.cust_address, o.order_id, o.order_total
from customers c, orders o
where c.customer_id = o.customer_id
This query text is available in the file p4q5.sql.
b. In the text area, enter some free-flowing text for each order. For example:
Order No. &<ORDER_ID> has been shipped to &<NAME> in &<C_CITY>.
The order has a total value of &<ORDER_TOTAL> dollars.
Thank you for your business.
c. Select a different template and click Finish.
d. Save the report as p4q5.rdf.
6. Create a new report.
a. Create both a Web and paper layout. Select the matrix report style.
b. For the query, import the contents of p4q6.sql.
c. Display customer names down the left side of the page.
d. Display product numbers across the top of the page.
e. Display the sum of the total values in the cells.
f. Create a summary to give the total of the sum(total_value) values.
g. Change the width of all four summaries to 4. Change the PRODUCT_ID label to
Product. Remove the label for SumTOTAL_VALUE.
h. Select any template and click Finish to preview your report.
i. Save the report to a file named p4q6.jsp.
7. Modify the matrix report to create a Matrix with Group.
a. Select Month as the group and check that all totals have a width of 7.
b. Click Finish to preview your report and save the report as p4q7.jsp.
Note: The query for the matrix reports above has been restricted to display only products
beginning with 1, so that you can see and understand the complete matrix more easily.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 4 (continued)
8. Web-enable a paper report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Open report p2q9.rdf and run the paper layout.
b. Add a bookmark to the report, letting the department names serve as bookmarks.
c. Generate HTML Style Sheet output. Save the file as p4q8.htm..
d. Open the report in a browser.
e. What happens when you click on the bookmarks?
f. Close the browser and in Reports Builder, save the report as p4q8.rdf.
g. Save and close all reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enhancing a Basic Paper Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
In this lesson, you learn to enhance your paper reports with the most commonly required
changes, while viewing the live run-time output in the Paper Design view in Reports
Builder.
You will learn how to enhance your Web reports is a later lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
What Is the Paper Design?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Paper Design Window
1
1 Toolbar
2 Stylebar
3 Tool palette
4 Status bar
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying a Report
Common modifications:
Align columns
Set format masks
Manipulate objects
Edit text
Modify visual attributes
Highlight data using conditional formats
Insert page numbers and current date
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Aligning Columns
Aligning Columns
In the sample report output, in the left panel, the salary values are aligned to the left. You
often need to align numbers to the right.
1. Select the column that you want to align.
2. Select the align right icon on the stylebar.
You can align each object separately, so that you can center the labels if you want.
However, if you want to align the values and the labels to the right, use [Shift]-click to
select more than one object at a time.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Setting a Format Mask
1 2 3 4 5
1 Currency symbol
2 Percentage symbol
3 Thousand separator
4 Add decimal places
5 Remove decimal places
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Setting a Format Mask (continued)
To alter a numeric format:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Select the numeric field to which you want to apply a format mask.
2. Select the corresponding format mask button on the stylebar.
The format mask is applied.
Note: Reports Developer applies the format mask only to fields whose datatype is
NUMBER. Also, the currency and percentage format masks are mutually exclusive: only
one or the other can be applied to a numeric field, never both.
NLS Support for Format Masks
The stylebar always shows $ for the currency button, ,0 for thousands, and .0 for
decimal places, but the output currency symbols are language-specific and can differ at
run time.
If you use National Language Support (NLS) the symbols that appear in the report output
depend on the value of the territory portion of the NLS_LANG parameter.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Manipulating Objects
Clear fields
Move fields
Resize fields
Manipulating Objects
You can alter the position of objects, such as fields and labels, by selecting the object you
want to move and dragging it to a new position.
Alter the size of an object by selecting one of the square handles and dragging to the
required size, either smaller or larger.
Flex Mode: When you move or resize an object, the rest of the report adjusts as
necessary. This is controlled by the Flex Mode option, which is a button in the stylebar.
Flex Mode is enabled by default, so that all report objects flex, or adjust, to make room for
your modifications.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying Visual Attributes
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Modifying Visual Attributes (continued)
To modify color fills and lines:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Select the object that you want to modify.
2. Use the color palettes in the toolbar to change the fill, line, or text color.
The stylebar includes a Parent Frame tool you can use to select the outer object
surrounding the currently selected object.
To color the area surrounding all the labels, select one label, click Parent Frame, and then
select the color and pattern you require from the first color palette.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Applying Conditional Formatting
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Applying Conditional Formatting (continued)
Formatting is applied in the order that the format exceptions are listed; a format exception
Oracle University Internal and TransAmerica Training Management Inc Partner use only
overrides a previous format exception if both evaluate to TRUE.
To change the order of format exceptions in the Format Exceptions list:
1. You can select a format exception and click the Up or Down buttons to move it up
or down.
2. You can drag and drop the format exception item to the required position in the
Format Exception list.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Inserting Page Numbers, Dates,
and Times
Inserted easily
Customizable extensions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Inserting Page Numbers, Dates, and Times (continued)
The Insert Date and Time dialog box displays the current date in many different formats.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
You simply choose the style that you want. The underlying format mask is composed of
tokens representing each element.
The list of formats depends on the entries in your preferences file. To modify the
preferences list, select Edit > Preferences > Edit Masks.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Dates
Customizing Dates
If the mask that you want does not exist, and you do not want to add it to your
preferences, select Custom. This dialog box provides a read-only list of tokens available
for you to build your own style, if you understand the Oracle format tokens.
Note: The Date and Time Format Mask Syntax topic in the Help system fully describes
the format mask syntax.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Features of the Paper Design View
The Paper Design view is a WYSIWYG editor that enables you to enhance your report
output using the live data. You can manipulate objects and edit text content. You can also
alter the font, colors, and patterns of individual objects.
The format mask buttons provide quick and easy currency formatting. The Insert menu
enables you to add page numbering and the current date, using predefined formats or
customizing your own.
Saving Changes
Remember to save your report definition often during editing in order to preserve the
changes you make in the Paper Design view.
When you save the report, all changes become part of your report definition and always
appear at run time.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 5 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 5
1. Open report p4q2.rdf. Make the following changes in the Paper Design view:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Make the SALARY column right-justified. Do not forget to justify the column
header accordingly.
b. Add a comma and a currency symbol to SALARY. Add two decimal places.
c. Make the total at the end of the report right-justified and add commas, a
currency symbol, and two decimal places, as in the column SALARY.
d. Change the label of the total to italic font.
e. Make whatever other changes you like.
f. Save the report to a file named p5q1.rdf and close it.
2. Open report p4q3.rdf. Make the following changes in the Paper Design:
a. Add a border with a hairline width around the total for each department.
b. Add commas and two decimal places to the SALARY field and the total and
make them right-justified. Do not forget to justify the column header for the
SALARY field accordingly.
c. Make the same changes to the total at the end of the report. Move the grand total
so that it aligns with the SALARY field (you must do this manually; use the
ruler guides to help you).
d. Change the text color of the employee data heading to blue.
e. Make whatever other changes you like.
f. Save the report to a file named p5q2.rdf and close it.
3. Open report p5q3_a.rdf. Make the following changes in the Paper Design:
a. Add a date at the top center of the page. Give it any format you want.
b. Make whatever other changes you like.
c. Save the report to a file named p5q3.rdf and close it.
4. Open report p4q6.jsp. Make the following changes in the Paper Design:
a. Right-justify the Product ID field.
b. Add commas and two decimal places to the cells and summaries and make them
right-justified.
c. Why are some of the cell and summary values displayed with asterisks? What
can you do to correct this?
d. Add a blue line color to the parent frame of NAME.
e. Save the report to a file named p5q4.jsp and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 5 (continued)
If You Have Time
Oracle University Internal and TransAmerica Training Management Inc Partner use only
5. Open the file p5q2.rdf and conditionally highlight the SALARY field.
a. If the salary is less than 8500, print the field in italics.
b. If the salary is more than 12000, print the field in bold italics and make the text
color red.
c. Save the report to a file named p5q5.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Managing Report Templates
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
In this lesson, you learn how to open and modify predefined Oracle Reports paper
templates and how to register a customized template in the predefined template list.
Technical Note
This lesson focuses on creating and modifying paper layout templates. For information on
creating a Web layout template, refer to Appendix C.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Report Templates
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying a Template
Margin Body
Modifying a Template
A report template is not the same as a report definition. A template is divided into regions,
which the Report Wizard references while creating the paper report definition.
The Template Editor enables you to modify existing objects in the margin and body
regions of the template. You can also customize or add other reports objects: parameters,
report-level triggers, program units, and attached PL/SQL libraries.
Region Description
Body Contains default section to apply changes to all report styles, and
override sections to apply individual changes to different report
styles
Margin Defines objects that appear in the margin of all pages
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Modifying a Template (continued)
Modify template objects in the Template Editor or in the Object Navigator.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Template Editor is similar to the Paper Layout view of the Report Editor. You can
create, delete, and modify objects (such as page numbers, text, and graphics) in the
margin area. In the body area, you can modify the properties of body objects.
The Report Style drop-down list enables you to view the layout for a selected report style.
Default and Override Sections
Make general modifications to the default section. These modifications affect all report
styles. However, you can override attributes for one or more styles to provide a flexible
inheritance model.
Each report inherits attributes from the default section of the template unless there is an
override value. The override section overrides specific attributes for each style. There is
an inherit button in the Property Inspector to return to the default value.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing the Template Margin
Include
objects
such as:
Images
Text
Page
Numbers
Date
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Customizing the Template Body
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Copyright 2004, Oracle. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding Web Links to a Template for
Report HTML Output
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Adding Web Links to a Template for Report HTML Output (continued)
In most cases, you can define the Web links in the Property Inspector of the object. You
Oracle University Internal and TransAmerica Training Management Inc Partner use only
can specify column and field names in the link value to create dynamic links at run time.
For more complex Web links, such as conditional settings, use PL/SQL format triggers
and the SRW built-in packaged procedures.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Predefining Your Own Templates
Reports.Tabular_Template_File =
(rwbeige, Reports.Tabular_Template_Desc =
rwblue, ("Beige",
mytemp, "Blue",
rwgray, "My Template Description",
rwgreen, "Gray",
rwpeach, "Green",
"Peach",
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Predefining Your Own Templates (continued)
To register a customized template in the predefined list in the Wizard:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Open an existing template, modify the template objects as required, and save the
template as a .tdf file.
2. Move the template and the image file to the template directory:
<oracle_home>\reports\templates.
3. Add the template filename (excluding the suffix) to the entries in the Oracle Reports
preferences file, cagprefs.ora. Add the filename to each style of report for
which your template is applicable; for example:
Reports.Tabular_Template_File,
Reports.Matrix_Template_File.
4. Add a short template description to the relevant
Reports.xxx_Template_Desc entry in cagprefs.ora, making sure that
the description is listed in the same position as the relevant file. These are the
descriptions that you see in the predefined list when you apply a template in the
Report Wizard.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding a Template Preview Image
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Modifying a Template
In this lesson, you learned to open an existing template definition in the Template Editor
and make modifications to create your own customized templates.
You can use any customized template when creating a paper report in the Report Wizard.
The template contains default and override sections.
Default section: Modify objects to affect all styles of reports created with this
template.
Override sections: Modify objects to make individual changes to one or more styles:
Tabular, Group Above, and so on.
Registering a Template
You learned how to register your templates so that they appear in the predefined list in the
Report Wizard. Optionally, you can include a small bitmap image for each style of report,
which is displayed when you select a predefined template.
Adding Web Links
In this lesson, you learned how to add a Web link to a paper template for report HTML
output.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 6 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 6
1. Customize an existing template, adding a company logo and report title to the report
Oracle University Internal and TransAmerica Training Management Inc Partner use only
margin, and modify the report body.
a. Open rwblue.tdf. This file should exist in your working directory; it is a
copy of the Blue predefined template.
b. Display the margin region. (This usually appears by default when you open a
template.)
c. Delete the Your Company logo. Insert towers2.jpg and place it in the top
left corner of the margin; this file should exist in your home directory.
d. Add a report title: Lakeside Technologies.
e. Display the body region to view the changes you will make in the next steps.
f. Change the justification of numeric fields (number field and summary) to
Right. Do not forget to change the justification of labels for number fields to
Right.
g. Save the template as laketech.tdf.
2. Apply the modified template to an existing report.
Hint: You must search for the template file; it does not appear in the list of
predefined templates.
a. Open p4q3.rdf.
b. Apply laketech.tdf to the report.
c. The report shows some changes but not all. Which template changes have been
applied and which have not?
d. To apply all changes to your report, you will have to create the layout again.
From the menu, select Edit > Select All to select all layout objects. Now delete
them. Invoke the Report Wizard and reapply your template.
e. Save the report as p6q2.rdf.
3. Continue to modify the template and test it using a new report.
a. Change the text color of the master group fields to red for the Group Left style
only.
Hint: In the Template Editor, use the Report Style list to switch to a Group
Left style. This way you can select the correct group. To see the entire
template layout structure, and recognize the difference between the master
group fields and the detail group fields, select View > Zoom > Zoom Out from
the menu.
b. Save your template as laketech2.tdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 6 (continued)
c. Create a new report, using the Report Wizard.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Use the layout style Group Left.
Import the query p6q3.sql from your working directory.
Make DEPARTMENT_NAME the group field.
Display all other columns.
Do not create summaries.
Change the width of SALARY to 6 and COMMISSION_PCT to 4.
Apply the Template file laketech2.tdf.
d. Save the report as p6q3.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Web Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
Oracle Reports is designed for the Internet. You can develop Web reports simply and
quickly in Reports Builder.
Earlier releases of Oracle Reports provided Web functionality for paper reports, enabling
you to publish corporate data on the Web in HTML and PDF formats. However, this often
resulted in large and somewhat inflexible HTML pages.
While all the previous Web report functionality remains (hyperlinks, bookmarks, and so
on), Oracle Reports takes advantage of JavaServer Page (JSP) technology to deliver high
quality HTML pages for Web publishing.
In this lesson, you are introduced to JSP technology, learn how to create a Web report
using the Report Wizard, and learn how to use the Web Source view of the Report Editor.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
What Is JSP Technology?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
JSP Advantages
JSP Advantages
JSP technology enables the rapid development of Web-based applications that are
platform independent. Organizations typically have a team of Web designers and
developers to create visually appealing and effective Web pages for publishing. The team
may do this through HTML scripting, or by using any HTML authoring tool.
JSP technology lets you separate the dynamic portion of your Web page from the static
HTML. This enables Web designers to build the static portion of the page using their
favorite Web authoring tool, and you, as an application developer, to add the dynamic
data component using Oracle Reports custom JSP tags.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
JSP Advantages (continued)
Since the JavaServer Pages cleanly separate dynamic application logic from static HTML
Oracle University Internal and TransAmerica Training Management Inc Partner use only
content, page designers who have limited or no Java programming expertise can modify
the appearance of the JSP page without affecting the generation of its content. The
separation of the HTML coding and the business logic in a Web page allows HTML
programmers and Java programmers to more easily collaborate in creating and
maintaining applications. The application logic itself can reside in server-based resources
that the Web page accesses through tags that are similar to XML tags.
Another advantage of using JSPs is that they are easy to code. JSPs are compiled just in
time, offering faster performance with maximum portability. JSPs are rapidly becoming
the standard environment for enterprise Web publishing. JavaServer Pages are recursive
and can execute different code streams within the HTML, making them more versatile for
deploying information on the Web.
For more information about JSP technology, see the JavaSoft Web site at http://
www.javasoft.com/products/jsp/.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Simple JSP Example
<HTML>
<HEAD><TITLE>Simple JSP Example</TITLE></HEAD>
<BODY>
Welcome to my page!!
Current time is :
<%= new java.util.Date() %>
</BODY>
</HTML>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Building a Web Report
Two Options:
Open an existing HTML page in Reports Builder
Use one of the predefined HTML templates shipped
with Oracle Reports Developer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using the Report Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report Editor: Web Source View
Reports JSP
Custom Tag
Library
Start of report
Data model
information
HTML template
information
End of report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Web Source View (continued)
A Reports JSP includes both standard JSP tags and Reports custom JSP tags.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
A JSP tag is a Java class that encapsulates functionality and can be used in a JavaServer
Page. The use of JSP tags keeps the JavaServer Pages manageable and easy to read. You
do not have to write a lot of inline Java code. You simply reference a JSP tag. When a
.jsp file is run, each tag is substituted with the corresponding code.
JSP 1.1 supports custom tag libraries. You can write your own set of tags and reference
them within your JSPs. A set of custom JSP tags was created for Oracle Reports to
facilitate the development of Reports JavaServer Pages. These tags provide scripting
shortcuts that hide the intricacies involved in querying data from the respective data
sources, access to the data model break group cursors, and retrieve and format data from
report columns and parameters.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
JSP Tags
JSP Tags
The standard JSP tags, taglib and page, are required in the definition of a report module.
<taglib>: In order to use the custom tags in a Reports JSP, a declaration identifying
the custom tag library must be included. This declaration also identifies the custom tag
prefix letters. In Oracle Reports, the custom JSP tags are prefixed with rw. The custom
tag library is declared in the first line of the Web source:
<%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw"
%>
Note: tld stands for tag library descriptor.
<page>: This tag identifies the scriplet language, the Java classes to import, and the
JSP to display for any unhandled runtime errors.
<%@ page language="java" import="java.io.*"
errorPage="rwerror.jsp" %>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
JSP Tags (continued)
Reports Custom JSP Tag Library
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The table below lists some of the custom JSP tags used in Oracle Reports:
Custom JSP Tag Definition
rw:report Delimits a report object within a JSP. All other Reports
custom tags must exist within the scope of this tag.
rw:objects Adds or modifies the report definition. This tag identifies
the beginning of the runtime metadata region,
i.e., the data for the report.
rw:foreach Indicates a loop through the data source group object
rw:field Provides formatting functionality to render a single
value source object (a column, user parameter, or system
parameter) in HTML
rw:include Provides for the formatting of any top level layout
object into HTML output. This tag is used to reference
a paper layout within a Reports JSP.
rw:graph Provides a graph definition in XML.
Technical Note
For a complete list of Reports custom JSP tags, consult the online Help system.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Web Source Example
Example
The Web Source in this example was generated by the Report Wizard using the following
specifications:
Style: Tabular
Data source: SQL query
Data:
SELECT FIRST_NAME, LAST_NAME, EMAIL, HIRE_DATE
FROM EMPLOYEES
Fields: Display all fields
Template: Blue
The code generated by Reports Builder for the data model of the report is shown in the
slide.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Example (continued)
Modifying a Web Report Using the Report Wizard
Oracle University Internal and TransAmerica Training Management Inc Partner use only
You can modify a Web report using the reentrant feature of the Report Wizard just as you
did for paper reports. The Wizard preserves your current setting and data source
definition. You can make changes to these and other settings and click Finish when you
are ready to reapply the Wizard settings to your Web report.
Saving Your Web Report Definition
The preferred format for saving a Web report is Reports JSP (*.jsp) and not HTM or
HTML. The reason for this is that certain Web servers (for example, Apache) see the
HTML extension, assume the document is static, and simply return the document to the
browser without ever executing the JSP code it contains. Furthermore, if your Web report
has a jsp extension, it is also recognizable to Java development environments, such as
Oracle JDeveloper, and you can utilize the Java debugging tools available in these
environments.
Technical Note
A Reports JSP contains the full definition of your report module. However, Reports
Builder hides a good deal of the code in the Web Source view. You can view the module,
<module_name>.jsp, outside the Builder using a text editor and see much more
data source, data links, layout, and so forth.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Generating Output
Generating Output
To preview your Web report in a browser:
1. Use the Run Web Layout button on the horizontal toolbar.
2. Select Program > Run Web Layout
To run a report from a browser, use a URL syntax. You can give your users the URL
syntax needed to make the report request from their browser, or you can add the URL
syntax to a Web site as a hyperlink. You will learn about URL syntax in a later lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Generating Output (continued)
Another way to publish a report on a Web site is to create an OracleAS Portal component.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The OracleAS Portal component enables you to add a link to a report in an OracleAS
Portal page or portlet, or to output report results directly into a portlet.
Technical Note
More information on publishing Web reports is covered in the eClass Oracle9iAS Reports
Services: Deploy Internet Reports. Also see the manual Oracle Application Server:
Publish Reports to the Web with OracleAS Reports Services.
More information on using OracleAS Portal for administering and publishing reports is
covered in the eClass Oracle9i Reports: Create Reports for the Web and Portals.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Image Format Support
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Image Format Support (continued)
Oracle Reports supports the following formats:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Source Image Formats:
- JPEG / JPG: Joint Photographic Experts Group
- GIF: graphics interchange format
- PNG: Portable Network Graphics
- BMP: bitmap
- TIFF: tag image file format
- CGM: computer graphics metafile
- Progressive JPEG: a JPEG image that comes into focus while it is being displayed
- Exif JPEG: exchangeable image file (Exif) format is an international specification
that lets imaging companies encode metadata information into the headers or
application segments of a JPEG file. This metadata information includes shutter
speed, aperture, and the date and time the image was captured.
Destination Image formats:
- JPEG / JPG
- GIF
- PNG
- BMP
You learn how to specify the format for images in your report output later in the course.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Creating Web Reports
You can use a predefined HTML template and the Report Wizard to easily create Web
reports. As an alternative, you can develop an HTML page with your favorite Web
authoring tool and add dynamic content to the Web page using Reports Builder.
JSP Technology
Oracle Reports enables you to create JSP reports for Web deployment. A set of Reports
custom JSP tags facilitates easy Reports JSP development.The Web Source view of the
Report Editor allows you to edit the JSP source code. Because JSPs are text files, you can
also use a text editor and edit not only the static HTML portion of your Reports JSP, but
the dynamic portion as well.
Previewing Web Reports
Use the Run Web Layout feature in Reports Builder to test your Web report in a browser.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 7 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 7
1. Create a tabular report, Web and paper layout, entitled Compensation Report. The
Oracle University Internal and TransAmerica Training Management Inc Partner use only
report should contain the following data:
SELECT d.department_name, e.first_name, e.last_name,
e.job_id, e.salary
FROM departments d, employees e
WHERE d.department_id = e.department_id
a. Display all fields. Select the predefined Blue template. Do not make any
changes to the other Wizard pages.
b. Run the Web layout to test.
c. Examine the Web source. How many <rw:foreach> tags are in the code? Why
this number?
d. Modify the report using the Report Wizard. Make this a Group Left break
report displaying employing information grouped by department. Include a
sum for salary.
e. Examine the Web source again. Now how many <rw:foreach> tags are in the
code?
f. Which JSP tag identifies the overall appearance and formatting of the data in
the Web report?
g. Which JSP tag delimits the data model and layout information? Can you view
this information in the Reports Builder?
h. Run the Web layout to test. Save the report as p7q1.jsp.
2. Create a report for the Web that displays current product information.
a. Use the Report Wizard to create a new tabular report called Our Products.
Include the following data from the PRODUCT_INFORMATION table:
Column Label
product_id Product No.
product_name Name
product_description Description
catalog_url Catalog URL
Sort the output by product number.
b. Select the predefined Beige template.
c. Run the Web layout to test.
d. Save the report as p7q2.jsp.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enhancing Reports Using the Data Model:
Queries and Groups
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
You have learned to create simple, single-query paper and Web reports using Reports
Builder.
In this lesson, you learn about the Data Model structure and objects, how to modify SQL
queries created with the Report Wizard, and how to enhance reports by creating additional
groups to achieve more complex report structures.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Data Model Objects
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
The Data Model Objects (continued)
The objects that the Report Wizard creates by default depend on the style of report that
Oracle University Internal and TransAmerica Training Management Inc Partner use only
you choose.
Tabular style: One query, one group
Group Above, Group Left: One query, two or more groups
The number of group objects depends on the number of break groups you define in the
Report Wizard.
The Report Wizard creates only one query.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying Properties of a Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying Properties of a Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Modifying Properties of a Query (continued)
Oracle Reports checks the syntax when you try to leave the SQL Query Statement dialog
Oracle University Internal and TransAmerica Training Management Inc Partner use only
box and whenever you generate or execute the report.
If Oracle Reports detects an error, it displays the error in an alert.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
More Properties
More Properties
Renaming Queries
It is recommended that you rename queries in a complex report to make the Data Model
easy to understand.
Renaming a query does not automatically rename the group below it.
Commenting Your Queries
Use the Comment property to enter meaningful text that describes the query.
You can also insert comment lines directly in the SQL Query Statement area, using the
Oracle standard comment delimiters:
--comment for a single line
/*comment*/ for multiple lines
Note: For ease of maintenance, do not enter comments in different places for the same
query.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
More Properties (continued)
Restricting Rows
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Set the Maximum Rows property to restrict the rows returned from a query. This is useful
for testing your report against a large data source.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Applying Changes
Applying Changes
When you alter the Data Model, you must update your layout to see the changes.
For paper reports, select Tools > Report Wizard from the menu, and alter the tabs to
create a new layout with additional groups and columns.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Applying Changes (continued)
For Web reports, reentering the Report Wizard will delete the layout that was previously
Oracle University Internal and TransAmerica Training Management Inc Partner use only
created. A new Web layout will be created based upon the selections you make on each of
the tab pages in the Wizard. You can also manually edit the Web layout using the Web
Source view of the Report Editor. You will learn more about this in a later lesson.
Note: If you edit a query statement to alter any columns that are part of an existing layout,
and run the report without re-creating the layout, the Source property becomes null, and
the field in the Previewer appears with a large cross.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Changing the Group Structure
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Changing the Group Structure (continued)
Example: You create a Web layout using the Report Wizard and the default group name
Oracle University Internal and TransAmerica Training Management Inc Partner use only
is G_LAST_NAME. You change the name to G_EMP in the Property Inspector. Now do
the following:
1. Display the Web Source view of the Report Editor.
2. Locate <rw:foreach id="R_G_last_name_1"
src="G_last_name">.
3. Change the value of src to G_emp:
<rw:foreach id="R_G_last_name_1"
src="G_emp">
Developer-Created Groups
Sometimes you do not want to modify existing Data Model objects in the Report Wizard;
for example, during later maintenance. In this case, you might need to create your own
groups in the Data Model to perform the following actions:
Produce control break (nested) reports
Produce complex matrix reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Group Hierarchy
Group Hierarchy
The groups in Oracle Reports exist in a hierarchy. You can alter the group hierarchy by
creating new groups.
As you have already seen, a single query produces one default group. You can produce a
control break report structure by creating one or more additional groups above the default.
The following example of a single query, called Q_EMP, is the basis for the hierarchical
report.
SELECT e.first_name, e.last_name, e.job_id,
d.department_id, d.department_name
FROM employees e, departments d
WHERE e.department_id = d.department_id
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Group Hierarchy (continued)
Creating a New Group
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Select DEPARTMENT_ID and drag it out of and above the default group to create a break
group. Change the group name to make it more meaningful.
You can drag other columns, such as DEPARTMENT_NAME, into the new group.
Alternatively, move more than one column into a new group by using [Shift]-click to
select the columns before dragging them all together.
Note: You can also drag columns down a hierarchy, from a higher group into a new or
existing lower-level group. The order in which the groups exist in the Data Model has an
effect on the output. Always make sure that your parent (master) group is first and the
child (detail) group is second.
When you drag a column to create a new group, the new group is only one level above or
below the columns original group in the hierarchy.
To create a group more than one level from the original group, follow these steps:
1. Move the column to the level immediately above or below the required position of
the new group.
2. Drag the column out to create the new group at the next level.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Ordering Data in a Group
1
2
1 Break group controls primary sort; use the Break Order property
2 Order by DEPARTMENT_NAME column: Break Order = Descending
3 Child group controls final sort; uses ORDER BY clause in the query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Ordering Data in a Group (continued)
Break Order in Break Groups
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Remove unnecessary break columns in each break group to improve the performance of
your report. A break group is any group other than the lowest group of each query. If
several columns are all unique, such as the DEPARTMENT_ID and DEPARTMENT_NAME
columns, having break order set on both columns can sometimes cause unnecessary
sorting.
1. Open the DEPARTMENT_NAME column Property Inspector.
2. Alter Break Order to None.
3. Repeat for each column that is not part of the sort.
Break Order in Lower Groups
The Break Order property has no effect on columns in the lowest group of each query.
Modify the ORDER BY clause in the SQL query statement to control this group.
Removing the Break Order property from columns in this lowest group is optional and has
no effect on the output.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Query Modifications
Query Modifications
The following example shows how the ORDER BY clause is modified.
For each database column with the Break Order property set, Oracle Reports appends an
ORDER BY clause to the query or modifies the existing ORDER BY clause.
The break columns always take precedence over the lowest group columns. For example,
suppose that your report contains the following query:
SELECT d.department_id, d.department_name, e.last_name,
e.salary
FROM employees e, departments d
WHERE e.department_id = d.department_id
ORDER BY e.salary
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Query Modifications (continued)
If you create a break group containing DEPARTMENT_ID and DEPARTMENT_NAME, but
Oracle University Internal and TransAmerica Training Management Inc Partner use only
with DEPARTMENT_NAME as the only break column, then at run time your query
becomes:
SELECT d.department_id, d.department_name, e.last_name,
e.salary
FROM employees e, departments d
WHERE e.department_id = d.department_id
ORDER BY 2, e.salary
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Filtering Data in a Group
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using a Packaged Filter
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Queries
A report performs well only if the SQL code that accesses the database is efficient. Write
well-constructed SELECT statements.
You can restrict the rows returned by a query using the Maximum Rows property. This is
useful for testing purposes.
Groups
Organize data into sets of records, to establish hierarchical reports to any depth and width.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 8: Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 8
1. Open report p8q1_a.jsp, a tabular report showing customer information.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Run the paper layout.
b. In the Data Model view, create a break group using NLS_TERRITORY as the
break column. Rename the group G_COUNTRY.
c. Reenter the Report Wizard to update the layout. Select the Group Left style.
Ensure that all fields are displayed.
d. Save the report as p8q1.jsp. Do not close the report.
2. Modify the previous report to restrict the number of customer records processed by
the group.
a. Place a filter on the G_CUSTOMER_ID group to display only the first ten
customers. Run to test.
b. Save the report as p8q2.jsp and close it.
3. Modify p8q1.jsp to restrict the report to customers who have a credit limit
greater than 1500. You need to modify the query properties.
a. Include CREDIT_LIMIT in the query statement, although you do not need to
display it. Restrict the query statement to show those customers who have a
credit limit greater than 1500.
b. Save the report as p8q3.jsp and run the Web layout.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enhancing Reports Using the Data Model:
Data Sources
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
To keep pace with todays demand for information, you need to be able to access all
available data. You often need to access data from your corporate internal data sources as
well as data sources outside your corporation.
In this lesson, you learn about the different data source types that can be used for a report.
You will learn how to access data using the Pluggable Data Source (PDS) feature in
Oracle Reports and how to combine data from multiple sources to publish meaningful
information.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Data Source Types
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Data Source Types (continued)
The information you need to publish is often derived from various data sources. These
Oracle University Internal and TransAmerica Training Management Inc Partner use only
data sources may be:
SQL-based: relational databases like Oracle10g
Non SQL-based: data, such as XML, that has been generated from outside the
corporation
Oracle OLAP (Online Analytical Processing ): an integrated part of Oracle Database
that provides support for multidimensional calculations and predictive functions.
Oracle OLAP supports both the Oracle relational tables and multidimensional data
types.
Java Database Connectivity (JDBC): other relational data sources such as SQL Server,
Sybase, or another Oracle database
Express: multidimensional database that stores decision support data. The Express
data source is provided for backward compatibility
Data in flat files
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Pluggable Data Sources
Text
Express JDBC OLAP SQL XML
files
Oracle
Reports
Client Oracle10g
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Out-of-the-Box Options
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using XML as a Data Source
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using XML as a Data Source (continued)
To define an XML query:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Select XML Query on the Data Source page of the Report Wizard.
2. On the Data page, select Query Definition. The Define XML Query dialog box
displays. Specify information about your XML query:
- Data Definition: The data definition file is a list of elements contained in an
XML document that is used to validate the XML document. You can specify a
Document Type Definition file (DTD) or an XML schema file (XSD). A DTD
supports character data only, while an XSD supports other data types.
- Data Source: This is the location of the XML data stream that you want to use in
your report. It is often referred to as an XML document.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Example: XML Data Stream
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Example: XML Data Stream (continued)
The Document Type Definition
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The DTD defines the structure of the data in the XML document. Like the XML
document, the DTD can be stored locally or remotely. For our example, the DTD contains
this definition:
<!ELEMENT TABLE (*ROW)>
<!ELEMENT ROW (EMPID?, BONUS?, PERINC?)>
<!ELEMENT EMPID (#PCDATA)>
<!ELEMENT BONUS (#PCDATA)>
<!ELEMENT PERINC(#PCDATA)>
It indicates that the XML document contains three data elements, EMPID, BONUS, and
PERINC. The content specification, #PCDATA, specifies that an element contains only
parsed character data, that is, ordinary text.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
XML Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
OLAP Data Source
Multidimensional
objects
OLAP database
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Defining an OLAP Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Example: OLAP Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Text as a Data Source
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Setting Up the textpds.conf File
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Setting Up the Text PDS Configuration File (continued)
For example, the textpds.conf entry for the text file Products_CSV.txt is:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
<fileFormat name=ProductsCSV" comment="#" delimiter=","
type="variable">
<columnInfo>
<column name=Product_ID type=string cellWrapper="/>
<column name=Product_Name type="string"
cellWrapper="/>
<column name=Category" type=number" cellWrapper=" />
<column name=Status" type=string" cellWrapper=" />
<column name=List_Price" type=number" cellWrapper="
/> </columnInfo>
</fileFormat>
The File Format information consists of the file format name, comment character, column
delimiter and file format type. Each File Format has columns. You specify the individual
column information within the <columnInfo> tags. The column information consists of
the following attributes:
Column Name: Heading for the column
Column Type: Data type of the column. String, Number, and Date are the only supported
data types.
Cell Wrapper: This attribute is optional. If specified, this character overrides the File
Format delimiter for the column for which it is specified.
Pattern: This attribute is optional. This is currently used only for date fields and specifies
the pattern of the date field value, for example, dd/MMM/yyyy
In this example, the text file contains five columns: Product_ID, Product_Name,
Category, Status, and List_Price. The cellWrapper attribute indicates that each
column value is present within quotation marks.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Defining a Text Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Sample Text PDS Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using JDBC as a Data Source
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Configuring the jdbcpds.conf File
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Technical Note
Oracle provides a set of Merant DataDirect drivers that can be downloaded from the
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Technology Network (http://otn.oracle.com). The driver configuration
file, jdbcpds.conf, contains relevant entries for the Merant DataDirect drivers.
However, you need to install the appropriate .jar files and specify them in Oracle
Reports specific classpath entries in order to make them available to Reports Builder and
OracleAS Reports Services.
For more information on configuring and using a JDBC pluggable data source with
OracleAS Reports Services, refer to the technical note Configuring and Using the JDBC
PDS on Oracle Technology Network (http://otn.oracle.com). See also the
Oracle Application Server Reports Services: Publishing Reports to the Web manual.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Defining a JDBC Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Defining a JDBC Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding New Data
1
5 2
6 3
7 4
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding New Data
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Adding New Data (continued)
Creating a New Query Manually
Oracle University Internal and TransAmerica Training Management Inc Partner use only
To define an additional data source manually, open the Data Model view of the Report
Editor, select the appropriate tool in the vertical toolbar, and click in the Data Model
painter area to create a new query. Tools are provided for SQL Query, XML Query, Ref
Cursor Query, JDBC Query, Text Query, and Express Server Query.
A Query object appears and the corresponding editor opens. Create the query statement as
in the Data Wizard.
Note: If you have registered your own pluggable data source in Oracle Reports, a tool is
added to the toolbar for that data source. Use it as you would any of the standard tools.
Each query that you create in the Data Model creates at least one group. Reports Builder
creates a unique group name by appending the first column name in the group,
G_employee_id, G_department_id, and so on.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using REF Cursor Queries
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using REF Cursor Queries (continued)
2. In the Data Model view of the Report Editor, select the Ref Cursor Query tool and
Oracle University Internal and TransAmerica Training Management Inc Partner use only
click in the Data Model painter area.
3. In the PL/SQL editor, enter the PL/SQL function that opens a cursor and returns a
cursor variable of the REF cursor type you defined in the package.
FUNCTION QR_1RefCurDS return RefCurPack.EmpCurType is
V_EmpCur RefCurPack.EmpCurType;
BEGIN
OPEN V_EmpCur FOR SELECT * FROM employees;
RETURN V_EmpCur;
END;
4. Refine the query properties as desired.
5. Define break groups as required using the Data Wizard.
Reference
For more information on REF cursors, see Reports Builder Online Help.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Viewing Output from Multiple Query
Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Viewing Output from Multiple Query Reports (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In the report opposite, the G_ORG group appears to the right of the hierarchical model of
G_DEPT and its related child group G_FIRST_NAME; therefore, the department and
employee records are formatted in the output before the department location records.
The output shows a master-detail listing of departments and employees. After all
departments have been processed, a tabular list of departments appears.
If you want to output the department information first, move Q_DEPT and G_ORG to the
left of, or below, G_DEPT. G_FIRST_NAME is always related directly to G_DEPT
because the two groups are owned by the same query.
Remember to reenter the Report Wizard to update the layout after you modify the Data
Model.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Data Links
Equijoin
DEPARTMENTS
Department_Id Department_Name
90 Executive
EMPLOYEES
100 Finance
Last_Name Department_Id
DeHaan 90
Department_Id =
Greenberg 100
Department_Id
Faviet 100
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Data Links
Compound join:
Multicolumn primary or foreign key
Define multiple equijoins
Nonequijoin:
Primary key value between two other values
Create two links:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Column-to-Column Link
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Column-to-Column Link (continued)
To modify the link definition, open the Property Inspector using the right mouse button or
Oracle University Internal and TransAmerica Training Management Inc Partner use only
double-click the link object in the Data Model or Object Navigator. You can modify the
SQL Clause and Condition properties; both have lists of values.
Change the SQL Clause property from the default WHERE to HAVING or START
WITH.
Change the Condition to any logical operator in the list, such as >= or <=.
The other properties are read-only. If you want to change the parent or child properties,
you must delete and re-create the link.
Creating a Multiple-Query Linked Report
Assume the following two queries within a report.
Query: Q_EMP:
SELECT d.department_id, d.department_name, e.last_name,
e.job_id, e.salary
FROM employees e, departments d
WHERE e.department_id = d.department_id
Query: Q_JOB:
SELECT department_id, job_id, count(employee_id)
count_names
FROM employees
GROUP BY department_id, job_id
You need to link them to display job information for each department instead of one
separate list at the end. The link in the Data Model is from the
Q_EMP:DEPARTMENT_ID column to the G_JOB:DEPARTMENT_ID column.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Other Data Link Methods
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Other Data Link Methods (continued)
Create a manual link for the following reasons:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Define a complex join condition in a query
Implement a Cartesian product, linking two tables without a join condition
Link a query that contains objects columns or REF columns
Link a REF cursor query using parameters in the REF Cursor query function
Automatic Query-to-Query Link: An automatic query-to-query link is a link between
two query objects that automatically defines a join condition if the relevant
primary/foreign key constraints exist in the database for columns in the queries.
1. Select the Link tool.
2. Click on the parent query and drag it to the child query.
An error appears if no relevant constraints exist that match the columns in the master and
child queries. You must include the primary/foreign key columns in your queries.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Efficiency Issues: Multiple- or Single-
Query Hierarchy
Outer joins
Data ratio
Multitier environment
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Efficiency Issues: Multiple- or Single-Query Hierarchy (continued)
Data Ratio
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Consider the likely ratio of master to detail rows. As a general guide, use a single query
for many master records with relatively few details.
If your data contains relatively few masters with many details each, however, consider
using two queries with a link. This means that you retrieve the columns for each master
record only once (in the master query) instead of repeating the master columns for every
detail row in a single query.
Multi-tier Environment
A multi-tier environment is a strong argument for reducing the number of queries on the
database to a minimum. Multiple queries for a hierarchical report result in far greater
network traffic in order to fetch records from each query separately.
Note: You can use SQL*Trace to analyze your report; for example, see how much time it
is taking to retrieve data from the database. You will learn more about analyzing and
tuning your report in a later lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Pluggable Data Sources
With Oracle Reports, it is possible to publish data from any data source. Oracle Reports
provides the support for SQL, PL/SQL, Oracle OLAP, Express, XML, JDBC, and text
queries. You can also write your own pluggable data source. With pluggable data sources,
it is possible to maintain multiple concurrent connections to different data sources.
Adding Additional Queries
You can use the Data Wizard to add additional queries to the data model. You need to
update your paper or Web layout to see changes in your report.
REF Cursor Queries
Publish data returned from a REF cursor query by associating the query in your data
model with a PL/SQL function that returns a REF cursor.
Data Links
Create a link between two queries, either manually or automatically. In Oracle Reports,
you can create links to merge data between data sources that are of different types.
Efficiency
Consider outer joins, data ratios, and network traffic when designing your reports and
planning the number of queries.
Oracle Reports Developer 10g: Build Reports 9-40
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 9 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 9
1. Open p8q1_a.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. In the Data Model, create the following query:
QUERY: Q_ORDERS
select customer_id, order_id, to_char(order_date,
'dd-Mon-yyyy') order_date,
order_total
from orders
b. Change the name of the group to G_ORDERS.
c. Open the Report Wizard, create both a Web and paper layout, and select a
Tabular style.
d. Copy group G_ORDERS to the Displayed Groups area.
e. Copy all remaining fields to the Displayed Fields area.
f. Select a template and click Finish.
g. Note how the data appears in the Paper Design view. The G_CUSTOMER_ID
data appears before the G_ORDERS data. Remember that you can alter the
order in which the data is displayed by modifying the query order in the Data
Model. You may want to try that.
Note: If you do adjust the order of the queries, put them back in the original
order and save before the next question.
h. Save the report as p9q1.jsp.
2. Continue with the same report.
a. In the Data Model, link the two queries together on the primary and foreign
keys.
Hint: To create the link, select the Link tool. Click and drag from the primary
key field in the Customer_Id group to the foreign key field in the Orders group.
b. Redo the layout by opening the Report Wizard. Select the Group Above style.
Do not display CUSTOMER_ID.
c. Save the report as p9q2.jsp.
d. Run the Web layout.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 9 (continued)
3. Create a new report that lists the sales representatives and the products they have
Oracle University Internal and TransAmerica Training Management Inc Partner use only
sold.
a. Create both a Web and paper layout and select a Group Above report style.
b. Import the query file p9q3_a.sql.
c. Make NAME and EMPLOYEE_ID the group fields. Make sure that these fields
are in one group, at Level 1, and not two separate groups.
d. Do not display EMPLOYEE_ID, but display all other fields in the order described
in the table below.
Hint: You can change the order of fields in the Report Wizard in the Displayed
Fields text region.
e. Change the following field attributes:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 9 (continued)
4. An international business has warehouses around the world. The database at
Oracle University Internal and TransAmerica Training Management Inc Partner use only
corporate headquarters maintains information about each of the warehouses
(warehouse id, name, city, country, and so forth). However, each warehouse stores it
operational data locally in a relational database. A planning team at headquarters
needs to access this inventory data for every warehouse. The warehouse data is only
available as an XML stream.
Create a report that combines general data stored in headquarters with the inventory
data from each warehouse location.
a. Create a new report manually.
b. In the Data Model view, create a SQL query. Import the SQL query
p9q4.sql.
c. Create an XML Query. For the Data Definition, locate the file
warehouse_inventory.xsd. For the Data Source, locate the file
warehouse_inventory.xml.
d. Link the two data sources together so that your report will provide a general
description of each warehouse along with the specific inventory for each
location.
e. Create both a Web and paper layout for this report. Select the Group Above
style. Ensure that both groups are selected and display all fields. Use the Blue
template for this report.
f. Save the report as p9q4.jsp.
g. Run the Web layout.
5. Create a new report using a REF cursor query.
a. In the Object Navigator, create a local package called RefCur defining a record
and a REF cursor. The record has the following fields:
Name Definition
last_name employees.last_name%type
first_name employees.first_name%type
salary employees.salary%type
b. In the Data Model, create a REF Cursor Query. The function opens the cursor
for the following SELECT statement:
SELECT last_name, first_name, salary
FROM employees
Note: The code is provided for you in the p9q5b.txt file.
c. Open the Report Wizard to create the layout for the tabular report. Select all the
fields and choose a template. Click Finish to run the paper layout.
d. Save the report as p9q5.jsp and close it.
If you still have any objects open in the Object Navigator, close them all.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enhancing Reports Using the Data Model:
Creating Columns
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
When you define a query to extract the data from the database or from another data source
and modify the group structure, you might want to modify the Data Model further to
perform complex calculations not included in your query.
In this lesson, you learn more about the Data Model objects and how to enhance reports
by creating user-defined columns for summaries and calculations.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Data Model Columns
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Data Model Columns (continued)
Developer-Created Columns
Oracle University Internal and TransAmerica Training Management Inc Partner use only
A developer-created column can be one of three types:
Summary column: Summarizes another column and can recalculate for each record
in a specified group
Formula column: Uses a formula you have written in PL/SQL to calculate a value
from one or more other columns
Placeholder column: Has its value set from another object at run time
Each column that you create in the Data Model has an initial default name, which you
should change to a descriptive name.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Maintaining Data Source Columns
Read-only
properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Maintaining Data Source Columns (continued)
For data source columns, some of the property settings are not editable in the Property
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Inspector. You can see the values, but you cannot modify them. These values are
dependent on the column name and type in the data source definition.
The read-only properties are:
Name
Column Type
Data type
Width
All editable properties, except Value if Null, provide a list of values.
Some properties may or may not appear in the Property Inspector, depending on the
column datatype or on the value of another property.
Note: The column types Database - Object and Database - Ref refer to object columns
and reference columns in Oracle 10g. Their properties should not be changed.
You cannot delete a data source column object directly from the group. To delete a
column, you must remove the corresponding expression from the data source definition.
For database columns, you must edit the SELECT statement in the query.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Producing File Content Output
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Producing File Content Output (continued)
To create a file column:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Open the column Property Inspector.
2. Set Read from File to Yes.
3. Select the appropriate file format from the list of valid types.
The Report Wizard creates a field for a file column and provides a default size for the
displayed field. However, you can resize it either in the Paper Design or the Paper Layout.
For portability, do not prefix the full path to the filename in the column. If you do not
prefix a path, Reports Builder can use its file path search order to find the file.
Include the correct paths in the environment variable REPORTS_PATH.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Column
Summary column
What type of value?
Choose the correct column Formula column
tool
Placeholder column
Creating a Column
There are two important questions to ask yourself before you create a column:
What type of column do I require? The answer determines which one of the three tools
to select.
How often do I want this column to be displayed? The frequency at which the column
value appears in the output determines the group in which you create the column.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Column (continued)
To create a column:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Select the appropriate tool from the toolbar in the Data Model editor. Click inside a
group to create the column at the same frequency as other columns in that group.
Note: To display the column once for the report, click in an open area of the Data
Model editor.
2. Double-click the column to display its Property Inspector.
3. Replace the default column number with a brief but descriptive name. Consider
standard naming conventions for different types of columns.
4. Fill in the rest of the settings as appropriate for the type of column you require.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Summary Columns
Specific properties:
Function
Source
Reset At
Compute At
Data type depends on Source data type
Page summaries: Not supported in the wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating Summary Columns (continued)
The datatype of a summary column depends on the data type of the source of the
Oracle University Internal and TransAmerica Training Management Inc Partner use only
summary. If you change the data type of the source column, the datatype of the summary
also changes.
The Report Wizard does not support page summaries. If you select a page summary in the
Field tab of the Report Wizard, an error message appears. Clear the page summary from
the Field tabbed page and create the field manually in the Paper Layout. Creating fields in
the Paper Layout is described later in the course.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Displaying Subtotals
Reset At:
G_DEPARTMENT Report
1 Department totals
2 Report total
Displaying Subtotals
The control break report output shows two summary columns created by the Report
Wizard. One summary shows the total salary for each department, and the other shows the
total salary for the whole report.
The wizard creates these summaries at one or more levels above the salary source column.
The Reset At property defines the group at which a summary resets to zero to enable you
to calculate a number of subtotals.
The wizard chooses a default reset value for these summaries.
The department total in G_DEPARTMENT is reset at G_DEPARTMENTthat is,
values start from zero for each new department record.
The report total at report level is reset at Report.
To create an accumulating total for the department total, change the Reset At property to
Report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Displaying Subtotals (continued)
The Reset At property displays only options that are valid for each summary.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
There are two options, Report and Page, that are valid for all summaries. Depending on
the level of the summary, some groups are also available in the valid list.
The frequency at which the summary value is displayed depends on the group within
which you create the column.
To create your own summaries, use the following rule:
Discrete Total: Reset At value is the same as the summary group.
Accumulating Total: Reset At value is a higher group than the summary.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Displaying Percentages
Reset At: G_EMPLOYEE G_EMPLOYEE
Compute At: G_DEPARTMENT Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Displaying Percentages (continued)
The Reset At property works the same way that the Sum function does. The default, Reset
Oracle University Internal and TransAmerica Training Management Inc Partner use only
At G_EMPLOYEE, results in a discrete value for each employee.
For both summaries in the example on the previous page, the Reset At property is
G_EMPLOYEE. Both percentages reset to zero for each employee record. If you want to
create a running percentage that eventually accumulates to 100%, change the Reset At
property to reset at a higher level than its source column. For example, to create an
accumulating percentage that accumulates for each department and then resets to zero,
change Reset At to G_DEPARTMENT.
The Compute At setting defines the total value that a % of Total summary uses in the
percentage calculation. This property is only applicable to % of Total summaries.
The wizard sets the Compute At property to one group above the source column. In the
left example opposite, the default is G_DEPARTMENT. To display the salary as a
percentage of the whole report value, change Compute At to Report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Resetting Summary Values
Reset At
Data Model
Group REPORT G_DEPARTMENT G_EMPLOYEE
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Formula Column
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Formula Column (continued)
Note: The code displayed is a simple example to illustrate the syntax. The
Oracle University Internal and TransAmerica Training Management Inc Partner use only
MY_FUNCTION function might be a local program unit at report level, a program unit in
an attached PL/SQL library, or a stored program unit.
Consider using a formula column only if you cannot include your calculation in the query
statement.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Placeholder Column
An empty container at
design time
CP_xxx Populated by another
object at run time
Before Report trigger
Formula column at report
level
Formula column in same
group or below
CF_xxx placeholder
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Placeholder Column (continued)
Using placeholder columns, you can:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Populate multiple columns from one piece of code. You can calculate several values
in one block of PL/SQL code in a formula column and assign each value to a different
placeholder column. Thus, you create and maintain only one program unit instead of
many.
Store a temporary value for future reference. For example, store the current maximum
salary as records are retrieved.
You cannot populate a placeholder by writing code in the placeholders own Formula
property.
The PL/SQL Formula button opens up the Program Unit editor where you enter and edit
your code. This is applicable only when you call a user exit.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Populating a Placeholder Column
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Populating a Placeholder Column (continued)
To create the columns:
1. Create a summary column CS_MAX_SALARY at report level (outside all groups).
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Data type: Number; Width: 10; Function: Maximum; Source: Salary; Reset At:
Report
2. Create a placeholder column CP_MAX_EARNER at report level (outside all
groups). Data type: Character; Width: 80
3. Create a formula column CF_CALC_MAX in the G_EMP group. Data type:
Number; Width: 10 (these are the default values)
4. Open the Program Unit editor from the PL/SQL Formula property in
CF_CALC_MAX. Create a function:
function CF_CALC_MAXFormula return Number is
begin
if :salary = :CS_MAX_SALARY then
:CP_MAX_EARNER := (:LAST_NAME|| in
Department ||:DEPARTMENT_ID||--
||:DEPARTMENT_NAME);
end if;
return(0);
end;
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Column Types
A data source column exists for each column or expression in the query or data
definition.
Create summary columns for computations and summaries.
Create formula columns to perform a calculation or to populate a placeholder column.
Create a placeholder column to provide an empty container that is populated from
another object at run time.
Summary Levels
Report
Page (not supported by the Report Wizard)
Groups within the report
Reset At
The level at which to reset the summary back to zero
Compute At
Valid only for summary columns with a function of % of Total
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 10 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 10
1. Create a new report using the Report Wizard. Create both a Web and paper layout
Oracle University Internal and TransAmerica Training Management Inc Partner use only
and select a Group Above report style.
a. Select the following columns in the Query Builder:
Table Columns
ORDERS order_id, order_date
ORDER_ITEMS line_item_id, product_id, unit_price, quantity
Hint: Manually edit the query created by Query Builder to modify the display
of order_date using the TO_CHAR function and specify an alias:
TO_CHAR(order_date, dd-Mon-yyyy)Order_Date
b. Modify the query to include line_total as a calculation of
unit_price*quantity.
c. Group the data on Order_ID and Order_Date and display all the fields.
d. Create the following summaries. Can you use the Report Wizard to create the
summaries?
Column Summary
line_total sum
line_total % Total
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 10 (continued)
2. Open the p9q3.jsp report .
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Create columns to show the percentage of the total per sales representative for
PROD_TOTAL and CUST_TOTAL.
b. Update the layout. Make all the new summaries four characters wide.
c. Save the report as p10q2.jsp.
d. Run the Web layout.
3. Create a new report to list employees by department ranked by their salaries. Create
both a Web and paper layout and select the Group Left report style.
a. Import the query from p10q3.sql. Select the group field as
DEPARTMENT_NAME and display the following data.
Table Column Label Width
departments department_name Department 10
employees employee_id ID 2
first_name First Name 6
last_name Last Name 6
salary Salary 8
Include a summary of the salary column in the report.
b. Use the Beige template and finish the Wizard.
c. Modify the report to list employees by salary, beginning with the highest paid
in each department.
d. To display the ranking, add a column call RANK in the group
G_EMPLOYEE_ID.
e. Use the Report Wizard to display the rank, giving it a width of 2.
f. Run the paper layout to test.
g. Save the report as p10q3.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 10 (continued)
4. Open the p10q1.rdf report to display the highest and lowest orders at the end of
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the report.
a. In the Data Model, add the columns necessary to list the maximum order total
and the corresponding ORDER_ID, as well as the minimum order total and the
corresponding ORDER_ID.
Hint: You need one formula column and two summaries and two placeholders.
You can copy the code for the formula column from the file p10q4.txt.
b. Use the Report Wizard to add the new columns to the layout. Display the
maximum order total, the maximum ORDER_ID, the minimum order total, and
the minimum ORDER_ID.
c. Run the paper layout to test. Scroll down to the last page to see the new columns.
d. Save the report as p10q4.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enhancing Reports
Using the Paper Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
You can fulfill many of your paper report requirements simply by making modifications
in the Paper Design view. However, for more complex paper reports you need to modify
or create objects in the Paper Layout editor.
The layout can be a complex area to view and modify. This lesson aims to give you an
appreciation of the layout sections, as well as the objects that you see and create using
object tools in the toolbar.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Viewing the Paper Layout
Header Compensation
section Report
Page 1 of 1
Main
section
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Viewing the Paper Layout (continued)
Header Section: The header section consists of one or more pages that appear once, on a
Oracle University Internal and TransAmerica Training Management Inc Partner use only
separate set of pages, as the first part of the report.
Main Section: By default, the Report Wizard creates the paper layout in the Main Section
of a report, positioned between the header and trailer pages.
Trailer Section: The trailer section consists of one or more pages that appear once, on a
separate set of pages, as the last part of the report.
Note: In the Object Navigator window, the three report sections are listed under the Paper
Layout node.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Viewing the Section Areas
Page 1 of 1
Main Body/
section Margin
Trailer Body/
End of report
section Margin
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Designing Multipanel Reports
Logical Page 1
Panel 1
Physical Page 1
Header Logical Page 1
Panel 2
Physical Page 2
Logical Page 1
Trailer Panel 1
Physical Page 7
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Designing Multipanel Reports (continued)
To define dimensions for a section of the report:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Select the Header Section, Main Section, or Trailer Section node in the Object
Navigator.
2. Open the Property Inspector.
3. Specify physical page size: Width and Height properties.
4. Specify logical page size: Horizontal Panels per Page/Vertical Panels per Page
properties.
Define the logical dimensions in multiples of the physical page width and height.
5. Define the page orientation as required.
Example: In the diagram opposite, the layout is twice the width of the physical page. For
example, to output a logical design of 16 inches across 8-inch pages, the settings are:
Unit of Measurement: Inch
Physical Page Height: 8
Horizontal Panels per Page: 2
Vertical Panels per Page: 1
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Printing Multipanel Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Different Objects in the Paper Layout
4
5
1
2
3
1 Frame
2 Repeating frame
3 Field
4 Boilerplate
5 Imported boilerplate image
6 Graph
Different Objects in the Paper Layout
The Report Editor Paper Layout view supports a large number of different objects. The
Paper Layout objects and their properties are represented symbolically to distinguish their
types and relationships.
Frame: This object encloses other layout objects and controls formatting, frequency,
and positioning of several objects simultaneously. Created by default or by the
developer
Repeating Frame: This object displays rows of data that are retrieved for a group.
Created by default or by the developer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Different Objects in the Paper Layout (continued)
Field: A field defines the appearance of a columns data. It may contain character,
Oracle University Internal and TransAmerica Training Management Inc Partner use only
number, date, graphics, image, or sound data. Created by default or by the developer
Boilerplate: Hard-coded text or graphics that appears in a report every time it is run.
Created by default or by the developer
External Boilerplate: Text or graphics that appears in a report every time it is run,
but read from a file. Created by the developer
Graph: An object that allows data to be represented in a graphical way
Every object has a property sheet. You can invoke the Property Inspector in a number of
ways:
Double-click the object
Highlight the object and use the right mouse button menu to choose Property Inspector
Highlight the object and choose Tools > Property Inspector
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Paper Layout Layers
F_xxx F_xxx
R_G_xxx
M_G_xxx
Body
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
The Paper Layout Layers (continued)
Group Reports
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Group Left and Group Above reports create two repeating frames; the detail group frame
is nested inside the master repeating frame to produce a detail tabular listing for each
master record.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Avoiding Layout Errors
Confine Mode
Flex Mode
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Avoiding Layout Errors (continued)
Flex Mode
Oracle University Internal and TransAmerica Training Management Inc Partner use only
- Work with Flex Mode enabled (on) to adjust all affected enclosing objects when
you move or resize one object; the whole layout flexes to accommodate your
changes.
- Work with Flex Mode disabled (off) when you want to move or resize an
individual object without moving or resizing other objects.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report Processing
BEGIN M_G_master
REPEAT R_G_master
f_xxx f_xxx
BEGIN M_G_detail
REPEAT R_G_detail
END M_G_detail
END M_G_master
Report Processing
To understand how the Paper Layout maps to the output that you see in the Paper Design
view, consider the layout as a 3GL program, where the group frame is a WHILE loop and
the repeating frame is a block.
In a two-level group report, the report processes a master record, including all details that
relate to that master record, and then processes the next master.
BEGIN M_G_master
while M_G_master has records to process
REPEAT R_G_master
BEGIN M_G_detail
while M_G_detail has records to process
BEGIN R_G_detail
end R_G_detail;
END M_G_detail;
END R_G_master;
END M_G_master;
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Report Processing (continued)
Layout objects often show symbols and icons that indicate their characteristics. The
Oracle University Internal and TransAmerica Training Management Inc Partner use only
diagram opposite shows two of these symbols:
Black arrowhead: Indicates a repeating frame object
Diamond: Indicates that the object is a variable size; it can increase or decrease in size
depending on the contents
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Layout Objects
2 7
3 8
4 9
5
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating Layout Objects (continued)
When you create a layout object, the default name is an alphabetic character that indicates
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the object type, followed by a number. Rename your layout objects meaningfully to help
you in developing and maintaining the report.
Technical Note
The ability to embed an OLE2 object in a report is obsolete in Oracle Reports 10g. While
existing applications using OLE2 objects should continue to run without modification,
this functionality can be mimicked by using mime types with associated plug-ins and
hyperlinks.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Paper Layout Tools
Magnify
Frame Select
Report Block
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report Bursting
Trailer HTML
Report Bursting
The capability of producing multiple copies of a given report or portions of it in different
output formats is referred to as report bursting.
Oracle Reports enables you to deliver a single report to multiple destinations
simultaneously. Each of the three report sections may have a completely different
structure, page layout, page size, destination, and output format, yet be based on the same
data. At run time, each section may be selectively turned on or off to produce multiple
reports in a single run. You can also specify the desired destination at either the report or
section levels. In this way, a single report execution can produce multiple copies of the
output (or portions thereof) in different physical formats, whether it is to a printer, e-mail,
the file system, or the Web. A remote office, for example, may require nothing but an
executive summary sent by way of e-mail, while the local office may prefer a complete
physical printout, and an overseas office may want nothing but detailed output available
on the Web.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report Bursting
Dept 10
West East
Dept 20
West East
;
Dept 30
West East
Dept 40
Dept 80
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Bursting on a Repeating Group
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Bursting on a Repeating Group
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating an Additional Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating an Additional Layout (continued)
Using the Report Block Tool
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Report Wizard creates the initial layout for your report. You might want to create
additional parts of the layout without affecting the layout that is already there. Both
layouts use the same data; there is no need to create additional queries.
Reports Builder provides the Report Block tool, which enables you to build an indefinite
number of additional layouts based on all or part of the Data Model.
To create an additional layout:
1. Select the report section.
2. Select the Report Block tool from the tool palette.
3. Drag an area in the Paper Layout defining where to place the new objects.
The Report Block Wizard opens.
4. Select the report style for the additional layout.
5. Select the group you want and the direction to print the records.
6. Complete the Wizard tabs as before.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Distributing a Report
Distributing a Report
Report distribution enables you to send all or part of a report to numerous destinations,
each with different characteristics from a single run of the report. It is often necessary to
distribute a report to different media, such as paper, e-mail, Web formats, and delimited
output (e.g., Excel). Often, you are required to distribute different sections of a single
report in different formats to different groups of people.
You can create distribution lists for an entire report and for individual sections of the
report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Distributing a Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Tracing the Report Distribution
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Tracing the Report Distribution (continued)
To trace the report distribution:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. From the menu, select Program > Tracing to invoke the Trace dialog box.
2. Specify a name for the trace file in the Trace File field.
3. Select the Distribution check box.
4. Click OK.
5. Run the report.
6. Use a text editor to open and view the recorded trace file.
Note: The trace file format is very similar to the .xml file format. You could cut and
paste from the trace file to create the .xml file. Trace information can only be
generated when running a .rdf file.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Variable Length Lines
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating Variable Length Lines (continued)
To make the line stretch to fit the group frame, draw the line from the top of the
Oracle University Internal and TransAmerica Training Management Inc Partner use only
column labels through the repeating frame. Change the property Line Stretch with
Frame to the group frame, M_xxx_GRPFR.
Paper Design Versus Paper Layout
You can create and modify a line in the Paper Design or in the Paper Layout. There are
advantages and disadvantages to both:
Paper Design: It is easy to create a line and change the property. You can easily see
the line stretching with the data, but you cannot move the line outside its enclosing
object, because you cannot disable Confine Mode.
Paper Layout: You can disable Confine Mode to change the position of the line, but
you cannot see the effect of Line Stretch with Frame until you view the report in the
Paper Design.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
In this lesson, you learned to modify a paper report layout in the Paper Layout.
Modifying the Paper Layout
There are three report sections, Header, Main and Trailer. Each of them has two areas,
Body and Margin.
You can use the tool palette to create standard drawing objects and report objects. The
tool palette also provides some useful editing tools, such as the Frame Select tool.
Report bursting enables you to send report output or portions thereof to multiple
output destinations in multiple formats in a single report execution. You can burst and
distribute on repeating data with Oracle Reports.
You can create many additional layouts in the same report by using the Report Block
tool.
Example Reports
This lesson discussed solutions to the following report requirements:
A report with sections
Distributing reports such that each user only receives information that is relevant and
appropriate
Creating variable length lines
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 11 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 11
1. Open report p10q1.rdf. Modify the report as follows:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Create a header section.
Display the monitor.jpg file as fixed boilerplate in the Body region.
Add a rectangle boilerplate object. Give it fill color.
Place the image on top of the rectangle. Center the two objects.
Hint: Use the Layout option from the menu.
Include todays date in the top right portion of the margin.
b. Add a report title in the body region.
Use Arial bold as the font and 20 as the size.
c. Add a trailer section that displays todays date with the text End of Report on
one line, and Report run on: on the second line in the body region. Select a
larger font.
Hint: Copy and paste the date from the Margin Area of the header section of the
report.
d. Save the report as p11q1.rdf.
e. Run the Paper Layout. Run the Web layout. What is different?
2. Open report p10q1.rdf.
a. Modify the report to add a header section that lists all order numbers, order dates,
and order totals in the body region.
b. Add Executive Summary as boilerplate text in the margin region of the header
section.
c. Set the distribution for the header section to an HTMLCSS file.
d. Set the distibution for the main section to a PDF file.
e. Run and test the report using the Distribute facility in Reports Builder.
f. Look at the output generated for both file formats.
g. Save the report as p11q2.rdf and close it.
3. Open report p11q3.rdf. Modify the report to burst on repeating data, based on
warehouse ID, and distibute a PDF report for each warehouse.
a. In the Paper Layout view of the Report Editor, select the outermost repeating
frame and delete it.
Hint: Use the Object Navigator to locate the frame.
b. Set the property for the main section of the report to burst on each warehouse ID.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 11 (continued)
c. Define the distribution for the report. Generate a PDF file for each warehouse,
Oracle University Internal and TransAmerica Training Management Inc Partner use only
using the warehouse name as a unique identifier for each PDF file, such as
rptBejiing.pdf.
d. Activate the distribution.
e. Save the report.
f. Look at the output generated for several of the warehouses.
4. Open report p11q4.rdf.
a. Use the Report Wizard to increase the width of PRODUCT_DESCRIPTION to
30.
b. Add a flexible line vertically between the PRODUCT_NAME and
PRODUCT_DESCRIPTION fields.
c. Run the Paper Layout to test.
d. Save the report as p11q4.rdf.
5. Open and run report p2q10.rdf.
a. Using the Paper Design view, compare the output with s11q5a.rdf. What is
different? Change the report so that it looks like s11q5a.rdf.
b. Fully expand the Paper Layout node for p2q10.rdf.
c. Open the Paper Layout and move the window to the right. Make sure it doesnt
obscure the Object Navigator window.
d. Move the F_EMPLOYEE field down 2 inches. It should not be enclosed by any
frame.
e. Resize the R_G_EMPLOYEE frame so that it only encloses the F_SALARY and
F_JOB_ID fields.
f. Resize the M_G_EMPLOYEE_GRPFR frame so that it encloses the
R_G_EMPLOYEE repeating frame.
g. Move the F_DEPARTMENT_NAME and F_DEPARTMENT_ID fields to the
right.
h. Create a new repeating frame in the free space. Set the Line color attribute to No
line.
i. Link the repeating frame to the G_EMPLOYEE group.
j. Move the F_EMPLOYEE field inside the repeating frame R_1.
k. Save the report as p11q5a.rdf and run the paper layout. What happens?
l. Fix the layout hierarchy error.
m.Rearrange the column headers
n. Run the paper layout.
o. Close the report. Save as p11q5a.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Controlling the Paper Layout:
Common Properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
All Reports Builder objects have properties that provide default settings, which in many
cases are suitable for your report. However, you can modify these property values; for
example, to change the pagination of objects in the report output.
In this lesson, you learn about properties that are common to all paper layout objects.
These are properties that enable you to control the size, placement, and pagination of
objects in the paper report output, as well as properties for Web support of paper reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying Paper Layout Object Properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Modifying Paper Layout Object Properties (continued)
Using the Object Navigator:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
- Select the object directly in the Object Navigator, where you can easily see the
name and type of object.
- To open the Property Inspector, click the node icon to the left of the object name,
or use the right-mouse-button menu.
Using the Select Parent Frame tool:
- Select the top object in the Paper Layout or Paper Design. Choose Select Parent
Frame to select the enclosing object on the layer below. For example, select a
field, choose Select Parent Frame to select the repeating frame, and choose Select
Parent Frame again to select the group frame.
- To open the Property Inspector, select Tools > Property Inspector or use the Object
Navigator.
Do not double-click the object in the Paper Design, because you will probably select the
wrong object on the top layer.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Comparing Properties
Intersection Pin
Comparing Properties
To compare the properties of two objects:
1. Select one or multiple objects and open the Property Inspector.
Note: Selecting multiple objects results in an intersection of properties.
2. Select the Pin tool to freeze the Property Inspector.
3. Select the second object and open the Property Inspector.
4. Reposition the Property Inspectors to view them side by side.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Common Layout Properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Sizing Objects
Layout icons
Elasticity Vertical Horizontal
fixed
expand
contract
variable
Sizing Objects
You can create objects of any size in the Paper Layout. The elasticity properties enable
you to specify whether the object can change size at run time.
The four types of object elasticity and the output object size are:
Fixed: identical to the layout object size
Expand: can be larger than the layout object, but not smaller
Contract: can be smaller than the layout object, but not larger
Variable: can be larger or smaller than the layout object
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Sizing Objects (continued)
How Wizard Report Styles Affect Elasticity
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Frames: The Report Wizard sets the elasticity of enclosing objects, such as a group frame,
to allow for multiple occurrences of a repeating frame.
Fields: When you reduce the size of a character field in the Labels tab, the Report Wizard,
depending on the report style, sometimes alters the vertical elasticity of the field to allow
for additional characters.
Layout Style Horizontal Elasticity Vertical Elasticity
Tabular Fixed Expand
Group Above Fixed Expand
Form Fixed Expand
Form Letter N/A N/A
Mailing Label N/A N/A
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Anchors
Implicit (shaded)
Explicit (solid)
Anchors
Anchors are used to determine the vertical and horizontal positioning of a child object
relative to its parent. An anchor defines the relative position of a child object to the parent
object to which it is anchored. An object is called an internal child object when it is
enclosed by the parent object. An external child object is not enclosed by its parent object.
The absolute position of each layout object is, by default, related to the position of its
enclosing object at run time, unless one of the following is true:
Reports Builder determines that the position causes a conflict with other objects, so
Reports Builder creates an implicit anchor.
You decide to override the default position of an object, so you create an explicit
anchor.
Reports Builder creates an implicit anchor for any object that it considers to be in the push
path of another object. For example:
An object occurring below a vertical repeating frame
An object occurring to the right of a horizontal repeating frame
An object occurring below an object that has a variable or expandable vertical size
An object occurring to the right of an object that has a variable or expandable
horizontal size
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Anchors (continued)
The chart below compares implicit and explicit anchors.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Implicit Explicit
Not visible in the Paper Layout Visible in the Paper Layout
Created and maintained automatically by Created by the developer using the
Reports Builder anchor tool in the tool palette
Visible in the Object Navigator if Anchoring Information is enabled (Navigator
option)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Layout Object Relationships
1
2
1 No relationship, no anchor
2 Explicit anchor to enforce relationship
3 Implicit anchor because object is in the push path of a frame
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Layout Object Relationships
4
1
2
3
6
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Layout Object Relationships (continued)
More About the Push Path
Oracle University Internal and TransAmerica Training Management Inc Partner use only
By default, Reports Builder implicitly anchors each object to its immediate enclosing
object. However, sometimes Reports Builder must alter the implicit anchor to ensure that
objects do not overlap at run time when their size is not fixed.
Reports Builder uses an implicit anchoring algorithm to determine whether an object lies
in the push path of another object.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Pagination Icons in the Paper Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Pagination Icons in the Paper Layout (continued)
The Paper Layout displays icons representing each of the properties when they are set to
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Yes (this is the default). These icons are very useful, especially for maintenance and
support. However, you can suppress these and other icons in the Paper Layout options.
1. Select Tools > Options > Paper Layout.
2. Click the Options tab.
3. Select or clear the options as required.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Page Break Before
-1-
1
-2-
xxx
xxx
-1-
xxx -2-
2 xxx
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Page Break Before (continued)
Examples
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Example 1: The repeating frame and image are not related. Therefore, when you select the
Page Break Before check box for the repeating frame, the image does not move to the
next page.
Example 2: The image is below, and in the push path of, the repeating frame. Therefore,
there is an implicit anchor between the repeating frame (parent) and the image (child).
The image formats after the repeating frame on the same page as the repeating frame.
Note: Setting Page Break Before on a repeating frame gives a page break before the first
occurrence of the repeating frame only. It does not provide a page break between each
record.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Page Break After
-1-
xxx
1 xxx
-1-
xxx -2-
2 xxx
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Page Break After (continued)
Examples
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Example 1: The repeating frame and image are not related. Therefore, when you set Page
Break After to Yes for the repeating frame, the image does not move to the next page.
Example 2: The image and rectangle are below, and in the push path of, the repeating
frame. Therefore, there is an implicit anchor between the repeating frame (parent) and the
image and rectangle (children). The page break occurs immediately after the last instance
of the repeating frame, and the image and rectangle appear on the new page.
Note: Setting Page Break After on a repeating frame gives a page break after the last
occurrence of the repeating frame only. It does not provide a page break between each
record.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Page Protect
-1-
40
xxxxxxxx
f_dept_id
xxxxxxxx
Employee
-2-
f_ename
41
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Page Protect (continued)
Using Keep with Anchoring Object
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Keep with Anchoring Object property is similar to Page Protect, except that it affects
anchored objects instead of enclosing objects.
Keep with Anchoring Object is useful when you want to keep two objects together on the
same page.
If there is not enough room to display the child object on the same page as its parent,
Keep with Anchoring Object moves both parent and child objects to a new page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Controlling Print Frequency
-1-
Your Company Your Company
-2-
Your Company
-3-
Your Company
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Controlling Print Frequency (continued)
Which Parent?
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Base Printing On determines whether the parent object is to be the Enclosing Object or the
Anchoring Object.
Example
The report on the previous page shows a text title inside the group frame. The output for
this frame shows there are several records that span three pages.
When you create a piece of text, by default it is printed on the First Page only of its
enclosing object. In this case, the enclosing object is the group frame. You can modify the
properties to select the pages on which the text is printed.
To print the text on all pages of the group frame, set Print Object On to All Pages; set
Base Printing On to Enclosing Object (default).
Note: If the text is outside all group frames, its parent is the body page itself. Therefore,
you can use these two properties to display Continued... on all but the last page, or
...continued on all but the first page.
There are several restrictions that apply to these settings. If you receive an invalid setting
error, look at the explanation and restrictions in the Reports Builder Help Topics.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Format Triggers
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Layout Object Properties for Web Support
Hyperlink
Hyperlink
Destination
Bookmark
Application
Command Line
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Layout Object Properties for Web Support (continued)
Examples
Dynamic Hyperlink
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Dept Details || to_char(:deptno)
Dynamic Bookmark
Company Car Policy, Category || :level
Application Command Line
C:\orawin10g\bin\rwrun.exe report=payload_det.rdf
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Report objects provide many properties that you can modify in the Property Inspector to
alter the appearance and position of objects in your report output.
Common properties exist for most layout objects.
You do not have to make many alterations for most standard reporting needs.
This lesson explained how to use common object properties and gave examples of some
common uses, such as:
Forcing pagination by setting Page Break Before or Page Break After
Format triggers
Web settings
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 12 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 12
1. Create a new break report showing each customer and the relevant orders.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Create a group above master detail report. Use the query p12_1.sql to create
the report.
b. Select Name as the group field and display all the customer data in the break
group. Create a sum for the quantity.
c. Modify the width for the fields listed below:
Column Label Width
name Name: 20
street_address Address: 10
city City: 10
state_province State / Province: 10
postal_code Zip: 5
country_id Country: 2
credit_limit Credit Limit: 6
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Controlling the Paper Layout:
Specific Properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
In the previous lesson, you learned about common object properties. There are however a
number of properties that are unique to the reports and specific types of layout objects.
In this lesson, you learn about specific properties for reports, repeating frames, fields, and
boilerplate. You also learn how to reference the contents of a file at run time. In addition,
you learn to specify the format order for the report sections. Finally, you learn to specify
taxonomy properties for PDF documents.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Properties of a Repeating Frame
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Specifying Print Direction
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Specifying Print Direction (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In diagram 1 opposite, the default print direction of the records is Down. Therefore, the
vertical elasticity property of the enclosing group frame is set to Variable to allow for a
variable number of records, but the horizontal size is fixed.
If you decide to alter the print direction to Down/Across as in diagram 2, you may need to
modify the properties of the enclosing group frame to be variable (diagram 3). If not, the
records still overflow to the next page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Controlling the Number of
Records per Page
1 2
-1- -1-
-2-
-3- -2-
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Controlling Spacing Between Records
Mailing Labels
1
2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Minimum Widow Records
Page 1 Page 1
Page 2 Page 2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Column Mode
Page 1 Page 1
10 20 10 20 30
Page 2 Page 2
20 30 20
Column Mode
You can set Column Mode to Yes to allow the next instance of a repeating frame to begin
formatting before the previous instance completes. Column Mode is used mainly for
master repeating frames or repeating frames that contain fields that may expand vertically
or horizontally (for example, elasticity is Variable or Expand).
Example
The example above shows the use of Column Mode for the department master repeating
frame given three records, 10, 20, and 30. The department repeating frames print
direction is Across, and the employee repeating frames print direction is Down.
Use Column Mode to start formatting department 30 on page 1, and also to align the
overflow for department 20 on page 2.
Note: Column Mode does not make sense for repeating frames that have a print direction
of Across/Down or Down/Across.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Properties of a Field
Properties of a Field
A field is a layout container for a column or a parameter.
A field defines formatting attributes or logic for the data of its related column or
parameter.
The Report Wizard creates one field for each column and places these fields inside a
repeating frame or at report level.
You can create a field in the Paper Layout and relate it to a Data Model column or
parameter.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Properties of a Field (continued)
The Source property provides a list of columns, of which there are three categories:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Columns in the Data Model
Parameters (always listed in uppercase)
System variables, such as todays date and current page number
The datatype of a field depends on its source.
Defining a Format Mask
When you insert a date object (Insert > Date and Time) in the Paper Design or the Paper
Layout, Reports Builder provides sample dates to enable you to pick a format easily.
The format mask property appears in the standard Oracle date format symbols, such as
MM, which displays the number of the month, or Month, which spells out the name of the
month in full.
The list provides all the format masks that exist in your preferences. Modify your
preferences to include the common masks that you use, or enter a different mask in this
property.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
System Variables
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Page Numbering
Page 4 of 4
Example 1
Page 3 of 4
End
Page 2 of 4
Page 1 of 4
Example 2
Report
Title
Page 1 of 1
End
Page 2 of 2
Page 1 of 2
Report
Title
Page Numbering
When the source of a field is one of the system variables for page or panel numbers, you
can define where and how your page numbers are calculated by choosing the Page
Numbering property.
Example 1
To number all the pages in the main section of a report and include trailer section pages
but exclude header section pages, you would specify:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Page Numbering (continued)
Example 2
Oracle University Internal and TransAmerica Training Management Inc Partner use only
To number all pages in the main section of a report, excluding header and trailer pages,
and to restart the numbering at 1 for each new department record in the repeating frame
R_Dept, you would specify:
Page Numbering Property Value
Include Main Section
Start At 1
Increment By 1
Reset At R_Dept
Note: When resetting page numbers for each record in a repeating frame, make sure that
each record starts on a new page. Use the Maximum Records per Page property; this
property of the repeating frame was discussed earlier in this lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Valid Source Columns
G_Region
R_Region
F_1 R_Dept
G_Dept R_Emp
G_Emp F_REPORT
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Valid Source Columns (continued)
Report-Level Fields
Oracle University Internal and TransAmerica Training Management Inc Partner use only
If you create a field outside any repeating frame, that is, at report level, the source column
must be a report-level columnoutside all groups in the Data Model.
System columns, such as current date or page numbers, are report-level columns; you can
use these in report-level fields, or at any lower level of your report. For example, you can
display the current date at report level or within a repeating frame.
You often use the Header section or margin region of each section to display report-level
information.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Displaying File Contents
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Displaying File Contents (continued)
To create a file link object:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. In the Paper Layout toolbar, select the File Link tool. Drag an area in the layout to
create a file link object of the required size.
2. In the Property Inspector, change the name of the object.
3. Enter the name of the file link that you want to include in the output, and the format
of the file.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
When Are the Contents Updated?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Linking and Importing Files
1 2
Import
Link
3 4
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Comparing a File Link and a File Column
Q_EMP
G_EMP
PICTURE F_PICTURE
1
1 The layout field F_Picture depends on its source column PICTURE in the Data
Model. The filename, and therefore the picture, can be different for each record.
2 File Link exists as a layout object only. The same picture repeats for each record.
Comparing a File Link and a File Column
The main difference in creating a file link and a file column is that you create a file link in
the Paper Layout, whereas you create a file column in the Data Model.
The differences between a link file and a file column are:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Specifying the Format Order
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Specifying the Format Order (continued)
You then use report triggers to build a table containing the TOC entries. You learn about
Oracle University Internal and TransAmerica Training Management Inc Partner use only
triggers in the lesson titled Coding PL/SQL Triggers, and how to create a table of contents
in the lesson titled Extending Functionality Using the SRW Package.
Note: Regardless of the order in which the report sections are formatted, the output order
(i.e., visual order) is unchanged: Header section, followed by Main section, followed by
Trailer section.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
PDF Document Taxonomy Properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Report objects provide many properties that you can modify in the Property Inspector.
You do not have to make many alterations for most standard reporting needs.
Common properties exist for most layout objects.
Specific properties exist for individual object types, such as fields and repeating
frames.
This lesson explained how to modify object-specific properties and gave examples of
some common uses, such as:
Controlling spacing between records
Creating a file link
You also learned about some report-specific properties. In this lesson, you learned how to
specify the order in which the Header, Main, and Trailer sections of a report are
formatted. You also learned how to specify metadata for your PDF reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 13 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 13
1. Open report p4q4.rdf.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Modify the layout so that the mailing labels are 2 inches wide and 1 inch high.
Use the Layout option on the menu. Ensure that the customer names are printed
in alphabetical order across the page.
b. Give each label a solid fill.
c. Make the boilerplate object 1.8 inches wide and center it horizontally and
vertically in the repeating frame.
d. Add spacing between the labels: .25 inch between each column of labels across
the page; .5 inch between each row of labels down the page.
e. Run the paper layout to test. Save the report as p13q1.rdf.
2. Continue with report p13q1.rdf.
a. Modify the report so that only six labels are printed on each page.
b. Run the paper layout to test. Save the report as p13q2.rdf and close it.
3. Open p10q1.rdf.
a. On the operating system, copy the file summitlo.tif to a file logo.tif.
b. Delete the logo in the margin area and create a file link in its place to display the
contents of logo.tif.
c. Run the paper layout.
d. On the operating system, copy any other .tif file to logo.tif.
e. Rerun your report.
f. Save the report as p13q3.rdf.
4. Continue with report p13q3.rdf.
a. Ensure that all items of one order are printed on the same page.
b. Save the report as p13q4.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Web Reporting
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
Using Oracle Reports, you can easily publish data from any source, in any format, with
high fidelity to the Web. Earlier in this course, you learned how to build a simple Web
report using the Report Wizard and a standard HTML template supplied by Oracle
Reports.
You can also use your favorite HTML authoring tool to build the static portion of your
HTML page and then add dynamic content to the Web page using the Report Block
Wizard in Oracle Reports.
In this lesson, you learn more about building reports for the Web and how to customize
and enhance your reports using style sheets and the Web Source editor.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
High Quality Web Publishing
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
High Quality Web Publishing (continued)
JSP-Based Runtime Environment
Oracle University Internal and TransAmerica Training Management Inc Partner use only
JavaServer Pages (JSP) technology allows Web designers and developers to rapidly
develop and easily maintain information-rich, dynamic Web pages that leverage existing
business systems. Oracle Reports introduced JSPs as the underlying technology with
which you build and publish dynamic reports for the Internet. You can extend your Web
pages by embedding Oracle Reports custom JSP tags and your own data-driven Java
components into an HTML document. You can integrate Reports custom JSP tags with
Reports data model objects and other Reports tags to add dynamic report output to your
Web page. These tags use the data model, stored in XML, to produce dynamic output, or
invoke JavaBeans that use the data model to create their results. For example, the three-
dimensional (3-D) graphing component uses a custom tag that passes Reports data to the
BI Graph Bean, which creates an image of the graph. The 3-D graphics custom tag then
returns HTML that references the created image.
Reusable components and the open architecture of Oracle Reports makes previously
difficult tasks simple to implement. The ability to incorporate existing Java components
into a report using JSP and servlet technology provides openness. You can also share
business components between Oracle Reports and other applications within your
organization.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Comparing Static and Dynamic Reporting
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Comparing Static and Dynamic Reporting (continued)
Dynamic Reports
Oracle University Internal and TransAmerica Training Management Inc Partner use only
If your requirement is to publish the most recent data available when the information is
requested, a static report will not meet your needs. Your report must be dynamic.
The word dynamic describes something marked with continuous and productive activity
or change. Pertaining to software applications, dynamic refers to operations performed on
the fly that are based on decisions made while a program is executing, instead of
beforehand.
To achieve this in Oracle Reports, you embed a report block within a Web page. Each
time the report is executed, the data is fetched from the data source and the Web page
displays the most current information.
In this lesson, you will add dynamic content to a Web page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding Dynamic Content
</body>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Adding Dynamic Content to a Web Page (continued)
Defining the Data Model
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Remember that every report has a data model and a layout. In Oracle Reports, each report
definition can have a paper layout and a Web layout. Although the layouts are distinct
objects, the data model is shared by both layouts.
Open the existing HTML file in Reports Builder. To define a data model for the Web
page:
1. In the Object Navigator, double-click the Data Model node to display the Data
Model view of the Report Editor.
2. Right-mouse-click in the Data Model painter area and select Data Wizard from the
menu.
3. Name the query as required.
4. Select the Query type.
5. Enter the query as you would using the Report Wizard.
6. Create additional groups as required.
7. Create summaries as required.
Saving Your Report as a JSP File
1. With your report selected in the Object Navigator, select File > Save As.
2. Make sure the file type is Reports JSP (*.jsp), modify the report name if desired,
and click Save.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Report Block
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Report Block (continued)
Example:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
<p><Replace this text with a report block.></p>
Note: < and > represent the less than and greater than signs, respectively.
Reports Builder encodes them in the Web Source to ensure that a browser will not
misinterpret the symbols as HTML elements. The line of code would actually read:
<p><Replace this text with a report block.></p>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Invoking the Report Block Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Examining the Web Source Code
<rw:report id="report">
<rw:objects id="objects">
Data Model & Business Logic (XML)
<layout>
Paper Layout (XML)
</layout>
</rw:objects>
<HTML>
Web Layout (JSP)
Graph (XML)
</HTML>
</rw:report>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Examining the Web Source Code
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
rw:foreach Tag
...
<rw:foreach id="R_G_EMPLOYEE_ID_1" src="G_EMPLOYEE_ID">
<tr>
<td <rw:headers id="HFEMPLOYEEID"
src="HBEMPLOYEEID"/>. . .
<td <rw:headers id="HFEmployee"
src="HBEmployee"/> . . .
...
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
rw:field Tag
...
<td <rw:headers id="HFEMPLOYEEID"
src="HBEMPLOYEEID"/> class="OraCellNumber">
<rw:field id="F_EMPLOYEE_ID" src="EMPLOYEE_ID"
nullValue=" "> F_EMPLOYEE_ID </rw:field></td>
...
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Reports JSPs
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Reports JSPs
Using Style Sheets
<rw:style id="rwbeige">
<link rel="StyleSheet" type="text/css" href="rwbeige.css">
</rw:style>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Customizing Reports JSPs Using Style Sheets (continued)
Example: In the Reports JSP source code shown, the Oracle Reports template rwbeige
Oracle University Internal and TransAmerica Training Management Inc Partner use only
is referenced. Specifically, the style sheet referenced is rwbeige.css. The
EMPLOYEE_ID field in the report uses the OraCellNumber class format. To learn the
attributes of a particular class format, you can view the .css file in a text editor. In this
example, the OraCellNumber class format is:
.OraCellNumber {color: #000000; background-color: #f7f7e7;
font-family: Arial, Helvetica, sans-serif; font-size:
10px ; text-align: right}
The attributes defined are the color of the field text, background color of the field, font,
font size, and text alignment.
To customize the appearance of a class in all your reports, edit the class format settings in
the stylesheet.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Reports JSPs
Using HTML Tags and Attributes
<thead>
<tr>
<th <rw:id id="HBEMPLOYEEID" asArray="no"/>
class="OraColumnHeader"> Employee Id </th>
<th <rw:id id="HBSALARY" asArray="no"/> align="right"
bgcolor="yellow"> Salary </th>
</tr>
</thead>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Reports JSPs
Using Reports Custom Tags
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Customizing Reports JSPs Using Reports Custom Tags (continued)
formatMask: Contains the Reports format mask to be applied to the fields value.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
This attribute is only valid for fields containing number or date data types.
formatTrigger: Contains the name of a format trigger program unit. The executing
program unit sets the fields attributes in the Reports backend structure and the tag
handler picks up those attributes and converts them to HTML.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Reports JSPs
Using Reports Custom Tags
<tbody> <rw:foreach id="R_G_EMPLOYEE_ID_1"
src="G_EMPLOYEE_ID">
<tr>
<td
<rw:headers id="HFSALARY" src="HBSALARY"/>
align=right">
<rw:field id="F_SALARY" src="SALARY"
nullValue=" " formatMask="$999,999.00" >
F_SALARY
</rw:field>
</td>
</tr>
</rw:foreach> </tbody>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Reports JSPs
Using Reports Custom Tags
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Adding Dynamic Content to a Web Page
With Oracle Reports, you can open an existing Web page in Reports Builder and add
dynamic report data to the page.
Use the Data Wizard to define a data model.
Create a report block at the desired location in the Web page using the Web Source
editor and the Report Block Wizard.
Save your report as a Reports JSP.
Reports JSPs
The Web layout for your report definition is delimited by the HTML tags in the source
code. Reports JSP custom tags in this section include rw:foreach, rw:id, and
rw:field.
Customizing Web Reports
Modify the classes in a style sheet file to apply changes to layout settings for all reports
created with that style sheet.
Using the Web Source editor, customize the appearance of selected classes in a report by
using standard HTML tags and attributes as well as Reports custom tag attributes.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 14 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 14
1. Create a new Web report by adding dynamic content to an existing Web page.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Open the mywebpage.htm file in Reports Builder.
b. Define a data model using the Data Wizard. Import the p14q1.sql query.
Use DEPARTMENT_ID and DEPARTMENT_NAME as the group fields.
Include a sum of the salaries.
c. Save the report as p14q1.jsp.
d. Create a report block and add it to the Reports JSP. The Web source code has a
place holder for your report block. Choose the Group Left style and include the
Salaries by Department title. Include all groups and display in the down
direction. Display all fields. Use a label of Name for DEPARTMENT_NAME
and Title for JOB_ID. Select the predefined Beige template.
e. Run the Web layout to test. Save the report.
2. Customize the p14q1.jsp report using JSP tag attributes.
a. Display the salary and summary values with an appropriate currency format.
b. Run the Web layout to test. Did you remember to format the report summary?
Save the report as p14q2.jsp.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Extending Functionality Using XML
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
In an earlier lesson, you were introduced to Extensible Markup Language, or XML. Recall
that XML enables business-to-business exchanges of data across applications and
platforms. You learned how to use XML as a data source in a report.
It is also possible to build a report definition using XML tags. This XML report definition
can be run by itself or can be applied to another report at run time to customize the output
for a specific audience.
In this lesson, you will learn how to build a report using XML tags, apply customizations
to a report at runtime, and apply batch update to existing reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Why Use XML Report Definitions?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Why Use XML Report Definitions? (continued)
Run-Time Customizations
Oracle University Internal and TransAmerica Training Management Inc Partner use only
You can apply customizations to change the look and feel of a report at run time without
changing the original report. This allows for a report to be different for different
audiences. For example, labels can be designed according to geography, or colors and
format masks can be designed on a per user or user group basis.
Furthermore, Oracle Reports extends the possible types of Reports XML customizations
by enabling you to create an entire Data Model in XML. This includes the creation of
multiple data sources, linking between data sources, and group hierarchies within each
data source. Data Model support through Reports XML customization means that any
Data Model that can be created with Reports Builder can now be created by specifying
XML. You can also set properties for Data Model objects using XML.
Batch Updates
Using an XML report definition, you can apply batch updates to existing reports. You
have the option of saving the combined definition to a file. The advantage is that you can
quickly update a large number of reports without having to open each file in Reports
Builder to make the changes.
Building Fully Functional Reports
If you can generate XML tags, you can create a fully self-contained report definition that
can be run by Oracle Reports. Using an XML report definition, you can build reports on
the fly without using Reports Builder.
Product Openess
XML support in Oracle Reports provides a mechanism for exchanging data with third-
party applications. It also offers a way to furnish data to tools that accept XML output for
data analysis, and XML is easily displayed on the Web.
Technical Note
For more information see the section Customizing Reports with XML in the Oracle
Application Server Reports Services Publishing Reports manual.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating XML Report Definitions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating and Using XML Report Definitions (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The following is a sample of a partial report definition:
<report name="employee" DTDVersion="1.0">
<layout>
<section name="main">
<field name="f_sal" source="sal" textColor="red"/>
<field name="f_mgr" source="mgr" fontSize="14"
font="Roman"/>
<field name="f_deptno" source="deptno" fontStyle="bold"
fontEffect="undereline"/>
</section>
</layout>
</report>
Every XML report definition, whether full or partial, must contain the required tag pair,
<report> </report>. The <report> tag indicates the beginning of the report customization,
its name, and the version of the Document Type Definition (DTD) file that is being used
with this XML customization. The </report> tag indicates the end of the report
customization. A full report requires both a data model and layout and therefore requires
the <data></data> and <layout></layout> tags and their contents.
The report name attribute in the <report> tag can be any name you wish, and can be
different than the name of the .rdf file. The name attributes in the <field> and <section>
tags match the names of the fields and sections. As a result, the attributes will be applied
to the fields and sections listed.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Partial Report Definitions:
Format Modification Example
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Partial Report Definitions (continued)
Formatting modification example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
<report name="sales" DTDVersion="1.0">
<data>
</data>
<layout>
<section name="main">
<field name="f_orderdate"
source="orderdate"
formatMask="MM/DD/RR"/>
<field name="f_prodid"
source="prodid"
lineColor="black"
fillColor="r100g50b50"/>
<field name="f_current_price"
source="price"
lineColor="black"
fillColor="r100g50b50"/>
</section>
</layout>
This XML definition does not add data because the <data> tag is empty. The purpose is to
apply the formatting attributes mentioned in the <field> tags for the fields in the reports
main section.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Partial Report Definitions:
Format Exception Example
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Partial Report Definitions (continued)
Formatting exception example:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
<report name="emp" DTDVersion="1.0">
<data>
</data>
<layout>
<section name="main">
<field name="f_sal" source="sal">
<exception textColor="red">
<condition source="sal" operator="gt"
operand1="1000"/>
</exception>
</field>
<field name="f_bonus" source="bonus">
<exception textColor="blue">
<condition source="bonus" operator="gt"
operand1="10"/>
</exception>
</field>
</section>
</layout>
</report>
This XML definition adds formatting exceptions to the F_SAL and F_BONUS fields.
Notice the use of the <exception> tag. However, the formatting change will only be
applied when the criteria defined in the <condition> tag is met.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Full Report Definition:
Data Model Modification Example
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Full Report Definition
Data model modification example:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
<report name=DataMod" DTDVersion="1.0">
<data>
<dataSource name="Q_sal_summary">
<select>
select l.city loc_name,sum(e.salary) totsal
from locations l,departments d,employees e
where l.location_id = d.location_id
and d.department_id = e.department_id
and l.location_id > :loc_nr
group by l.city,d.department_name
</select>
</dataSource>
</data>
<layout>
<section name="header">
<tabular name="Sal_summary" template="rwgray.tdf">
<labelAttribute font="Arial"
fontSize="10"
fontStyle="bold"
textColor="white"/>
<field name="f_loc_name"
source="loc_name"
label="Location Name"
font="Arial"
fontSize="10"/>
<field name="f_totsal"
source="totsal"
label="Total Sal"
font="Arial"
fontSize="10"/>
</tabular>
</section>
</layout>
</report>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Full Report Definition:
Data Model Modification Example
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Full Report Definition (continued)
The query uses column aliases. If you do not use an alias, the name of the column is
Oracle University Internal and TransAmerica Training Management Inc Partner use only
assigned by default and could be something you do not expect. This is important for
the <field> tag, where you must specify the correct name and source of the column.
Notice the presence of the <labelAttribute> tag. This tag defines the formatting
attributes for field labels. Because it is used outside the <field> tag, it is global and
pertains to all labels in this tabular layout. Be aware that if there is both a global and
local <labelAttribute>, the local one overrides the global one.
Notice the use of the SUM function in the query. You could use the <summary> tag to
define a summary column in the data model of the report definition if you wanted.
This is a performance issue. If calculations are included in SQL, they are performed
before the data is retrieved rather than performed on the retrieved data by Oracle
Reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running XML Report Definitions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Running XML Report Definitions (continued)
Applying One XML Report Definition
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The following command line sends a job request to OracleAS Reports Services and
applies the XML report definition emp.xml to the employee.rdf file.
rwclient userid=scott/tiger@db1 report=employee.rdf
customize=d:\rep10g\custom\emp.xml
destype=file desname=emp.pdf desformat=PDF
server=repsrv1
The equivalent Reports Runtime command line would be:
rwrun userid=scott/tiger@db1 report=employee.rdf
customize=d:\rep10g\custom\emp.xml
destype=file desname=emp.pdf desformat=PDF
Applying Multiple XML Report Definitions
You can apply multiple XML report definitions to a report at run time by providing an
argument list with the CUSTOMIZE keyword. The following command line sends a job
request to OracleAS Reports Services and applies two XML report definitions,
emp0.xml and emp1.xml, to the .rdf file employee.rdf:
rwclient userid=scott/tiger@db1 report=employee.rdf
customize="(d:\rep10g\custom\emp0.xml,
d:\rep10g\custom\emp1.xml)"
destype=file desname=emp.pdf desformat=PDF
server=repsrv1
Multiple files are applied in the order listed in the CUSTOMIZE argument. The last
definition applied overrides any similar modifications made by a prior definition.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running XML Report Definitions
Run by itself
Batch updates
rwconverter source="(...)"
dest=... customize=...
batch=yes
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Running XML Reports Definitions (continued)
Performing Batch Updates
If you have a large number of files that must be updated, you can use the CUSTOMIZE
Oracle University Internal and TransAmerica Training Management Inc Partner use only
command line argument with the RWCONVERTER command. Batch modifications are
particularly useful when you must make a repetitive change to a large number of reports
(for example, changing a field's format mask). Rather than opening each report and
manually making the change in Reports Builder, you can run RWCONVERTER once and
make the same change to a large number of reports at the same time.
The following command line applies two XML report definitions to three different reports
and saves the new definitions in the file system:
rwconverter userid=scott/tiger@db1
stype=rdffile
source="(emp1.rdf,emp2.rdf,staff.rdf)"
dtype=rdffile
dest="(emp1_new.rdf,emp2_new.rdf,staff_new.rdf)"
customize="(d:\rep10g\custom\labels.xml,
d:\rep10g\custom\format_mask.xml)"
batch=yes
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Debugging XML Report Definitions
XML parser
Tracing option
Using Reports Builder
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Debugging XML Report Definitions (continued)
The Trace Option
For testing purposes, you may want to activate the trace facility when you run your report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The example below shows a command line that has three trace options.
rwrun scott/tiger@db1 report=D:\rep10g\custom\emp.xml
tracefile=emp.log tracemode=trace_replace
traceopt=trace_app
Using Reports Builder
It is sometimes useful to open an XML report definition in Reports Builder while you are
still working on it. This will allow you to quickly determine if all objects are created as
expected. For example, if you are creating summaries in an XML report definition, then
opening the definition in Reports Builder enables you to quickly determine if the
summaries are being placed in the appropriate group in the Data Model.
Technical Note
For more information on the XML parser, refer to the Oracle Technology Network
(http://otn.oracle.com).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Using XML report definitions:
- Run-time customizations
- Batch updates
- Stand-alone reports
Applying XML report definitions:
- From the command line
- From PL/SQL
Debugging XML report definitions:
- The XML parser
- The trace option
- Using Reports Builder
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 15 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 15
1. Run an XML report definition.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Open p15q1.xml using Wordpad. Examine the code. What type of report
definition is this? What goes on in this file?
b. Execute p15q1.xml using the Run Paper Layout option in Reports Builder.
2. Apply run-time customizations.
a. Open p15q2.rdf. Run the paper layout.
b. What type of report is this? Investigate the data model, the paper layout, and the
report sections.
c. Open p15q2.xml. Examine the code. What goes on in this XML definition
file?
d. Apply p15q2.xml to p15q2.rdf using the RWRUN command and send
the output to a PDF file.
e. Examine the newly created report output. What do you see?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating and Using Report Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
Parameters enable you to develop dynamic report documents that produce variable report
output depending on the parameter value that you enter at run time. This lesson shows you
how to create and reference user and system parameters and how to customize a Paper
Parameter Form to display parameters at run time.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating User Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating User Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating User Parameters (continued)
Parameter Properties
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Property Description
Datatype Specify whether parameter value is Character, Number, or
Date; default is Number when created in the Object
Navigator.
Width Specify maximum allowable width of parameter value;
maximum is 64 KB.
Input Mask Allow users to enter a numeric or date value using a specific
format.
Initial Value Specify the value to use. You can override this value at run
time from the command line or parameter form.
Validation Trigger Validate the parameter value. Enter a PL/SQL function.
List of Values Create a list of values from which users select a valid value
at run time.
Type of Pluggable Used by the PDS for acquiring single sign-on information. It
Data Source identifies that parameter as containing sign-on information
for that PDS connection.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Referencing Parameters in a
Report Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Referencing Parameters in a Report Query (continued)
What Is a Lexical Reference?
Oracle University Internal and TransAmerica Training Management Inc Partner use only
A lexical reference is a placeholder that is used to replace any part of a SELECT
statement, such as column names, the FROM clause, the WHERE clause, or the ORDER
BY clause.
To create a lexical reference in a query, prefix the parameter name with an ampersand
(&).
A lexical reference for a column or table must be created explicitly in the Object
Navigator before you can use it in a query. For other clauses in the SELECT statement, if
the parameter object does not exist, Reports Builder automatically creates it for you and
displays a message. In this case, the parameter default datatype is CHARACTER, not
NUMBER.
Comparing Bind and Lexical Reference Types
Type Prefix Use to Replace Parameter Created by Default?
Bind : Single value or expression Yes, if it does not already exist.
in Reports Builder displays a warning
the following clauses: message and adds the parameter to
WHERE, GROUP BY, User Parameters in the Object
ORDER BY, HAVING, Navigator.
CONNECT BY, START
WITH
Lexical & Any part of a SELECT Provided it is not used for a column
statement or table, yes: if it does not already
exist. Reports Builder displays a
warning message and adds the
parameter to User Parameters in the
Object Navigator. Datatype must
always be Character.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Bind References
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Bind References (continued)
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
Oracle University Internal and TransAmerica Training Management Inc Partner use only
FROM CUSTOMERS
ORDER BY DECODE(:SORT, 1, CUST_LAST_NAME,
2, NLS_TERRITORY,
ACCOUNT_MGR_ID)
This statement enables you to output different versions of the report:
Enter 1 for the parameter SORT to display the output ordered by customer name.
Enter 2 to display the output ordered by NLS_territory.
Where Can You Not Use Bind References?
You cannot use a bind reference to:
Replace a column name in the SELECT clause, although you can reference a value,
such as the contents of a parameter:
SELECT LAST_NAME, SALARY * :P_RATE
FROM EMPLOYEES
Replace any part of a FROM clause
Replace reserved words or clauses
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Lexical References
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Lexical References (continued)
To specify a WHERE clause, ORDER BY clause, or both at run time (as one
parameter):
Oracle University Internal and TransAmerica Training Management Inc Partner use only
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
FROM CUSTOMERS
&P_WHERE_ORD_CLAUSE
To specify two column names and the table names at run time:
SELECT &P_CUSTNAME CUST, &P_ACCTMGR MGR
FROM &P_TABLE
In this example, you must create the parameters first and provide each with an initial
value to ensure that the SELECT statement is syntactically correct when parsed.
Note: When you use lexical references in the SELECT list, you must, at run time, specify
the same number of items of the correct data type, as defined in the Data Model.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Hints and Tips When Referencing
Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Hints and Tips for Referencing Parameters (continued)
Example:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The following statement does not cause a syntax error when P_ORDER_CLAUSE is
NULL.
SELECT...FROM...
&P_ORDER_CLAUSE
The following statement does cause a syntax error when P_ORDER_CLAUSE is NULL.
SELECT...
FROM...
ORDER BY &P_ORDER_CLAUSE
Remember to define an initial value for lexical parameters that affect the validity of the
statement, and to validate those that you allow a user to enter at run time. Initial values are
required for lexical parameters used for column names, table names, and incomplete
clauses as shown in the example above.
Note: Always use column aliases when substituting column names with lexical
references.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a List of Values
2 3
4
5
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a List of Values (continued)
To create a static list of values:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. In the Parameter Property Inspector, Select the List of Values property. The Static
Values option button is selected by default.
2. Enter a value in the Value field and click Add.
3. Repeat for each value you want in the list.
Note: To remove a value, select the value in the list and click Remove.
Set the Restrict List to Predetermined Values property to determine whether to prevent
users from entering any value not included in your list. By default, this property is Yes. If
you set the property to No, users can still select a value from the list, but they can also
enter other values or leave the value blank.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a List of Values
1
3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a List of Values (continued)
To see a more meaningful list of descriptive values, instead of the primary or foreign key
Oracle University Internal and TransAmerica Training Management Inc Partner use only
column that you reference in the query, select Hide First Column.
Make sure that the primary or foreign key column is first in the SQL query statement,
because this is still the value that the parameter object contains at run time.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Referencing System Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Referencing System Parameters (continued)
The system parameters are:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Parameter Use to specify Values Default
COPIES Number of copies that Any integer 1
should be made if the report
is printed
DESFORMAT Either the output format for Examples: PDF, dflt
the report, or the printer HTML, HTMLCSS,
definition to use when RTF, XML
formatting the report when
DESTYPE=FILE and
DESNAME=filename
DESNAME Name of output device, such <reportname>.lis
as filename, printer name,
mail userid
DESTYPE Type of device that will Cache, localfile, file, Cache
receive the report output printer, sysout, mail,
oracleportal, ftp,
webdav, screen,
preview
MODE Whether report executes in Default, bitmap, Default
bitmapped or character mode Character
ORIENTATION The print direction of printer Default, portrait, Default
output Landscape
PRINTJOB Whether print job dialog box Yes, No Yes
is displayed at run time, if
destype=file or printer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Building a Paper Parameter Form
+ Report properties:
Width
Height
Number of Pages
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Building a Paper Parameter Form (continued)
If you create many parameters in your report, the run-time parameter form can spread
Oracle University Internal and TransAmerica Training Management Inc Partner use only
over more than one page. You can view subsequent pages at run time by clicking Next.
Setting Report Properties for the Parameter Form
There are three properties in the Report Property Inspector, under the Parameter Form
Window node, that specifically apply to the parameter form.
Report Property Use to
Width Define the width of the parameter form that
the user sees at run time
Height Define the height of the parameter form that
the user sees at run time
Number of Pages Define the number of physical pages that
make up the parameter form
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing a Paper Parameter Form
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Customizing a Paper Parameter Form (continued)
Creating Parameter Boilerplate Objects
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Parameter boilerplate is text or graphics that either you create or the Parameter Form
Builder creates by default.
The Parameter Form Builder creates parameter boilerplate objects for the labels of each
parameter field as well as for the title, hint, and status lines.
You can create additional boilerplate objects to customize your parameter form, for
example, create report heading pages, modify default labeling, insert images, and so on.
Note: You cannot create a file link in the parameter form; however, you can insert file
contents, as you can in the layout.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Parameter Form HTML Extensions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Parameter Form HTML Extensions (continued)
To create a boilerplate text object for HTML tags:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Create a boilerplate text object using the Text tool.
2. Enter or import the desired HTML code.
3. Open the Property Inspector of the text object and set the Contains HTML Tags
property to Yes.
Note: The text only shows for HTML output formats.
To create HTML parameter form fields with input or select events:
1. Create or edit a Parameter Form field.
2. Open the Property Inspector of the Parameter Form field and set the Additional
Attributes(HTML) property to a valid JavaScript event handler.
Note: In some cases, such as raising messages, the JavaScript code may have to be
entered in the Before Form report properties. To insert the JavaScript code in the
Before Form report properties:
- Open the report Property Inspector.
- Set the Before Form Type property to Text if you enter the JavaScript code, or to
File if you will import the code from a file.
- Set the Before Form Value property by clicking the ... button to either enter the
JavaScript, or select the HTML file with the JavaScript.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Parameter Form Header and Footer
Header
Footer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Parameter types:
- User parameters:
References: bind or lexical
List of values: dynamic (bind only) or static
- System parameters
Modifying parameter values at run time:
- Pass the parameter on the RWRUN command line
- Allow users to change values in the run-time parameter form
Creating a run-time parameter form:
- Build a parameter form with the Parameter Form Builder
- Customize the paper parameter form layout in the Report editor
- Evaluate using HTML Parameter Form extensions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 16 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 16
1. Open report p13q3.rdf.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Modify the data model and add the following columns from the CUSTOMERS
table. Create a new group for the customer information above the
G_ORDER_ID group.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 16 (continued)
4. Continue with report p16q2.rdf.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Create a default parameter form.
Include a Title message but not a Hint message.
Display the P_CUSTOMER parameter.
b. Use your imagination to customize the form in the Parameter Form editor.
Make sure that the parameter P_CUSTOMER is placed in a prominent position
for user entry.
Add some graphics; modify colors and fill patterns.
c. Add a format mask to the field displaying line_total.
d. Run the paper layout to test. Select a customer from the list.
e. Save the report as p16q4.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Embedding a Graph in a Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
In this lesson, you learn to display a graph in a report at run time.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding a Graph to a Paper Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating and Embedding a Graph in a Report (continued)
From the Paper Design view:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Select Insert > Graph from the menu. The Graph Wizard displays.
2. Step through the Wizard pages to create the desired graph and position it in your
report.
To reenter the Graph Wizard, do either of the following:
Right-mouse-click and select Graph Wizard
Click the graph and select Edit > Settings from the menu.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding a Graph to a Web Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Selecting the Graph Type
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Selecting the Graph Data
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding Options to the Graph
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Adding Options to the Graph (continued)
Use the X-Axis page to specify options for the x-axis of your graph. Options include
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the text and font of the axis title, and axis line style and color. You can insert
parameters into the axis labels by clicking the Insert button and selecting the desired
parameter.
Similarly, use the Y-Axis page to specify options for the y-axis of your graph.
Use the Plot Area page of the Graph Wizard to specify how the plot area of the graph
should be displayed. Options include gridlines, the line color and style for gridlines,
data lables, and data tips (tooltips displayed when the mouse is moved over a bar, pie
slice, etc.).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Web Graphs
Graph XML
</rw:graph>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The rw:graph Tag
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
The rw:graph Tag (continued)
Use the Web Source editor to modify or add attributes. In the previous slide, the width and
Oracle University Internal and TransAmerica Training Management Inc Partner use only
height attributes were included to customize the size of the graph in the Web report. The
graph hyperlink will invoke a drill down report on a specific employee.
You can also customize a graph by modifying the graph XML.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing Graphs Using
the Graph.XML File
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Customizing Graphs Using the Graph.XML File (continued)
The Graph.DTD File
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The list of all possible graph attributes is contained in a file called Graph.dtd. You can
locate this file in ORACLE_HOME\jlib\bigraphbean.jar. Use the WinZip utility
to unzip the contents of this JAR file. You can then use a text editor to view the
Graph.DTD file.
Technical Note
For more information on graphs and the graph attributes that can be specified in the
Graph.XML file, see the Oracle Reports 10g Frequently Asked Questions on the Oracle
Technology Network:
http://otn.oracle.com/products/reports/index.html
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Graph Hyperlinks
Document
on same
machine
Any
destination
Any URL
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Graph Hyperlinks (continued)
Examples:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
A document on the same machine:
file:///C:corp_policy/car/lease.pdf
A destination within the current report:
#sales_rep&<Total_Profit>
Any URL:
http://wlord-pc.us.oracle.com:7777/myexamples/
emp.jsp?server=rep1-wlord&userid=hr/hr@wl81&
destype=cache&desformat=htmlcss&emp_id=&EMPLOYEE_ID
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Technical Note
When delimiting parameters in a URL, you can use the ampersand (&) or the plus sign
Oracle University Internal and TransAmerica Training Management Inc Partner use only
(+). The ampersand is more commonly used and recommended. The ampersand
immediately preceding EMPLOYEE_ID indicates substitution.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Use the Graph Wizard to create and embed a simple graph in your report.
Reenter the Graph Wizard to make changes to the graph object, such as its position in
the report.
Customize a graph in a Web report by editing the attributes of the Reports JSP custom
tag, rw:graph.
Customize graphs by specifying additional graph attributes in the Graph.XML file.
Use the graph hyperlink property to implement drill-down functionality.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 17 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 17
1. Open report p17q1a.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Run the paper layout to become familiar with the report.
b. Rename SumCust_totalPersales_rep_id to Total_Sales (a shorter, more
meaningful name looks better in a chart).
c. Use the Graph Wizard to create a line chart.
Graph Type Bar
Graph Subtype Bar
Position at the end of the report
Category sales_rep_id
Data total_sales
d. Run the paper layout to test. Resize the graph in the Paper Layout, if necessary.
e. Save report as p17q1.jsp.
2. Reenter the Graph Wizard to change the characteristics of the graph created in the
previous exercise.
a. Give the graph the following characteristics:
Title Order Total per Sales Rep
Graph Type Horizontal Bar
Graph Subtype Bar
b. Run the paper layout to test.
c. Save report to p17q2.jsp.
3. Continue with report p17q2.jsp.
a. Run the Web layout. What do you see?
b. Update the Web source with the correct column name.
c. Run the Web layout again to test.
d. Add a graph to the Web source. Position the graph at the beginning of the report.
Graph Type Bar
Graph Subtype Bar
Position at the end of the report
Category sales_rep_id
Value total_sales
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 17 (continued)
4. Open report p9q3.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Use the Graph Wizard to create a pie chart for the data group G_PRODUCT.
Invoke the Graph Wizard with the focus on the Paper Layout.
Graph Type Pie
Graph Subtype Pie
Graph Frequency Once per Name
Data Group G_PRODUCT
Category product_id
Data prod_total
b. In the Paper Layout, ensure that the graph is postitioned beneath the product
group.
c. Run the paper layout and test the report.
d. Save the report as p17q4.jsp.
5. Continue with report p17q4.jsp.
a. Add a bar graph to the Web source for the data group G_PRODUCT. Use the
same data group, category, and value settings as in the previous exercise.
Hint: You want to insert the graph just before the termination of the rw:foreach
tag for the group G_NAME.
b. Run the Web layout to test. Ensure that a graph displays for each sales
respresentative.
c. Resize the graph to a width of 800 and a height of 450.
d. Save the report as p17q5.jsp. Run the Web layout to test.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enhancing Matrix Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
Matrix or cross product reports show cells of information that relate to values appearing
across the top and down the left side of the report.
In an earlier lesson, you created a matrix report using the Report Wizard. In this lesson,
you modify the Data Model and layout objects to enhance your matrix reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Matrix Data Model
4
2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
The Matrix Data Model (continued)
There is an extra group that surrounds the row and column groups. It is called the cross
Oracle University Internal and TransAmerica Training Management Inc Partner use only
product group and contains the summary column that forms each cell value, SumSalary,
as well as the summaries to total the row and column values.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Matrix Paper Layout
F_department_na F_Sumsalary
1 2 3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
The Matrix Paper Layout (continued)
For the simple matrix style, the Report Wizard creates:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
One repeating frame with print direction of Down to hold the row values
One repeating frame with print direction of Across to hold the column values
A field for the summary of the cell values; the source is SumSalary, which resides in
the cross product group
Fields for the row and column values, as well as for the row, column, and report
summaries if applicable
A matrix object that corresponds to the cross product group; this object intersects the
row and column repeating frames, and contains the cell field.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Matrix Summaries
F_CITY 1
2 F_SumsalaryPerJOB_I F_SumsalaryPerCITY
F_SumsalaryPer
3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating Matrix Summaries (continued)
Setting the Product Order
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Wizard sets a sensible default for this property. You do not need to alter the setting,
but you need to understand this property if you create complex matrix reports, or add
columns to an existing matrix report.
The product order defines the order in which Reports Builder evaluates the groups in the
cross product for a summary.
Product Order also defines the frequency of a summary, formula, or placeholder column
in a cross product group. That is, the column has one value for each combination of values
in its Product Order groups.
The Product Order list of values provides all possible group combinations.
In the matrix report:
F_SumSalPerDEPARTMENT_NAME has one value for each department
(G_DEPARTMENT_NAME).
F_SumSalPerJOB_ID has one value for each job ID (G_JOB_ID).
F_SumSALARY, the matrix cell, has one value for each combination of
G_DEPARTMENT_NAME and G_JOB_ID, so the Product Order is
G_DEPARTMENT_NAME G_JOB_ID.
Source Column Reset At Product Order
F_SumSALPerDEPARTMEN_ G_DEPARTMENT_ G_DEPARTMENT_NAM
NAME NAME E
F_Sum_SALPerJOB_ID G_JOB_ID G_JOB_ID
F_SumSALARY G_JOB_ID G_DEPARTMENT_NAM
E
G_JOB_ID
The Reset At option has the same effect as in other report styles. When you create
summaries with the Wizard, each summary resets for each occurrence of the group. For
example, the department summary resets for each department. If you want the summary
values to accumulate throughout the report, change Reset At to a higher level, such as
Report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating the Matrix Manually
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating the Matrix Manually (continued)
Building the entire matrix report manually:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. In the Object Navigator, create a new report and select Build a new report manually
from the dialog box.
2. In the Data Model, click the appropriate tool and move the cursor in the Data Model
editor.
3. Enter the query.
4. Drag the title bar of the single group object down to create some space.
5. Drag the row column up left into the space you just created.
6. Drag the column column up right into the space you just created.
7. Click the vertical toolbar, click the Cross Product tool, and drag a box around the
two groups you want to include in the cross product group.
8. Invoke the Report Wizard to create the paper layout.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Matrix with Group Data Model
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Matrix with Group Layout
Region: F_CITY
F_SumsalaryPerTITLE F_SumsalaryPerCITY
Total: F_SumsalaryPer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Building a Nested Matrix
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Building a Nested Matrix (continued)
To recreate the cross product group:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Delete the existing cross product group.
Note: The cross product summaries are automatically deleted.
2. Create the new groups that you need.
3. Recreate the cross product group. Use the cross product tool (AxB) to click and drag
a region surrounding the break groups and the two dimension groups (rows and
columns).
4. Use the reenterable Wizard to re-create the summaries.
Note the differences between the data models for a Nested Matrix and a Matrix with
Group:
Matrix with Group Data Model: The cross product group is the child of a parent
break group at a level above and outside the cross product.
Nested Matrix Data Model: The cross product contains three or more groups, one or
more levels of break group and two dimensional groups to form rows and columns.
Note: You can mix these styles. That is, you can create a Matrix with Group report where
the matrix has several nested levels within it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Nested Matrix Paper Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Nested Matrix Paper Layout (continued)
Creating a Matrix Object
Oracle University Internal and TransAmerica Training Management Inc Partner use only
When possible, use the Wizard to create your matrix reports, because the layout consists
of many layers and interdependent objects.
If you resize the repeating frames, take care to maintain the intersection between them,
otherwise you might destroy the matrix object. Reports Builder gives you a warning
message if this is likely to happen.
If you destroy the matrix object, or want to create the matrix structure yourself, you must
re-create the matrix object. Each matrix object intersects and determines the relationship
between two and only two repeating frames.
To create the matrix object:
1. Make sure that the two related repeating frames intersect each other correctly.
2. Select both repeating frames [Shift]-Click.
Note: If you do not select both frames, you receive an error message:
REP-3100: Matrix must include at least 1 Down and 1
Across repeating frame.
3. Select Insert > Layout Matrix.
4. Move the matrix object back through the layout layers until it is behind the cell field
(Layout > Move Backward). This step is not necessary to make the report run, but it
is useful to see the cell field if the matrix has a solid fill.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Nested Matrix Summaries
F_SumSALARY F_SumSALPerDEPA
F_Sum_CITY
F_SumSALPerJOB_
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating Nested Matrix Summaries (continued)
The Product Order indicates the way in which Reports Builder evaluates a summary.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Product Order also determines the position (frequency) of the summary if you use the
reenterable Wizard.
The diagram on the previous slide shows three summary fields created by the Wizard:
F_SumSALPerJOB_ID: Total salary for each column of job ID. Displayed once for
each job ID.
F_SumSALPerDEPARTMENT_NAME: Total salary for each department row
nested within a specific city row. Displayed once for each combination of
city/department.
F_SumSALARY: The cell value. Displayed once for each combination of city/
department name/job ID.
Field Name Reset At Product Order
F_SumSALPerJOB_ID G_JOB_ID G_JOB_ID
F_SumSALPerDEPART- G_DEPARTMENT_N G_CITY
MENT_NAME AME G_DEPARTMENT_NAME
F_SumSALARY G_DEPARTMENT_N G_CITY G_JOB_ID
AME G_DEPARTMENT_NAME
The diagram also shows a fourth summary, F_Sum_CITY, which you might want to
create yourself to produce a subtotal for each region.
1. Create another summary in the cross product group.
2. Create a layout field and place it as shown in the diagram, in the R_G_CITY
repeating frame (use the Object Navigator to identify it). The following table shows
the property settings.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Displaying Zeros
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Displaying Zeros in Cells with No Value (continued)
To display zeros in cells with null values, open the Property Inspector for either the cell
Oracle University Internal and TransAmerica Training Management Inc Partner use only
field or the SumSalary summary column and set the Value if Null property to zero.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Letting the Wizard and Template Work for You
Use the Report Wizard to create your matrix, even if you need to modify it later. Allowing
the Wizard to create the initial Paper Layout saves you a lot of time.
If you make many modifications to your Wizard reports, consider creating or modifying a
template to include object spacing horizontally and vertically, between frames, fields, and
so on. This helps you to select and manipulate the objects in the Paper Layout.
Note: You can override the default template properties for the Matrix and Matrix with
Group sections of an existing template.
Matrix Structure
The Data Model and Paper Layout of a matrix report contain special features, and
relationships between objects, to reflect the cross product structure of the report.
Matrix-Specific Objects and Properties
Matrix reports include special objects and properties:
Data Model: Cross product group; Product Order property
Paper Layout: Matrix object
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 18 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 18
1. Open report p4q6.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. How many repeating frames do you have?
b. Change the properties of the cell object to display zero for a null value.
c. Run the paper layout to test the report.
d. Close the report without saving it.
2. Create a new report, importing the query p4q6.sql from your working directory.
a. Select the following settings:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 18 (continued)
f. Use the Data Model view to create summaries for each month and for the level
Oracle University Internal and TransAmerica Training Management Inc Partner use only
month and product.
Property Value
Name SumMonth
Product Order G_MONTH
Function Sum
Source SumTOTAL_VALUE
Reset At G_MONTH
Property Value
Name SumMonthProduct
Product Order G_MONTH G_PRODUCT_ID
Function Sum
Source SumTOTAL_VALUE
Reset At G_PRODUCT_ID
g. Use the Paper Layout view to create the fields. You must expand the appropriate
repeating frame.
h. Run the paper layout to test the report.
i. Save the report as p18q2.jsp. Do not close it.
3. Continue with the report from the previous exercise.
a. Add zeros for null values in the cells.
b. Ensure that the report shows only three product columns on each page.
c. Format all numeric data to be right aligned.
d. Add commas and two decimal places where appropriate.
e. Run the paper layout to test the report.
f. Save the report as p18q3.jsp and close it.
If You Have Time
4. Open the report as p18q3.jsp.
a. Make the necessary changes in the Data Model view to include the product
name.
b. In the Paper Layout view, delete the product_id field and insert a boilerplate
object to display the product name. Rotate this object by 90 degrees.
Note: You may have to expand the R_G_PRODUCT_ID frame and the
outermost frame. Watch out for frequency errors.
c. Run the paper layout. Save the report as p18q4.jsp.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Coding PL/SQL Triggers
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
This lesson identifies different trigger types and creates conditional trigger code to control
report output. It also explains how to improve productivity and maintenance by sharing
and reusing commonly referenced code. Finally, you will learn about publishing reports
based on database events.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Types of Triggers in Reports
Report:
Five triggers
Report Triggers node in Object Navigator
Data Model:
Formula (column)
Filter (group)
Parameter validation
Layout: Format trigger on most objects
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Types of Triggers in Reports (continued)
Data Model:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
- Column formula fires each time the column is processed.
- Group filter fires for each record in the group.
- Parameter validation fires when the run-time parameter form is displayed and
when the user leaves the parameter field.
- Access Data Model triggers in the Property Inspector of a Data Model object
column, group, or parameteror the corresponding layout objectfield, repeating
frame, or parameter field.
Layout:
- Format triggers on most paper layout objects (excluding anchors). Each trigger
fires as the layout object is processed.
- Access format triggers in the Property Inspector of a paper layout object.
- For Web layouts, use the formatTrigger attribute in the rw:field tag.
Note: Reports Builder does not allow data manipulation language (DML)
commandsINSERT, DELETE, UPDATEin layout format triggers.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Trigger Code
Boolean:
true
false
Character
Number
Date
Trigger Code
When you create a trigger such as a report trigger or a PL/SQL formula, the Program Unit
editor supplies a template for the function block, giving the basic syntax that you require.
You can change the name of the function.
The value that you return must match the return data type in the function declaration.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Report Triggers
Before
Parameter F
Form
1 2 If readonly=yes 3
F
If > 1 page
After Between After
Before page1 page2
Parameter Pages Report
Report
Form
F F
1 If After Parameter Form returns FALSE, the cursor returns to the run-time
parameter form. If the run-time parameter form is not displayed, control returns
to the calling program.
2 If READONLY=Yes, Reports Builder implicitly sets the readonly transaction
(SET TRANSACTION READONLY) after the Before Report Trigger fires.
3 If READONLY=Yes, Reports Builder implicitly ends the
read-only transaction (COMMIT) after the final page and before the After
Report Trigger fires.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Report Triggers (continued)
You can access the report triggers from the Object Navigator. Open the Report Triggers
Oracle University Internal and TransAmerica Training Management Inc Partner use only
node and double-click the object icon of the required trigger to open the program unit.
Trigger Fires Use to
Before Parameter Before run-time parameter form Access and change parameter
Form is displayed; fires even if values (initial or command
parameter form is suppressed line), global variables; create
temporary tables; insert into
tables to be queried
After Parameter After run-time parameter form Access and change parameter
Form is displayed; fires even if values (initial, command line,
parameter form is suppressed or user-entered); create
temporary tables; insert into
tables to be queried
Before Report Before a report executes; after Carry out initialization
queries are parsed, but before procedures
records are fetched
Between Pages Before each page is formatted, Carry out customized page
except the first page; in formatting; insert or update
Previewer, fires only once for values in tables
each page, even if you revisit
the page
After Report After report output is sent to its Clean up initial processing,
destination; fires on success such as deleting temporary
only tables
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Report Triggers
Query syntax
SELECT CUSTOMER_ID, CUSTOMER_NAME
FROM CUSTOMERS
&p_where_clause
ORDER BY CUSTOMER_NAME
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Report Triggers: Creating a Dynamic WHERE Clause (continued)
There are two possibilities at run time:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The bind parameter is NOT NULL.
The WHERE clause restricts the query; therefore the Oracle server makes use of an
existing index when retrieving data.
The bind parameter is NULL.
The WHERE clause is also NULL; therefore the Oracle server uses a full table scan to
retrieve all records.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Data Model Triggers:
PL/SQL Group Filter
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Data Model Triggers: PL/SQL Group Filter (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Use a group filter that calls a function for some records in the G_emp group, depending
on the department in the master group.
1. Open the Property Inspector for the G_emp group.
2. Change Group Filter to PL/SQL.
The PL/SQL Filter property appears.
3. Select the PL/SQL Filter property to open the PL/SQL editor.
4. Enter the code. This filter code must return a boolean value of true or false.
Note: It is more efficient to use a WHERE clause in a query when possible. You cannot
use a WHERE clause in this case, because you want to process all records and call the
function for some.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Data Model Triggers:
Parameter Validation
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Data Model Triggers: Parameter Validation (continued)
Example: To prevent report output from being sent directly to a printer, test the value of
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the DESTYPE system parameter.
1. Open the Property Inspector for the DESTYPE parameter.
2. Select Validation Trigger to open the PL/SQL editor.
3. Enter the code and make sure that the value Printer has an initial capital.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Layout Triggers
Format triggers:
Exist on most layout objects
Can suppress an entire layout section (master
group frame): No records fetched
Can suppress the display of individual records
(repeating frame): All records fetched
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Layout Triggers (continued)
Suppressing Individual Records
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Do not use format triggers to suppress individual records that you can restrict on the Data
Model. For example, a format trigger on a repeating frame does not prevent data from
being retrieved, it simply determines whether or not you see it in the output.
Therefore, it is more efficient to restrict individual records using the Maximum Records
property in a query or a First type of group filter when possible.
Note: Summaries compute against all data fetched by the Data Model. If you suppress
records in the layout only, summaries give misleading results.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using a Format Trigger on a Frame
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Coding a Format Trigger on a Frame (continued)
Example:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Create a summary column, :count_emp, in the master group that counts the number
of employee records (reset = master group).
2. Create a piece of boilerplate text, No employees in this department.
3. Position the text behind the column heading frame.
4. Code a format trigger on the column heading:
function hide_headings return boolean is
begin
if :count_emp = 0 then
return(false);
else
return(true);
end if;
end;
5. Either code the reverse logic in the format trigger of the boilerplate text item created
in step 2 or ensure that the column heading frame has a solid fill.
Note: You should code format triggers at the highest possible level of the paper layout
hierarchy. The format trigger on the column headings frame suppresses all objects
enclosed by the frame. Do not duplicate code unnecessarily by coding the same trigger on
all individual objects in the frame; this can cause increased processing and maintenance
overheads.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using a Format Trigger on a
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Repeating Frame
Dynamically Altering the Display of Records
Employee Details
Employee Details
King 17-JUN-87 24000
f_name f_date f_salary Kochhar 21-SEP-89 17000
De Haan 13-JAN-93
Employee17000
Details
f_name f_date
King 17-JUN-87
Kochhar 21-SEP-89
2 De Haan 13-JAN-93
1 3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using a Format Trigger on a Repeating Frame (continued)
Example:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. In the layout, create two repeating frames sourced by the same group. One repeating
frame must contain a salary field, the other must not.
Note: You can create two separate default layouts and modify the layout as
required.
2. Place one repeating frame behind the other.
3. Add a format trigger to suppress the top repeating frame (the one that contains the
salary field), or alternatively use conditional formatting:
function pay_clerks_see_this return boolean is
begin
if :user_type = 'PAY_CLERK' then
return(true);
else
return(false);
end if;
end;
Note: User_type can be a column or parameter that is initialized at run time.
4. Either code the reverse logic on the other repeating frame or ensure that the top
repeating frame (containing salary) has a solid fill.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using a Format Trigger on a Field
King 17-JUN-87
Kochhar 21-SEP-89
De Haan 13-JAN-93
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using a Format Trigger in a Web Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using a Format Trigger on a
Boilerplate Object
Insert Spacing Between Groups of Records
4 2
3
FUNCTION spacing RETURN BOOLEAN IS
BEGIN
IF MOD(:count_column, 3) = 0 THEN
RETURN(TRUE);
ELSE
RETURN(FALSE);
END IF;
END;
1 Transparent rectangle
2 Repeating frame, Vertical Elasticity = Variable
3 Summary column name (created in Data Model)
4 Format trigger on transparent rectangle
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using a Format Trigger on a Boilerplate Object (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Create a transparent rectangle inside the repeating frame to increase spacing
conditionally at run time.
2. In the repeating frame Property Inspector, set Vertical Elasticity to Variable.
3. In the Data Model, create a summary column named COUNT_COLUMN that
counts the number of records retrieved (Reset=Report).
4. On the rectangle, create a format trigger that references the summary column, as
shown on the previous page.
Note: You can vary the number of records in each group dynamically at run time by
creating a parameter.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Writing Common Code
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Writing Common Code (continued)
Writing Code as Report-Level Program Units
Oracle University Internal and TransAmerica Training Management Inc Partner use only
You can create a report-level program unit that contains a function, procedure, or
package, and that you call from any object in the same report. You cannot reference a
report-level program unit from a different report.
Three Ways to Create Library Program Units
In the Object Navigator, select the PL/SQL Libraries node and create a new library.
From the menu, select File > New > PL/SQL Library.
From the menu, select File > Open to open an existing library and create additional
program units.
Referencing Code from a PL/SQL Library
You can reference library code in a report trigger by attaching one or more libraries to one
or more report definitions, which enables you to reference the same code in multiple
reports.
To attach a library to a report, open the report definition, select the Attached Libraries
node in the Object Navigator, and add each library that you need in the report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Event-Based Reporting
Event-Based Reporting
Today, it is often desirable to blend automation into business processes through the
invocation of behind-the-scenes procedures and functions. These behind-the-scenes tasks
can include the spontaneous production of output such as an invoice that prints
automatically when an order is processed, a Web site that is automatically updated with
fresh data, or an automatic e-mail alerting an employees manager that the employee has
submitted an expense report for approval. Consider this last scenario. When an employee
submits an expense report, new data is inserted into the database. When this database
event occurs, you want to alert the employees manager through an e-mail or a
notification in his portal page that a submittal is awaiting his approval. With the Oracle
Reports event-driven publishing API, this is possible.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Event-Driven Publishing API
Oracle Advanced
PL/SQL Workflow Queuing
Reports E-mail
Cache Printer
File
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Event-Driven Publishing API (continued)
The API consists of several key elements:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The SRW Package contains all relevant procedures and functions for submitting,
checking the status, and canceling jobs, as well as manipulating parameter lists.
The ParamList Type defines a parameter list. A parameter list is the main vehicle for
passing values when submitting a job and is required for each job submittal.
The ParamList Object is required for such features as Advanced Queuing, where a
parameter list must be stored in the database so that it can be passed along with a
message.
Technical Note
Advanced Queuing is the message queuing functionality of the Oracle database. Oracle
Workflow is a tool that manages complex user-based business processes. For more
information refer to the Oracle Technology Network, http://otn.oracle.com.
See OracleAS Reports Services Publishing Reports to the Web manual for more
information on the Event-Driven Publishing.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Invoking a Report from a Database Event
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Invoking a Report from a Database Event (continued)
Example: Send a report when an employee has submitted an expense report. The code for
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the trigger is below.
CREATE TRIGGER EXP_REP_TRG AFTER INSERT OR UPDATE on
EXP_REP FOR EACH ROW
myPlist SRW_PARAMLIST;
myIdent SRW.Job_Ident;
BEGIN
IF (:new.ExpStat = 'DONE') THEN
myPlist := SRW_PARAMLIST(SRW_PARAMETER('',''));
srw.add_parameter(myPlist,'GATEWAY','http://');
srw.add_parameter(myPlist,'SERVER','repSVR');
srw.add_parameter(myPlist,'REPORT','alert.RDF');
srw.add_parameter(myPlist,'USERID','scott/tiger');
srw.add_parameter(myPlist,'ExpenseID',:new.ExpID);
myIdent := srw.run_report(myPlist);
END IF;
END;
This trigger will fire after each insert or update on the EXP_REP table. When the status of
an expense report changes to DONE, the parameter list is constructed and a report is
invoked. The parameter list, myPlist, contains the necessary parameters for submitting the
job:
GATEWAY provides the URL to the Reports Servlet that will be used to process the
request.
SERVER identifies the name of the Reports Server to be used in conjunction with the
servlet.
REPORT identifies the report file to be run.
USERID identifies the user ID and password of the person running the report.
The API method RUN_REPORT takes the parameter list containing all vital information
as input, creates and submits the request, and returns the job identification record. The
information in the record can be used to check the status of the job.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Using PL/SQL Triggers
Select the most applicable type of trigger for your requirement.
Report-level triggers fire once for each of the five events during the report execution.
Data Model triggers can affect which records are processed and how they are processed.
Layout triggers affect the way in which objects are formatted.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Summary (continued)
Objects That Must Return a Value
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The following table is a reminder of the Reports Builder triggers that must always return a
value, and the values that are acceptable.
Trigger Type Valid Values Result if False
Report trigger True, False Abort execution
Group filter True, False Do not process record
Validation trigger True, False Return to parameter
form
Format trigger True, False Do not format object
PL/SQL Formula (col- Computation: Character, N/A
umn) Number, Date
Writing Common Code
Use report-level program units or PL/SQL libraries for common code requirements to
improve productivity and maintenance.
Event-Driven Publishing
Use the PL/SQL procedures and functions in the event-driven publishing API to
automatically submit jobs to OracleAS Reports Services when an event occurs in the
database.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 19 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 19
1. Create a new report, using p19q1.sql.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Display the records in two different layouts, showing different columns in each.
b. Create a Group Above layout using the following columns from the query:
Group Column
G_CUSTOMER_ID customer_id
G_ORDER_ID order_id
order_date
order_mode
order_total
c. Create a Tabular layout using the following columns from the query
Column
order_id
order_date
order_total
d. Create a user parameter, user_type, that has two possible values: Sales
Representative and Sales Clerk.
e. Ensure that only the Group Above layout is displayed when the user type is Sales
Representative, and that only the Tabular layout is displayed when the user type
is Sales Clerk.
Hint: As an alternative to coding format triggers, you can also use conditional
formatting.
To test the result, display the USER_TYPE parameter in the margin of the report.
Make sure that you can enter a parameter value at run time.
f. Save the report as p19q1.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 19 (continued)
2. Continue with the previous report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Modify the report so that the Tabular (Sales Clerk) layout displays an extra
column that indicates, with an asterisk, those orders that have an order status of 5.
b. Remember to change user type to Sales Clerk during testing.
c. Move the function code into a new PL/SQL library named p19lib.pll
d. Run the report.
e. Save the report to p19q2.rdf.
3. Continue with the previous report.
a. Modify the same layout to display additional spacing between every two records.
b. Save the report as p19q3.rdf and close it.
4. Open report p19q1.rdf.
a. Write your own group filter to restrict the number of customers displayed,
depending on the value of a parameter that you enter at runtime.
Hint: You need to create two parameters, to keep track of how many records
have been processed, compared to the cutoff number of records required. Make
sure that you can enter the cutoff parameter at run time.
b. Test the report several times by changing the cutoff parameter at run time.
c. Save the report as p19q4.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Extending Functionality Using
the SRW Package
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
This lesson provides examples of the contents and use of the Reports Builder built-in
package. The package contains program units that you can reference in your PL/SQL
code.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Contents of the SRW Package
SRW.SET_BOOKMARK SRW.DO_SQL
SRW.SET_FONT_STYLE SRW.RUN_REPORT
SRW.SET_MAXROW SRW.TRACE_START
SRW.MESSAGE SRW.PROGRAM_ABORT
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Contents of the Reports Builder Built-in Package (continued)
Rules
Oracle University Internal and TransAmerica Training Management Inc Partner use only
You can only call the contents of the SRW package from within Reports Builder.
Other tools, such as Forms Builder, do not recognize this package.
You must always reference an SRW procedure, function, or exception by preceding it
with the package name, SRW; for example, SRW.MESSAGE or SRW.DO_SQL.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Outputting Messages
Warning:
WHEN <exception> THEN
SRW.MESSAGE (999, Warning: report continues);
Error:
WHEN <exception> THEN
SRW.MESSAGE (999, Warning: report terminated);
RAISE SRW.PROGRAM_ABORT;
Exceptions:
SRW.INTEGER_ERROR
SRW.NULL_ARGUMENTS
Outputting Messages
The SRW.MESSAGE packaged procedure displays a message with a code and text string,
which you specify. The message is displayed in the following format:
MSG-code: text
The message is displayed in a small dialog box. The user must acknowledge the message
before continuing.
Message Code and Text
You can enter a code number from zero up to ten digits. If you enter a number of fewer
than five digits, the code is displayed with leading zeros.
You can enter a text string to a maximum of 190 characters, excluding the code number.
You can embed extra spaces to display your message neatly in the message dialog box.
Reports does not suppress extra spaces in the message text.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Outputting Messages (continued)
Is It a Warning or an Error?
Oracle University Internal and TransAmerica Training Management Inc Partner use only
SRW.MESSAGE does not implicitly terminate the report execution. You can choose to
issue a warning message that enables the report to continue execution after the user
accepts the message.
To force the report to terminate after outputting the message, raise the exception
SRW.PROGRAM_ABORT.
Note: You cannot suppress or replace the default message that Reports Builder gives if
you abort a report. Your own error message augments the existing messages.
Causes of Exceptions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Executing a Nested Report
1 KING.LIS 2
xxx xxxxxxx
KING xxx xxxxxxx
KOCHHAR
KOCHHAR.LIS
DE HAAN
yyy yyyyyyy
yyy yyyyyyy
DE HAAN.LIS
zzz zzzzzzz
zzz zzzzzzz
SRW.RUN_REPORT
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Executing a Nested Report (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Run a report called MANAGERS that retrieves the employee record for each manager.
Call the EMPS report (for example, from a group filter). EMPS retrieves the employee
records of all employees managed by the current manager only.
Sample code to implement this example appears on the following page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Executing a Nested Report
Example:
SRW.RUN_REPORT
('Report=EMPS
DESTYPE=FILE
DESNAME='||:LAST_NAME||'.LIS
BATCH=YES
MGRNO='||TO_CHAR(:MANAGER_ID));
Exceptions:
SRW.RUN_REPORT_FAILURE
SRW.RUN_REPORT_BATCHNO
Function: SRW.GETERR_RUN
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Executing a Nested Report (continued)
Reports Builder raises a specific exception that applies to the SRW.RUN_REPORT
Oracle University Internal and TransAmerica Training Management Inc Partner use only
procedure in two cases:
Exception Name Causes
SRW.RUN_REPORT_FAILURE Detail report does not exist.
Detail report failed during execution.
SRW.RUN_REPORT_BATCHNO BATCH parameter is used inconsistently:
master report running with
BATCH=YES,
called a detail report with BATCH=NO
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Restricting Data
Q_EMP
EMPLOYEE_ID LAST_NAME
100 KING
G_EMP 101 KOCHHAR
102 DE HAAN
EMPLOYEE_ID
LAST_NAME
Restricting Data
Use SRW.SET_MAXROW to restrict the maximum number of records you want to
retrieve for a specified query. Reports Builder uses only the retrieved rows of the query in
subsequent processing, such as computations and summaries.
Suppressing a Query
At run time, you can choose not to display any data from a query by setting the maximum
number of records to zero. This prevents Reports Builder from retrieving any records from
the database.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Restricting Data (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Below is a function to display data for the Q_emp query only if a value of one or more is
entered in a run-time parameter called HOW_MANY:
FUNCTION FETCHIT RETURN BOOLEAN IS
BEGIN
IF :HOW_MANY >= 1 THEN
SRW.SET_MAXROW ('Q_emp', :how_many);
ELSE
SRW.SET_MAXROW('Q_emp', 0);
END IF;
RETURN(TRUE);
EXCEPTION
WHEN SRW.MAXROW_UNSET THEN
SRW.MESSAGE (100,
'Data was fetched before SRW.MAXROW was
called');
RAISE SRW.PROGRAM_ABORT;
WHEN SRW.MAXROW_INERR THEN
SRW.MESSAGE(200, 'Contact someone clever!');
RAISE SRW.PROGRAM_ABORT;
END;
You must set SRW.SET_MAXROW in the Before Report trigger; that is, after the query
has been parsed but before it has been executed. If you call it after the Before Report
trigger, Reports Builder raises the SRW.MAXROW_UNSET exception.
If you handle SRW.MAXROW_INERR, always raise SRW.PROGRAM_ABORT,
because your report has an internal problem and you cannot guarantee the outcome.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Initializing Fields
FUNCTION F_LOGICAL_PAGEFormatTrigger
RETURN BOOLEAN IS
my_page number;
BEGIN
SRW.GET_PAGE_NUM(my_page); 2
SRW.SET_FIELD_NUM(0,my_page+3);
RETURN(TRUE);
END;
Initializing Fields
You can dynamically initialize the value in a layout field by using the relevant
SET_FIELD packaged procedure; for example:
SRW.SET_FIELD_CHAR (0, 'a text string')
SRW.SET_FIELD_NUM (0, 1234)
SRW.SET_FIELD_DATE (0, '01-JAN-2002')
The first argument is always 0 (zero); you can set the value of the current object.
These procedures are relevant only in the format trigger of a field of the correct type. If
you use a procedure that conflicts with the field type, it has no effect in the report; Reports
Builder ignores the code and does not raise an error.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Initializing Fields (continued)
You can use SRW.SET_FIELD to retrieve the current logical page number and
Oracle University Internal and TransAmerica Training Management Inc Partner use only
recalculate the value before displaying it.
Example: Create a function to display the logical page number plus three in a field called
F_NEWPAGE.
Because the logical page number variable is available only in the report layout, not in the
Data Model, you cannot calculate the value in a data column. Therefore, you use a paper
layout field to get the current page number and output a new number by initializing the
same field.
Make use of a packaged procedure called SRW.GET_PAGE_NUM to retrieve the current
logical page number into a local PL/SQL variable, as in the format trigger code on the
previous page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a Table of Contents
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Table of Contents (continued)
Example: You want to generate a report of all e-mail addresses of your customers. Your
Oracle University Internal and TransAmerica Training Management Inc Partner use only
customer database contains thousands of records. You want to group the customers by
country and then generate a table of contents so you can easily find the e-mail address for
the desired customer.
To create a simple table of contents:
1. Create a table in the database to hold the TOC information. You need two columns,
one for the topic and the other for the page number.
2. Use the Report Wizard to create a Group Above report. This report will display the
country name, then the customers and customer e-mail addresses under each country
name. The table of contents you create will then be based on the country name in
this report.
3. Create an After Parameter Form trigger to modify the default order of the report
execution, so that the Main section is formatted first.
FUNCTION AfterPForm RETURN BOOLEAN IS
BEGIN
SRW.SET_FORMAT_ORDER(SRW.MAIN_SECTION,
SRW.HEADER_ SECTION, SRW.TRAILER_ SECTION);
RETURN (TRUE);
END;
4. Create a format trigger on the field that displays the country name. The format
trigger will fetch the page number for each country name, so that the TOC will
enable the user to navigate to various parts of the report based on the name of the
country.
FUNCTION F_COUNTRY_NAMEFormatTrigger RETURN BOOLEAN IS
pageNum NUMBER;
BEGIN
-- get current page number
SRW.GET_PAGE_NUM(pageNum);
-- insert row into database table
INSERT INTO TOC_TABLE (TOPIC, PAGE_NUMBER)
VALUES (:country_name, pageNum);
RETURN (TRUE);
END;
5. Use the Data Model to create a second query with a formula column that calculates
the page range for the data under each country name. This query will fetch the
information from the database table you created in step 1.
6. Create a tabular report block in the Header section of your report to display the
headings in the table of contents (i.e., the country name), and the page range where
the information can be found in the report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Performing DDL Statements
Example:
SRW.DO_SQL('CREATE TABLE SRW_LOG
(RPT_NAME VARCHAR2(40),
REC_NUM NUMBER,
MSG_TEXT VARCHAR2(80))' );
Exception: SRW.DO_SQL_FAILURE
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Performing DDL Statements (continued)
Querying from Temporary Tables
Oracle University Internal and TransAmerica Training Management Inc Partner use only
If you want to create a temporary table and reference it in a query in the same report, the
table must exist before the Before Report trigger fires. That is when Reports Builder
parses its queries. Therefore, you must create this table in the Before Parameter Form or
After Parameter Form report trigger.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Setting Format Attributes
Borderwidth
Tuesday, January 2004 Fill pattern
Format mask
Define a bookmark
Car Policy
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Setting Format Attributes
Visual attributes:
SRW.SET_FILL_PATTERN('solid');
SRW.SET_BORDER_WIDTH(250);
SRW.SET_FORMAT_MASK('Day, Month yyyy');
Defining a bookmark:
SRW.SET_BOOKMARK('Car Policy');
Attribute Value
Background fill color Blue
Fill pattern Sandpaper
Font style Italic
Font face Helvetica
Font weight Extra bold
Text color White
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Setting Format Attributes (continued)
Example (continued)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
FUNCTION SAL_MASK RETURN BOOLEAN IS
BEGIN
IF :SALARY > 12000 THEN
SRW.SET_BACKGROUND_FILL_COLOR(blue);
SRW.SET_FILL_PATTERN(sandpaper);
SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
SRW.SET_FONT_FACE(helvetica);
SRW.SET_FONT_WEIGHT(SRW.EXTRABOLD_WEIGHT);
SRW.SET_TEXT_COLOR(white);
END IF;
RETURN(TRUE);
END;
Remember that you can use the Conditional Formatting dialog box to specify output
formatting attributes (font and/or color) for a selected layout object based on conditions
that exist. However, if you need to apply other attributes such as fill color, for example,
then you need to use the SRW.SET_<attribute> procedures.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Format Attributes in a Web Layout
<rw:field id="F_SALARY" src="SALARY. . .
formatTrigger="mystyles">
F_SALARY
</rw:field>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Using Format Attributes in a Web Layout (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In the example on the previous page, the formatTrigger attribute contains the name of the
function mystyles. When executed, mystyles will set the following attributes on the
salary field:
Attribute Value
Justification Right
Text color Red
Font weight Bold
Font style Italic
Using Format Attributes in Character Mode Reports
Some attributes are applicable to character environments only; some are for bitmapped
environments only.
If you include a bitmapped attribute and then run the report in character mode, or the
reverse, Reports Builder ignores the code and does not cause an error. This enables you to
develop a report for use in a different environment.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
The SRW package contains procedures, functions, and exceptions.
Remember that you can raise the exception SRW.PROGRAM_ABORT in your PL/SQL
code to stop report processing at any time.
The SRW package provides a number of features, including:
- Executing a second report from within a report process, using
SRW.RUN_REPORT
- Modifying the format order for a report and then getting the resulting page
numbers for the Main section so that you can create a table of contents in the
Header section
- Support for DDL statements, using SRW.DO_SQL, to enable you to create or drop
temporary tables from PL/SQL code in a report
- Conditional formatting and display using SRW.SET_<attributes>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 20 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 20
1. Open report p9q3.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Display the column CUST_TOTAL in the customer group as red, bold italics if
its value is 10,000 or more.
Hint: Check the Help system for the SRW.SET <attributes> or use conditional
formatting.
Mask Attribute Suggested Value
SRW.SET_TEXT_COLOR Red
SRW.SET_FONT_WEIGHT SRW.BOLD_WEIGHT
SRW.SET_FONT_STYLE SRW.ITALIC_STYLE
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 20 (continued)
3. Execute a detail report from a master report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Create a simple tabular report called MGR_MASTER. The report should query
last names and employee IDs for those employees who are managers. Display all
fields. You can use the query:
SELECT distinct manager.last_name Manager,
manager.employee_id
FROM employees worker, employees manager
WHERE worker.manager_id = manager.employee_id
b. Save the report as mgr_master.rdf.
c. Create another tabular report, the detail report, and name it EMP_RPT. The
report should return department number, employee name, and salary for a
specific manager. The manager_id will be passed to EMP_RPT by
MGR_MASTER.
d. Save the report as emp_rpt.rdf and close it.
e. Write the code to execute the detail report. For each manager returned,
MGR_MASTER should invoke the detail report, EMP_RPT, pass it the
managers employee_id, and produce a report in PDF format containing
information about the employees working for that manager. Use the managers
employee_id to create an output filename for each manager:
MGR_<employee_id>.PDF.
Hint: You can write the code in the group filter.
f. Compile the PL/SQL code and close the window.
g. Run the paper layout for MGR_MASTER to test. Access the file system and
locate the output for the detail reports. View two or three of the output files.
h. Save mgr_master.rdf and close it.
If You Have Time
4. Open report p10q1.rdf
In this report, you use report triggers to create a temporary table at the start of report
execution, and you insert rows into the table at various stages of the execution.
a. Write a trigger that creates a temporary table to hold the date and userid each
time the report is run. The table should contain three columns: one date column,
one character column of width 10, and one character column of width 80.
CREATE TABLE RUNREPORT
(DATE_RUN DATE, USER_RUN VARCHAR2(10), COMMENTS
VARCHAR2(80))
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 20 (continued)
b. The same trigger should also insert the current date, userid, and Starting
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report into this table.
INSERT INTO RUNREPORT
(DATE_RUN, USER_RUN, COMMENTS)
VALUES (SYSDATE, USER, 'Starting Report')
Hint: Think about how you code the single quotes.
c. Compile the PL/SQL code and close the window.
d. Save the report as p20q4.jsp.
e. Run the paper layout.
f. Using SQL*Plus, verify that your table exists and was populated successfully.
g. Log on to SQL*Plus (in Microsoft Windows, select the SQL*Plus icon in the
Oracle group) using the same userid as you used for Reports.
h. Display all records in the RUNREPORT table.
SQL> col comments format a40
SQL> SELECT * FROM RUNREPORT;
i. Try running the report more than once. When you run the report a second time,
the table already exists and Reports Builder raises an exception. Make the
necessary change to your code so that the report runs even when the table exists.
j. Write a trigger that inserts a record with the comment Printing another page
whenever it begins a new page.
k. Write a trigger that inserts a record with the comment Report completed when
the report finishes.
l. Save the report as s20q4l.jsp. Generate the output to a PDF file. Verify the
results in SQL*Plus.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Maximizing Performance Using
OracleAS Reports Services
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
When you are ready to publish your reports, all the Web server and application server
tools you need are available in the Oracle Application Server.
In this lesson, you will learn about the architecture of relevant Oracle Application Server
components in combination with its reports publishing component, OracleAS Reports
Services. You learn how to make report requests, and about the options available for
managing and monitoring Reports Services.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running Reports Using
OracleAS Reports Services
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Running Reports Using OracleAS Reports Services (continued)
Benefits of OracleAS Reports Services
Oracle University Internal and TransAmerica Training Management Inc Partner use only
OracleAS Reports Services provides a flexible architecture for the distribution and
automated management of report generation engines on the same server and across
multiple servers.
When used in conjunction with JSP, servlet, or CGI, OracleAS Reports Services
enables you to run reports on any platform from a Web browser using a standard URL
syntax. The JSP engine runs the Web layout. The Reports servlet runs the paper
layout. Reports CGI is maintained only for backward compatibility.
Reports are formatted on a high-performance NT or UNIX server.
Reports Services caches the output in a central repository on the server machine. With
OracleAS Reports Services, the Reports cache is persistent. This means that if the
server is shut down and then restarted, all jobs are recovered, not just scheduled jobs.
Reports Services detects duplicate reports. Users can share output without rerunning
the report.
You can implement multiple run-time engines for one Reports Services machine.
You can implement multiple Reports Services server instances on one machine.
OracleAS Reports Services provides peer-level clustering to allow sharing of the
Reports Server load among multiple machines for unlimited scalability.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report Request Methods
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Report Request Methods (continued)
SRW.RUN_REPORT: This is a packaged PL/SQL procedure that submits a report to
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Reports Services. In the argument list, you specify the JSP or servlet information in
addition to the Reports parameters, and RUN_REPORT sends the request to Reports
Services. Set the SERVER argument to the OracleAS Reports Services server name to
cause the SRW.RUN_REPORT command to behave as though you executed the
RWCLIENT command.
Event-Driven Publishing API: The Event-Driven Publishing API is a PL/SQL
package that allows for the automatic submission of jobs to OracleAS Reports
Services from within the database. The API provides the basic functions required for
the development of procedures that respond to events in the database. With the event-
driven publishing, you can automatically run a report in response to a database event,
such as the insertion of a record or the change of a value. Event-driven jobs are
submitted using the HTTP protocol. The server assigns a unique job identifier to every
call, useful for tracking the status of the job. The Event-Driven Publishing API is a
PL/SQL API.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Oracle Application Server Components
Web
Enterprise Application Development Framework Services
Management
Portal Business Integration
Intelligence Broker
Any Data
Source
Application server
Mobile and
Wireless
Grid Computing Infrastructure Packaged
Application
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
OracleAS Reports Services Architecture (continued)
First, you should be familiar with the key components of Oracle Application Server:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The OracleAS HTTP Server is a Web server. It incorporates an OpenSSL module to
provide support for Secure Sockets Layer (SSL) and HTTP Secure Sockets Layer
(HTTPS). It also provides a servlet engine to support the running of Java Servlet
applications. It is the HTTP Listener.
The module mod_OC4J is used by the HTTP Listener to redirect requests for servlets
and JSPs to OracleAS Containers for Java 2 Enterprise Edition (OC4J). OC4J provides
a fast, lightweight, highly scalable, easy-to-use complete J2EE environment that
includes a JSP translator, a JSP servlet engine, and an Enterprise JavaBeans (EJB)
container.
The Reports Servlet runs inside the Web servers servlet engine. The Reports Servlet
translates and delivers information between HTTP and the Reports Server.
The Reports CGI translates and delivers information between either a Web server or
a J2EE Container (for example,OC4J) and the Reports Server. This component
enables you to run a report dynamically from your Web browser.
The Reports Server processes client requests. It spawns runtime engines, fetches
completed reports from the Reports cache, and notifies the client that the report is
ready.
The Reports Engine includes components for running SQL- and PDS-based reports.
It fetches requested data from the data source, formats the reports, sends the output to
cache, and notifies the Reports Server that the job is complete.
The Reports Server Cache stores completed jobs.
When used in a Web environment, the OracleAS Reports Services architecture consists of
four tiers:
The client tier (a Web browser)
The Web server tier
The OracleAS Reports Services tier
The data tier, including databases and pluggable data sources
When used in a non-Web environment, there are three tiers (a Web server being
unnecessary):
The client tier
The OracleAS Reports Services tier
The data tier
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Enabling Single Sign-On Access
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Enabling Single Sign-On Access (continued)
SSO enables you to establish unique identities for each user which are tied to resources
Oracle University Internal and TransAmerica Training Management Inc Partner use only
unique to that user. The users resources contain key-identified connection strings for
accessing different data sources. The user is uniquely identified through a once-per-
session login, and the login references the users resources to ensure that he or she has
access to the appropriate data sources, without users having to enter this information
themselves.
SSO is made possible through the partnership of OracleAS Reports Services, Oracle
Internet Directory (OID), and the Oracle Login Server, all delivered through the Oracle
Application Server.
Technical Note
For more information on data source single sign-on, see the OracleAS Reports Services,
Publishing Reports to the Web manual.
For information about the requirements and procedures required for setting up SSO-
related components, such as the Oracle Internet Directory, see the Oracle Internet
Directory Administrator's Guide and the Oracle HTTP Server Administrator's Guide on
the Oracle Application Server documentation CD and on the Oracle Technology Network
(http://otn.oracle.com).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running the Web Layout:
JSP Run-time Architecture
HTTP
CORBA/IIOP CORBA/IIOP
OID
Reports
OracleAS
Engine
Reports Services
PDS
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running the Paper Layout:
Servlet Run-time Architecture
HTTP
CORBA/IIOP
rept.rdf Reports
Engine
rept.jsp
PDS
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running a Paper Report on the Web
URL syntax:
http://vesuvius.world.com:8888/reports/rwservlet?
report=emp_dept.rdf&desformat=html&destype=cache&
server=repsrv1&dept_param=10
Key map file: cgicmd.dat
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Running a Paper Report on the Web (continued)
In the example, the first line contains the Web server hostname (vesuvius), the domain name
Oracle University Internal and TransAmerica Training Management Inc Partner use only
(world), the port (8888), and the alias (reports), a virtual path that stands in for the absolute
path to the files the URL will access. RWSERVLET invokes the OracleAS Reports Services
servlet. The question mark (?) identifies the beginning of the command line arguments such
as the module name, destination format, destination type, Reports server name, and a value
for a runtime parameter.
The Key Map File
As you can see from the example on the previous page, the URL can become quite long. To
get around this problem, the key map file cgicmd.dat can be used. The key map file
contains command strings for running reports, each identified by a unique keyword. By
using key mapping, the command line arguments are all hidden from the user. By default,
the key map file is located in the <oracle_home>/reports/conf directory. For the
example above the mapfile entry may look like the following:
emp_rep1: report=emp_dept desformat=html destype=cache
server=repsrv1 dept_param=%1
Note that the delimiter is the map file entry is a space.
The URL now becomes much shorter:
http://vesuvius.world.com:8888/reports/rwservlet?emp_rep1&10
Technical Note
For information on testing reports deployment without installing Oracle Application Server,
refer to the Oracle Reports Technical Note How to Execute Reports Services from 9iDS on
the Oracle Technology Network (http://otn.oracle.com).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running a Report from the Command Line
SERVER = <server_name>
MODULE|REPORT = <runfile>
DESTYPE = FILE, PRINTER, MAIL, CACHE,
LOCALFILE, SYSOUT,ORACLEPORTAL
DESNAME = <desname>
DESFORMAT = PDF, HTML, HTMLCSS, RTF,
DELIMITED, XML
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The OUTPUTIMAGEFORMAT Parameter
Syntax:
OUTPUTIMAGEFORMAT={PNG|JPEG|JPG|GIF|BMP}
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Schedule Parameter
RWCLIENT...
SCHEDULE=monthly_last_weekday_from_17:00_Nov_22,_2003_
retry_3_after_1_hour
TIME
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
The Schedule Parameter (continued)
Syntax
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The full syntax of the SCHEDULE parameter is:, [SCHEDULE=] string, where the string
is, [FREQ from] TIME [retry {n} + after LEN]
FREQ = hourly|daily|weekly|monthly|{every
LEN|DAYREPEAT}|{last {WEEKDAYS| weekday | weekend} before
{n}+}
TIME = CLOCK [DATE] [INCR]
CLOCK = <hh:mm>
DATE=<calendar date>
INCR = {+LEN} | {next SUFFIX}
LEN = {n} * SUFFIX
SUFFIX = <time, date, FREQ>
Example
SCHEDULE=hourly_from_09:00am_Mar_01,_2002
SCHEDULE=last_weekday_from_17:00_Oct_23,_2001_retry_3_afte
r_ 1_hour
Note: This syntax is necessary only if you want to control your report jobs from the
command line. You can also specify the scheduled time and frequency of a report when
you define a new job in the easy-to-use Queue Manager screen, which you learn about
later in this lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Reports Caching
Reports Caching
Include the TOLERANCE parameter in your command line to set the maximum
acceptable time (in minutes) for reusing a report's cached output when a duplicate job is
detected. Setting the time tolerance on a report reduces the processing time when
duplicate jobs are found.
Setting TOLERANCE=60 means that Reports Services can detect a duplicate report
request for the same report and return the existing cached output to the client without
rerunning the report if the existing report output is 60 minutes old or less.
Setting TOLERANCE=0 forces the report to rerun for each request. This is the default
behavior.
Reports Services uses a parameter CACHEDIR to determine where to place the cached
output. The default directory is <oracle_home>\reports\cache.
Technical Note
For more information on OracleAS Reports Services, see the eClass Oracle9iAS Reports
Services: Deploy Internet Reports. Also refer to Oracle Application Server Reports
Services, Publishing Reports to the Web documentation.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using Oracle Enterprise Manager
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Managing and Monitoring OracleAS
Reports Services
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
What Is the Queue Manager?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Queue Manager
Past jobs
Current jobs
Scheduled jobs
Queue Manager
The Queue Manager status bar enables you to switch among different views of report
jobs.
Icon Name Description
Show Past Jobs Displays jobs that have already run for a given reports server
Show Current Jobs Displays jobs that are currently running
Show Scheduled Jobs Displays scheduled jobs in order to reprioritize or cancel a job
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Queue Manager
All my jobs
All jobs
Refresh
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using the Queue Manager
RSVR1
Queue
Manager
RSVR2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
OracleAS Reports Services provides a flexible architecture for the distribution and
automated management of report generation engines on the same server and across
multiple servers, in both Web-based and non Web-based environments.
Run a report using several methods:
- RWCLIENT
- URL syntax
- OracleAS Portal
- SRW.RUN_REPORT
- Event-Driven Publishing API
OracleAS Reports Services Runtime Architecture
- Run Web layouts using the JSP runtime architecture.
- Run paper layouts using the Servlet runtime architecture.
Use Oracle Enterprise Manager to monitor OracleAS Reports Services.
Use Queue Manager to view and schedule reports.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 21 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 21
1. You created a report called SalaryByDept.jsp that displays the salary
Oracle University Internal and TransAmerica Training Management Inc Partner use only
information for a particular department value by accepting a runtime parameter
p_deptno. You need to deploy the report on the Web using a URL.
Component Description
Web server neptune
domain name world
port 8889
alias for the directory path salarydata
The report should be executed by repserver4, the output should be in
HTMLCSS format, and go directly to OracleAS Reports cache. Access the data by
connecting to the Employee database using a username of scott, a password of
tiger, and EmpDB as the database connect string. Construct the URL to run the
report using the Reports servlet.
2. So that you do not have to enter such a long URL each time you run the
SalaryByDept report, create a key entry in the cgicmd.dat key map file entry
located under <ORACLE_HOME>\reports\conf.
a. Name the key salary. Be sure to include the runtime parameter p_deptno in
the key entry.
b. Reconstruct the URL to run the report using the key. Pass a value of 30 for
p_deptno.
3. In addition to using a URL, what are the other methods for requesting a report?
4. What is the JSP runtime architecture used for?
5. Which two facilities can be used to monitor OracleAS Reports Services?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Building Reports: Efficiency Guidelines
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Objectives
Overview
A report does not run in a vacuum. It is dependent on the underlying hardware, software,
and network connection. Because of this complex interrelationship, performance is always
an issue. The second part of this lesson focuses on performance in the run-time
environment and gives you a number of performance tips. You should also realize that
Report applications are portable across multiple platforms and multiple languages. You
can reduce cross-platform development effort by planning for platform-specific features
or restrictions. In this lesson, you also learn how to build reports to run on various
platforms, and in different environments and languages.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Tuning Reports
No absolute rules
Investigate specific areas:
Data Model
Paper Layout
Web Layout and JSP report definitions
Run-time arguments
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Tuning Oracle Reports (continued)
The Reports Trace Option
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Reports Trace option produces a file that describes the series of steps completed
during the execution of the report. You have the option to log all events or only a subset
of events such as SQL execution or breakpoints. The trace file can provide very useful
information for performance evaluation, and also tells you what executed when.
Tracing can be set for various methods of report execution, for both RDF and JSP report
definitions containing SQL and non SQL data sources, such as the XML and Text
pluggable data sources.
To set the Trace option, use the TRACEFILE=<filename> command line argument when
running the report, or from the main menu select Program > Tracing.
Typical profile output is shown below:
Reports Profiler Statistics
TOTAL ELAPSED Time: 29.00 seconds
Reports Time: 24.00 seconds (82.75% of TOTAL)
ORACLE Time: 5.00 seconds (17.24% of TOTAL
UPI: 1.00 seconds
SQL: 4.00 seconds
In this profile output, you see the execution time (total elapsed time) for the report, the
amount of time spent formatting the retrieved data (Reports time), and the amount of time
spent waiting for the data to be retrieved (Oracle time), comprised of time spent
establishing the database connection, parsing and executing the SQL statement (UPI
time), and the time spent fetching the data and executing SRW.DO_SQL() statements,
EXEC_SQL statements, PL/SQL cursors, and so forth (SQL time).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Performance Measurement
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Non SQL Data Sources
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Non SQL Data Sources (continued)
You can also specify an Extensible Stylesheet Language file (XSL) for the XML data
Oracle University Internal and TransAmerica Training Management Inc Partner use only
stream. Unless you absolutely need to apply the XSL at runtime, it is better to have the
data in the correct format to start with.
The pluggable Text data source supports the use of cell wrappers. This causes the file
format level delimiter to be ignored for every field for which a wrapper is defined. Unless
you really need this feature, avoid using cell wrappers for performance reasons.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Investigating the Data Model
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Investigating the Data Model (continued)
Efficient use of SQL: Inefficient SQL can severely impact performance. As
Oracle University Internal and TransAmerica Training Management Inc Partner use only
mentioned earlier, an invaluable aid to tuning SQL in a report is the SQL Trace
facility provided by the database. For reports that have large queries, it is advisable to
either activate the cost based optimizer (by running ANALYZE on the tables or by
setting the appropriate parameter in the init.ora file), or optimize all SQL
statements following the rules laid out for the rule based optimizer.
Efficient use of PL/SQL: PL/SQL that performs database operations will give better
performance if it is used in stored database procedures. Stored procedures perform
database operations faster than local PL/SQL program units. The opposite is true if
PL/SQL does not involve any database operations. In this case, PL/SQL should be
coded locally using the Program Units node in the Report Object Navigator. You may
also want to consider using PL/ SQL libraries, but the performance overhead is
outweighed only when the benefits of code sharing can be used.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Investigating the Data Model
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Investigating the Data Model (continued)
Redundant queries: Ideally, a report should have no queries that return data that is
Oracle University Internal and TransAmerica Training Management Inc Partner use only
not required in the report. In general, the fewer queries you have, the faster your report
will run. Single query Data Models tend to execute more quickly than multiquery Data
Models. However, situations can arise where a report not only needs to produce a
different format for different users, but also needs to utilize different query statements
depending on user input. Clearly, this could be achieved by producing two different
reports.
Break groups: If the report requires the use of break groups, care should be taken to
ensure that the break order property is set for as few columns in the break group as
possible as Oracle Reports appends an extra column to the ORDER BY clause of the
query for every break column. The creation of a break group may also make the
ORDER BY clause redundant and in this case should be removed. To give better
performance, break order columns should be as small as possible and should be
database columns wherever this is feasible.
Group filters: It is usually more efficient to incorporate a group filter into the query
WHERE clause. This restricts the number of rows returned from the database and
avoids local filtering by Oracle Reports itself.
Linking queries: There are a number of ways to create Data Models that include
more than one table. You can create a single query with a join condition or you can
create two separate queries and create a link between the two. In general, it is
preferable to minimize the actual number of queries as each time a query is issued,
Oracle Reports needs to parse, bind, and execute a cursor. A single query report is
therefore able to return all the required data in a single cursor rather than many. Also,
with master detail queries, the detail query will be reparsed, rebound, and reexecuted
for each master record retrieved. In this case, it is often more efficient to use a single
query report with break groups.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Investigating the Paper Layout
Frames
Object size
Format triggers
Fetching ahead
Bursting and distribution
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Investigating the Paper Layout (continued)
Format triggers: Care should be taken when using format triggers as the trigger fires
Oracle University Internal and TransAmerica Training Management Inc Partner use only
every time the object is formatted at runtime. Format triggers should also be placed at
the highest level possible in the object/frame hierarchy so that the triggers fires at the
lowest possible frequency.
Fetching ahead: Oracle Reports provides the ability to display data such as the total
number of pages or grand totals in the report margin or header pages. This requires
that the entire report is fetched ahead before the first page can be output. The usual
execution model is to format pages on an as-needed basis. Using the read ahead
functionality does not affect the overall time it takes to generate the report, but rather
affects the amount of temporary storage required and the time it takes before the first
page can be viewed. To enhance perceived performance, reading ahead should be
avoided when a report is going to be run to the screen in a production environment.
Bursting and distribution: With the introduction of report bursting, a report layout
can be made up of three distinct sections: header, body, and trailer. A report can
comprise all three sections or it can be viewed as three separate reports within one
report. Oracle Reports allows you to control bursting at the group record level,
offering a further level of granularity in report bursting. The use of report bursting in
conjunction with distribution offers considerable performance gains. Each section of a
report can have multiple different formats and can be sent to multiple destinations in
one single run rather than running the same report multiple times.
Web Layout and JSP Report Definition
You learned that Oracle Reports takes full advantage of JSP technology to deliver high
quality Web publishing. Recall that you can use your favorite Web authoring tool to
design the static portion of your Web page and then use Oracle Reports to add the
dynamic portion (data) into the appropriate sections of the page. A poorly designed Web
page has an impact on the perceived performance.
Because it is possible to include any Java code in the JSP, it is easy to get carried away
and mix business and data access Java code with the presentation logic. This should be
avoided as it increases the footprint of the JSP and limits the efficient use and
management of system resources.
Customized formatting of a Web page is always an expensive operation. Any type of
formatting that you cannot natively achieve through Oracle Reports (e.g., changing the
foreground color of a report block) should be done using Java in the most direct way. The
use of PL/SQL wrappers for formatting purposes in discouraged.
A .jsp report definition can contain both a paper layout and a Web layout. Since the Web
layout section of a JSP report could contain an <rw:include> tag referencing a paper
layout object, Oracle Reports always formats the paper layout when executing the report.
If your JSP report does not reference any paper layout objects, it is recommended that you
use the SUPPRESSLAYOUT command option to prevent executing the paper layout.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running the Report
RUNDEBUG=NO
Array processing
LONGCHUNK
PARAMFORM
Batch processing
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Running the Report (continued)
If the report has columns of the LONG, CLOB, or BLOB datatype, the LONGCHUNK
Oracle University Internal and TransAmerica Training Management Inc Partner use only
parameter can be set to a large value to reduce the number of increments it takes Oracle
Reports to retrieve the long values.
If a parameter form or online previewing is not required, these functions can be bypassed
by setting the PARAMFORM and BATCH system parameters to No and Yes,
respectively.
Calling Reports from Forms
In an application built using Forms Builder and Reports Builder, it is often the case that
some type of report is required on data that has already been retrieved and/or updated by
the Oracle Forms section of the application. The tight integration between Oracle Forms
and Oracle Reports allows you to pass blocks of data between the associated products.
Passing data is achieved using record groups and data parameters in conjunction with the
RUN_REPORT_OBJECT built-in for calling reports from forms. Sourcing a Reports
query from a Forms record group avoids requerying the database and hence Oracle
Reports will only spend time formatting the data.
Technical Note
For more information on tuning your reports, see the whitepaper Tuning Oracle Reports
on the Oracle Technology Network (http://otn.oracle.com).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Different Development and Run-Time
Environments
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Different Development and Run-Time Environments (continued)
Character Mode Environment
Oracle University Internal and TransAmerica Training Management Inc Partner use only
This environment has a unit of character, typically 80*24, and rarely supports a mouse.
Interaction with the host computer is at field level; that is, when the user navigates from
the field.
A report that runs in character mode cannot display any graphics features, such as images,
drawings, or multimedia objects.
Running a Character Mode Report from the Builder
You can test your character mode reports very easily in the bitmapped Reports Builder
and view the report output in the Previewer (File > Print Preview).
The execution of the report as bitmapped or character simply depends on a system
parameter called MODE. You can change this parameter in Reports Builder to test the
character output during your report development.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Developing Reports to Run in Different
GUIs
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Developing Reports to Run in Different GUIs (continued)
Example
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In the uifont.ali file on Microsoft Windows, map Motif and Mac fonts to Microsoft
Windows:
/* Motif fonts */
lucidatypewriter = "Courier New"
lucidabright = "Times New Roman"
fixed = "Courier New"
/* Mac fonts */
"Avant Garde = "Arial"
"New York = "Times New Roman"
In the uifont.ali file on UNIX (motif), map Microsoft Windows fonts to Motif:
/* Microsoft Windows fonts */
"Courier New" = lucidatypewriter
"Times New Roman = lucidabright
Using Common Colors
If possible, use a color that you know exists on the target GUI; otherwise, use one that
maps well to the default color of the target GUI.
Beware of Dots Per Inch
The dots per inch (DPI) may differ among machines, even if they use the same GUI. This
only affects how alphanumeric characters wordwrap on the screen. Therefore, if you
design a report that is displayed in the Previewer, try to use the same DPI as the users who
will eventually run the report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Setting NLS Language Environment
Variables
NLS_LANG
DEVELOPER_NLS_LANG, USER_NLS_LANG
NLS_LANG=French_France.WE8DEC
Unicode:
NLS_LANG=<lang>_<territory>.UTF8
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Building Reports to Run in Different Languages (continued)
Syntax
Oracle University Internal and TransAmerica Training Management Inc Partner use only
NLS_LANG = <language>_<territory>.character_set
Language: Language conventions for displaying messages and day and month names
Territory: Conventions for default date format, and for displaying currency, decimal,
and thousands symbols
Character_set: Character set in which data is displayed
Example
NLS_LANG=French_France.WE8DEC
Using Unicode in Oracle Reports Developer
Unicode is a global character set that allows multilingual text to be displayed in a single
application. Unicode is a fixed-length two-byte character set that represents up to 65,536
characters.
Using Unicode in Oracle Reports enables you to display multiple languages in one
application without switching character sets.
To enable Unicode support, set the NLS_LANG environment variable as follows:
NLS_LANG = <language>_<territory>.UTF8
The data must also be stored in Unicode.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Translating an Oracle Reports Application
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Translating an Oracle Reports Application (continued)
Considerations When Designing Multilingual Applications
Format masks: Make sure to provide extra space for translation of date and numeric
Oracle University Internal and TransAmerica Training Management Inc Partner use only
format masks.
Text strings: Avoid hard-coding a string containing language-specific words such as a
month name.
Character sets: If using an application that will run with multiple character sets,
determine the one that is most frequently used and generate the application files with
the relevant NLS language settings.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Summary
Summary
Analyze the performance of your reports using the Trace option in Oracle Reports, as
well as the SQL trace facility in the database. Tune reports by optimizing SQL,
minimizing calls to the database, and minimizing the amount of unnecessary format
processing required for the layout of returned data.
Using Oracles translation tool, TranslationHub, the NLS parameters, and various
features in Oracle Reports, you can build multilingual report applications.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice 22 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session: Lesson 22
1. Name four main areas to investigate when tuning reports.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
2. What is the name of the font mapping file?
3. Generate and interpret Reports Runtime Trace information.
a. Open report p19q4.rdf. From the menu select Program > Tracing.
b. In the Runtime Trace Settings dialog box specify p19q4.txt as the trace file and
select the All check box under Trace Settings.
c. Select OK to close the dialog box.
d. Run the paper layout. Paginate through the report in the Paper Design view.
e. Open p19q4.txt and look at the results. Where does this report spend time?
f. Repeat the same steps for report p22q2b.rdf. Specify p22q2.txt as the
trace file. Compare the result. How do you explain this?
4. Make a suggestion to improve performance.
a. Open the report p12q1.rdf and generate Reports Trace information. Look at
the time statistics.
b. Examine the Data Model. What could you possibly do to make the report run
faster?
c. Implement your change and regenerate the time statistics. Did things improve?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Practice Solutions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 2
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Previewing a report in a browser
Executing a number of different reports. For each report, answer some questions
Introduction
This practice session consists of a combination of practical and paper-based questions.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 2
1. Invoke the Reports Builder executable.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Select Reports Builder from the Oracle Reports menu: Start > Programs >
Oracle Developer Suite > Reports Developer > Reports Builder.
This may differ according to the classroom setup.
Click Cancel in the Welcome to Reports Builder dialog box
2. Open the report called p2q2.jsp. Run the Web layout.
From the menu select File > Open. Locate p2q2.jsp in your working
directory and click Open.
Select Program > Run Web Layout from the menu or select the Run Web
Layout icon on the horizontal toolbar.
Specify the database details in the Connect dialog box.
a. Examine the report in your browser. Among the styles discussed in this
lesson as a reference, what style of report is it?
Tabular report.
b. How many groups of data are there in this report?
One group of data, each row being displayed once within the group.
c. In the browser, use the scroll bars to move up and down the report to see all
of the data.
Use the scroll bar on the right side of the browser window to scroll up
and down the report data.
d. Close the browser window. You are now back in Reports Builder.
In the browser, click the Close icon in the upper right corner or select
File > Close from the menu.
3. Open report p2q3.rdf and run the paper layout.
From the menu select File > Open. Locate p2q3.rdf in your working
directory and click Open.
Select Program > Run Paper Layout from the menu or select the Run Paper
Layout icon in the horizontal toolbar.
a. In the Paper Design view, move to the next page. Notice that this report has a
header page with text.
Select Next Page to navigate from one page to another.
b. What style of report is this?
Tabular report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 2 (continued)
c. Close the Paper Design view. From the File menu, select Print Preview. In
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the Previewer window, experiment with the horizontal and vertical split
screen features.
Select File > Print Preview. To split the Previewer horizontally: Select
the small gray area at the top of the right scroll bar. Press the left mouse
button down and drag the gray area. As you do this, you see that a thick
dotted line is dragged down the Previewer. Depress the left mouse button
when you have reached the desired split point. Now you have two
windows, which work independently from each other.
Move the split bar back to its original position.
To split the Previewer vertically: Select the small gray area at the left of
the horizontal scroll bar at the bottom of the window. Press the left
mouse button down and drag the gray area. As you do this, you see that
a thick dotted line is dragged right across the Previewer. Depress the left
mouse button when you have reached the desired split point. Now you
have two windows, which work independently from each other.
d. Close the Previewer window.
In the Previewer, click the Close Previewer button.
4. Open report p2q4.jsp and run the Web layout.
Select File > Open, locate p2q4.jsp, and click Open.
Select Program > Run Web Layout from the menu or select the Run Web
Layout icon on the horizontal toolbar.
a. What style of report is this?
It is a Group Left master/detail report.
b. How many groups of data are in this report?
There are two groups of data.
c. How many pages are there in this report?
There are no pages in a Web report. In Reports Builder, run the paper
layout to determine the number of pages. There are three pages in this
report.
d. Close the browser.
In the browser, click Close.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 2 (continued)
5. Open report p2q5.jsp and run the Web layout.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
From the menu select File > Open. Locate p2q5.jsp and select Open.
Select Program > Run Web Layout from the menu or select the Run Web
Layout icon from the horizontal toolbar.
a. What style of report is this?
It is a Matrix report.
b. How many groups of data are in this report?
There are four groups of data:
Year
Department Name
Job ID
Salary
There actually is an additional, invisible cross product group around
Year, Department Name, and Job ID; this special group defines the
matrix structure and is explained in the lesson on matrix reports.
c. Close the browser window.
In the browser, click Close.
6. Open report p2q6.rdf and run the paper layout.
From the menu select File > Open. Locate p2q6.rdf and click Open.
Select Program > Run Paper Layout from the menu or select the Run Paper
Layout icon in the horizontal toolbar.
a. Notice the Parameter Form. You are requested to enter a customer ID. The
report will display order information based on your input.
b. Specify a valid customer ID and run the report. Valid values include 101,
118, 148 and 170; pick one of these and then select Run Report.
Click in the customer ID field and enter one of the suggested numbers.
Select Run Report.
c. What do you think would be a better method of providing valid values to a
user?
It would be more user-friendly to display a list of values. And it would be
even more meaningful to add customer names. This can easily be built
into the report. You will see how this is done in a later lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 2 (continued)
d. Close the Paper Design view.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In the Paper Design view, click Close.
e. Run the paper layout again. This time do not specify a customer ID.
From the menu select Program > Run Paper Layout. Immediately select
Run Report without entering a value for customer ID.
i. What is the result?
The result is that the report does run; however, it does not display any
data. There are no NULL customer IDs.
ii. In a production situation, what should happen in this instance?
The user should be prevented from entering a NULL value or a blank.
In later lessons you will see how this can be implemented.
f. Close the Paper Design view.
In the Paper Design view, click Close.
g. Run the paper layout again. This time enter Customer ID 999.
From the menu select Program > Run Paper Layout. Enter the customer
ID 999 and select Run Report.
i. What is the result?
The result is that the report does run; however, it does not display any
data. There is no customer ID 999.
ii. In a production situation, what should happen in this instance?
The user should be prevented from entering an invalid value. In later
lessons you will see how this can be implemented.
h. Close the Paper Design view.
In the Paper Design view, click Close.
7. Open report p2q7.rdf and run the paper layout.
From the menu, select File > Open. Locate p2q7.rdf and select Open.
Run the paper layout.
a. In the Parameter Form, notice the list of values for the customer information.
The report displays order information based on your input.
b. Select a valid customer name and run the report.
Select a customer name from the list of values for customer and click
Run Report.
c. Close the Paper Design view.
In the Paper Design view, click Close.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 3
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Invoking Reports Builder
Opening an existing report
Switching views in the Report Editor
Accessing the Help system
Introduction
The questions in the practice session provide an introduction to the Reports Builder
interface. You open and navigate through an existing report definition and use the Help
system to obtain information about some of the Report executables.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 3
1. Start Reports Builder and open the existing report: p3q1.jsp. Run the paper
Oracle University Internal and TransAmerica Training Management Inc Partner use only
layout.
On your desktop, locate the Reports Builder icon and launch the executable.
In the Welcome dialog box of Reports Builder select the Open an existing
Report option and click OK.
Open p3q1.jsp from the file system and run the paper layout. Use the iconic
button on the horizontal toolbar, or use the Run Paper Layout option in the
Program menu.
If prompted, connect to the database using the login information your
instructor gives to you.
When the Runtime Parameter Form comes up, select one of the customers in
the list, and select Run Report.
2. Using the same report, display the Data Model view of the Report Editor.
In the Object Navigator, select Q_1.
Hint: Move the Data Model window to the right so that you can also see the
Object Navigator. Use the Find field at the top of the Object Navigator to locate
Q_1.
Notice the object that is selected in the Data Model view.
If the Report Editor window is still active from the previous exercise, select
View > Change View > Data Model from the menu.
If you closed the Report Editor after the previous exercise:
Select Tools > Report Editor from the menu and then select View > Change
View > Data Model from the menu. Or, double-click the Data Model object
icon in the Object Navigator.
Move the Data Model window to the right of your screen so that you can also
see the Object Navigator.
Activate the Object Navigator window.
Click in the Find field and enter Q_1. The Navigator expands the appropriate
node and highlights the first object that meets the entered value.
In the Data Model view, the query object Q_1 is selected.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 3 (continued)
3. Using the same report, switch to the Paper Layout view of the Report Editor.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In the Object Navigator, select F_CUSTOMER_ID.
Hint: Use the Find field at the top of the Object Navigator.
Notice the object that is selected in the Paper Layout view.
Fully expand the Paper Layout node and select R_G_ORD_ID.
Notice the object that is selected in the Paper Layout view.
While the Report Editor window is active, select View > Change View > Paper
Layout from the menu.
Activate the Object Navigator window.
Click in the Find field and enter F_. The Navigator expands the appropriate
node and highlights the first object that meets the entered value.
In the Paper Layout view the field F_CUSTOMER_ID is selected.
In the Object Navigator window, select the Paper Layout node and select
Expand All in the vertical toolbar; or select View > Expand All from the
menu. Select R_G_ORD_ID.
In the Paper Layout view, the repeating frame R_G_ORD_ID is selected.
4. Using the same report, run the Web layout.
Select Program > Run Web Layout from the menu, or select the Run Web
Layout iconic button from the horizontal toolbar.
5. Use Help Contents to answer the following questions:
From the menu, select Help > Help Contents. Use the Index tab to locate each
term.
a. What is RWSERVLET?
Enter RWSERVLET. RWSERVLET is the executable for the Reports
Servlet.
b. What is RWCLIENT?
Enter RWCLIENT. RWCLIENT is the executable for the Reports Client.
It parses and transfers the command line to the Reports Server.
c. What is the Web Source view?
Enter Web Source. The Web Source is a view of the Report Editor that
displays the source code for your Web report, including JSP and HTML
tags.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 4
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating and saving a Tabular report
Modifying the report to create and save a Group Above break report
Creating and saving a form letter
Creating and saving a Matrix report
Creating and saving a Matrix with Group report
Introduction
The questions in the practice session are intended to ensure that you have a good
understanding of how to create various styles of reports using the Report Wizard.
Note: When you are completing the practice sessions, keep to the file naming
conventions that the questions specify. You might need these files in later practices.
In addition, note the field headings and widths. With many reports, you need to change
these to achieve the desired result.
Many of the practice sessions ask you to rename files beforehand; be sure to use Save
As, not Save, so that you do not overwrite the existing file name.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 4 (continued)
Invoking Reports Builder and the Wizard
Oracle University Internal and TransAmerica Training Management Inc Partner use only
If Reports Builder is open after the previous practice session:
Close any reports currently in the Object Navigator.
Create a new report by selecting the Reports node and selecting the Create icon.
Note: There is an alternative method. If no reports are open in the Object Navigator, you
can double-click the Reports node.
1. Create a tabular report, paper layout only, containing the following data. Use
Query Builder to build the query.
DEPARTMENTS: DEPARTMENT_NAME
EMPLOYEES: FIRST_NAME, LAST_NAME, JOB_ID, SALARY
Display all fields. Do not make any changes to the other Wizard pages.
In the New Report dialog box, select the option "Use the Report Wizard" and
click OK.
In the Welcome to the Report Wizard! page, click Next.
In the report layout page, select Create Paper Layout only and click Next.
In the report style page, Tabular is selected by default. Click Next.
In the data source type page, SQL Query is selected by default. Click Next.
In the data source definition page, click Query Builder.
In the Select Data Tables dialog box, highlight the DEPARTMENTS and
EMPLOYEES tables, click Include, and close the dialog box.
In the Query Builder window, select the columns from the tables and click
OK.
Click Next.
Copy all fields from the Available Fields area to the Displayed Fields area.
Click Next on all other Wizard pages and click Finish on the last page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 4 (continued)
2. Using the reentrant Report Wizard, make the following modifications (test your
Oracle University Internal and TransAmerica Training Management Inc Partner use only
report frequently).
Select Tools > Report Wizard from the menu or the right-mouse-button
menu.
a. Modify the query to sort the data in descending order of salary.
On the Data tab choose Query Builder.
In the Query Builder window select Sort. Copy the SALARY column to
the Sorted Columns, select it, and select Sorting Order as Descending.
Close the Sort dialog box and the Query Builder.
Click Finish to test your report.
b. Add a summary to show the total salary value.
Reenter the Report Wizard by choosing Report Wizard from the menu.
On the Totals tab select SALARY and click Sum.
c. Ensure the width of SALARY and TOTAL is 6.
Make the necessary changes on the Labels tab.
d. Select the Green template.
Select the Green template on the Template tab and click Finish to test
your report.
e. Save the report to a file named p4q2.rdf.
Select File > Save As from the menu and save the file to disk.
3. Using the reentrant Wizard, modify the report to create a break report.
a. Select the report style Group Above.
Select the report style on the Style tab.
b. Modify the query and remove the join clause so that the report contains all
employees and not just managers.
Select the Data tab. Edit the query, removing the join clause
DEPARTMENTS.MANAGER_ID=EMPLOYEES.EMPLOYEE_ID.
Watch for syntax errors!
c. Group the report by the department name.
On the Groups tab copy DEPARTMENT_NAME to the Group Fields
area.
Click Finish.
d. Save the report as p4q3.rdf.
Select File > Save As from the menu and save the file to disk.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 4 (continued)
4. Create a new report as follows:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Using the Report Wizard, create a paper layout and select the Mailing Label
style.
Create a new report by selecting the Reports node in the Object
Navigator and choosing the Create icon.
As an alternative you can also select File > New > Report from the menu.
Select Create Paper Layout only. Select Mailing Label style.
b. Enter the query in the data source definition window:
For the query type, accept the default selection of SQL query.
Enter the query text:
select c.cust_first_name || ' ' ||
c.cust_last_name Name, c.cust_address
from customers c
c. In the text area, include each of the following fields on a new line: NAME,
STREET_ADDRESS, CITY, and STATE_PROVINCE. Include
COUNTRY_ID, and POSTAL_CODE on the same line.
Copy NAME, STREET_ADDRESS, CITY, STATE_PROVINCE,
COUNTRY_ID, and POSTAL_CODE to the Mailing Label Text area.
To enter the line feeds you can either use the New Line button or simply
press the [Return] key.
d. Select No template and click Finish.
Select the No template radio button on the Template page and click
Finish.
e. Save the report to a file named p4q4.rdf.
Select File > Save As from the menu and save the file to disk.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 4 (continued)
5. Using the reentrant Wizard, modify the report to create a Form Letter style.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Select Tools > Report Wizard from the menu or the right-mouse-button
menu.
On the Style tab select Form Letter.
a. Modify the query to include order information for each customer:
On the Data tab, modify the query text as follows:
select c.cust_first_name || c.cust_last_name Name,
c.cust_address, o.order_id, o.order_total
from customers c, orders o
where c.customer_id = o.customer_id
b. In the text area, enter some free-flowing text for each order. For example:
Order No. &<ORDER_ID> has been shipped to &<NAME> in
&<C_CITY>.
The order has a total value of &<ORDER_TOTAL> dollars.
Thank you for your business.
Copy the fields that you want to use to the Form Letter Text area and
enter your free-flowing text.
c. Select a different template and click Finish.
On the Template page in the Wizard, select any one of the predefined
templates. Click Finish.
d. Save the report as p4q5.rdf.
Select File > Save As from the menu and save the file to disk.
6. Create a new report.
Create a new report by selecting the Reports node in the Object Navigator
and choosing Create icon.
As an alternative you can also select File > New > Report from the menu.
a. Create both a Web and paper layout. Select the matrix report style.
On the first page, select Create both Web and Paper Layout. On the
Style page choose Matrix.
b. For the query, import the contents of p4q6.sql.
Choose Import Query and select p4q6.sql from the Import dialog
box.
c. Display customer names down the left side of the page.
Copy NAME to the Matrix Row Fields area.
d. Display product numbers across the top of the page.
Copy PRODUCT_ID to the Matrix Column Fields area.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 4 (continued)
e. Display the sum of the total values in the cells.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Select Sum to copy the sum of TOTAL_VALUE to the Matrix Cell Fields
area.
f. Create a summary to give the total of the sum(total_value) values.
Select SumTOTAL_VALUE and choose Sum.
g. Change the width of all four summaries to 4. Change the PRODUCT_ID
label to Product. Remove the label for SumTOTAL_VALUE.
Make the necessary changes in the Labels and Width fields.
h. Select any template and click Finish to preview your report.
Select a template and click Finish to run your report.
i. Save the report to a file named p4q6.jsp.
Select File > Save As from the menu and save the file to disk.
7. Modify the matrix report to create a Matrix with Group.
Select Tools > Report Wizard from the menu or the right-mouse-button
menu.
On the Style tab select Matrix with Group.
a. Select Month as the group and check that all totals have a width of 4.
Go to the Groups tab and copy MONTH to the Matrix Group Fields
area.
Check on the Labels tab that all fields with a label Total: have a width of
4.
b. Click Finish to preview your report and save the report as p4q7.jsp.
Select File > Save As from the menu and save the file to disk.
Note: The query for the matrix reports above has been restricted to display
only products beginning with 1, so that you can see and understand the
complete matrix more easily.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 4 (continued)
8. Web-enable a paper report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Open report p2q9.rdf and run the paper layout.
To open the file select File > Open from the menu or choose Open from
the Toolbar. Run the report by selecting the Run Paper Layout icon
from the horizontal toolbar.
b. Add a bookmark to the report, letting the department names serve as
bookmarks.
Select Insert > Bookmark from the menu. Copy the Department_Name
field from the Available Columns to the Bookmarks. Click OK.
c. Generate HTML Style Sheet output. Save the file as p4q8.htm.
Select File > Generate to File and select Paginated HTMLCSS. In the
Save file dialog box change the filename to p4q8.htm and select Save.
d. Open the report in a browser.
Start your browser. Select File > Open and use the Browse button to
specify the location and name of your file.
e. What happens when you click on the bookmarks?
The cursor jumps to that specific part in the report.
f. Close the browser and in Reports Builder, save the report as p4q8.rdf.
Close the browser. Select File > Save As and change the filename to
p4q8.rdf. Select Save.
g. Save and close all reports.
For each open report, select File > Save from the menu or Choose Save
from the horizontal toolbar. Then Select File > Close.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 5
This practice session involves modifying reports by applying changes in the Paper
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Design view of the Report Editor.
Introduction
In this practice session, you will reuse some of the reports that you created in the last
session.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 5
1. Open report p4q2.rdf. Make the following changes in the Paper Design view:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
To open the file select File > Open from the menu or select Open on the
toolbar.
Run the report by selecting it in the Object Navigator and then selecting
Program > Run Paper Layout from the menu or selecting the Run Paper
Layout icon in the toolbar.
a. Make the SALARY column right-justified. Do not forget to justify the
column header accordingly.
Select the column SALARY and its label. Then choose Align Right from
the style bar or select Format > Justify > Right from the menu.
b. Add a comma and a currency symbol to SALARY. Add two decimal places.
While the SALARY column is selected, click Commas from the style bar.
This adds the group separators. Click Currency from the style bar. Then
click Add Decimal Place from the style bar to add one decimal place.
Repeat the action for the second decimal place. You can also select the
commas and decimal places options from the Format > Number menu.
c. Make the total at the end of the report right-justified and add commas, a
currency symbol, and two decimal places, as in the column SALARY.
Select the column, then select Align Right from the style bar or select
Format > Justify > Right from the menu.
While the column is selected choose Commas, Currency, and then Add
Decimal Place from the style bar. Repeat the action for the second
decimal place.
d. Change the label of the total to italic font.
Select the label, then select Italic from the style bar or use Format > Font
in the menu.
e. Make whatever other changes you like.
No formal solution.
f. Save the report to a file named p5q1.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 5 (continued)
2. Open report p4q3.rdf. Make the following changes in the Paper Design:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
To open the file select File > Open from the menu or select Open from the
toolbar.
Run the report by selecting it in the Object Navigator and then selecting
Program > Run Paper Layout from the menu or selecting Run Paper Layout
from the toolbar.
a. Add a border with a with a hairline width around the total for each
department.
Select the column for department total and choose Line Color from the
vertical toolbar. Select any color to add the border. With the column
selected, format the width of the border: select Format > Line > Line
Width > Hairline.
b. Add commas and two decimal places to the SALARY field and the total and
make them right-justified. Do not forget to justify the column header for the
SALARY field accordingly.
Select the total, the column, and its header, then select Align Right from
the style bar or select Format > Justify > Right from the menu.
While the column is selected choose Commas and then Add Decimal
Place from the style bar. Repeat the action for the second decimal place.
You can also select the options from the Format menu.
c. Make the same changes to the total at the end of the report. Move the grand
total so that it aligns with the SALARY field (you must do this manually; use
the ruler guides to help you).
Select the column, then choose Align Right from the style bar or select
Format > Justify > and from the menu.
While the column is selected choose Commas and then Add Decimal
Place from the style bar. Repeat the action for the second decimal place.
You can also select the options from the Format menu.
d. Change the color of the employee data heading to blue.
Select a label, and choose Select Parent Frame from the style bar. Select
Fill Color from the vertical toolbar.
e. Make whatever other changes you like.
No formal solution.
f. Save the report to a file named p5q2.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 5 (continued)
3. Open report p5q3_a.rdf. Make the following changes in the Paper Design:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
To open the file select File > Open from the menu or select Open from the
toolbar.
Run the report by selecting it in the Object Navigator and then selecting Run
Paper Layout from the Program menu or selecting Run Paper Layout from
the toolbar.
a. Add a date at the top center of the page. Give it any format you want.
Select Insert > Date and Time from the menu. Choose the font, style, and
text color you want.
b. Make whatever other changes you like.
No formal solution.
c. Save the report to a file named p5q3.rdf and close it.
4. Open report p4q6.jsp. Make the following changes in the Paper Design:
To open the file select File > Open from the menu or select Open from the
toolbar.
Run the report by selecting it in the Object Navigator and then selecting
Program > Run Paper Layout from the menu or selecting Run Paper Layout
from the toolbar.
a. Right-justify the Product ID field.
Select the Product ID field, then select Align Right from the style bar or
select Format > Justify > Right from the menu.
b. Add commas and two decimal places to the cells and summaries and make
them right-justified.
Select the columns and choose Align Right from the style bar or select
Format > Justify > End from the menu.
While the columns are selected choose Commas from the style bar. Click
Add Decimal Place twice from the style bar. You can also select the
options from the Format menu.
c. Why are some of the cell and summary values displayed with asterisks?
What can you do to correct this?
The addition of the comma and two decimal places increased the width
of the data such that it exceeded the display size. To correct this, reenter
the Wizard and increase the width of the cell and summary fields. Select
Report Wizard from the right-mouse-button menu. Select the Labels tab
and choose a width more suitable for displaying the formatted values.
Try a width of 6.
d. Add a blue line color to the parent frame of NAME.
Select the column NAME and choose Select Parent Frame from the style
bar. Select Line Color from the vertical toolbar.
e. Save the report to a file named p5q4.jsp and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 5 (continued)
If You Have Time
Oracle University Internal and TransAmerica Training Management Inc Partner use only
5. Open the file p5q2.rdf and conditionally highlight the SALARY field.
To open the file select File > Open from the menu or select Open from the
toolbar.
Run the report by selecting it in the Object Navigator and then selecting
Program > Run Paper Layout from the menu or selecting Run Paper Layout
from the toolbar.
a. If the salary is less than 8500, print the field in italics.
Select the SALARY field, then choose Format > Conditional Formatting
from the menu or use the right-mouse-button to open the pop-up menu
and select Conditional Formatting from the pop-up menu.
The Conditional Formatting dialog box opens. Click New and enter the
condition and formatting as required. Select a font name. Click OK to
return to the first page but do not close the dialog box.
b. If the salary is more than 12000, print the field in bold italics and make the
text color red.
Click New again and enter the second condition and formatting as
required. Click OK to return to the first page of the dialog box and then
OK again to close the dialog box.
c. Save the report to a file named p5q5.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 6
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Customizing an existing template
Applying the modified template to an existing report
Introduction
In this practice session, you open an existing template, which is one of the standard
templates shipped with the Oracle Reports Developer 10g installation.
You modify objects in the margin and body sections and save the template to a new
filename. Then, you apply the modified template to an existing report and note the
differences.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 6
1. Customize an existing template, adding a company logo and report title to the
Oracle University Internal and TransAmerica Training Management Inc Partner use only
report margin, and modify the report body.
a. Open rwblue.tdf. This file should exist in your working directory; it is a
copy of the Blue predefined template.
Select the Templates node in the Object Navigator.
Select Open and select the file named rwblue.tdf.
b. Display the margin region. (This usually appears by default when you open a
template.)
Select Tools > Template Editor from the menu. If the margin region is
not displayed, click the Margin icon in the horizontal toolbar.
c. Delete the Your Company logo. Import towers2.jpg and place it in the
top left corner of the margin; this file should exist in your home directory.
Select the Your Company logo and press the [Delete] key.
Select Insert > Image from the menu.
Use the Browse button to locate towers2.jpg
Resize it to fit into the margin region.
d. Add a report title: Lakeside Technologies.
Select the Text tool from the vertical toolbar. Click inside the editor and
type in the title. Select a font and font size. Click outside the textbox to
end.
e. Display the body region to view the changes you will make in the next steps.
Click the Margin button in the horizontal toolbar in the Template
Editor.
f. Change the justification of numeric fields (number field and summary) to
Right. Do not forget to change the justification of labels for number fields to
Right.
Select the number field and the number heading in the Template Editor
and click the Align Right tool from the stylebar.
Alterative solution:
Open the Field Labels/Headings and the Fields nodes under Paper
Layout > Section > Body > Default in the Object Navigator.
Open the Property Inspector for your selections.
Click Union (the button is a toggle and the tooltip says Intersection at
this point) from the Property Inspector toolbar to display all properties.
Under the headings Labels and Fields, change the Number Justification
property to Right.
Select Summaries > Number in the Object Navigator.
In the Property Inspector change the Number Justification property for
fields to Right.
g. Save the template as laketech.tdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 6 (continued)
2. Apply the modified template to an existing report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Hint: You must search for the template file; it does not appear in the list of
predefined templates.
a. Open p4q3.rdf.
b. Apply laketech.tdf to the report.
Invoke the Report Wizard. On the Template tab select the option
Template file. Click Browse to enter the name of the file in the field
below.
c. The report shows some changes but not all. Which template changes have
been applied and which have not?
Changes applied: Logo and report title
Changes not applied: Number justification
d. To apply all changes to your report, you will have to create the layout again.
From the menu, select Edit > Select All to select all layout objects. Now
delete them. Invoke the Report Wizard and reapply your template.
Note: When you delete the objects, Reports Builder displays the
following warning: This will delete the frame and all the objects it
encloses. Continue?. Click Yes
e. Save the report as p6q2.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 6 (continued)
3. Continue to modify the template and test it using a new report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Change the text color of the master group fields to red for the Group Left
style only.
Hint: In the Template Editor, use the Report Style list to switch to a Group
Left style. This way you can select the correct group. To see the entire
template layout structure, and recognize the difference between the master
group fields and the detail group fields, select View > Zoom > Zoom Out
from the menu.
Select the Character, Number, and Date fields and change the text color
with the Text color palette.
Alternative solution:
In the Object Navigator, expand the Override node, then the Group Left,
the Section (Level1), and the Fields nodes.
Bring up the Property Inspector for all the fields
Change the text color to red.
b. Save your template as laketech2.tdf and close it.
c. Create a new report, using the Report Wizard.
Use the layout style Group Left.
Import the query p6q3.sql from your working directory.
Make DEPARTMENT_NAME the group field.
Display all other columns.
Do not create summaries.
Change the width of SALARY to 6 and COMMISSION_PCT to 4.
Apply the Template file laketech2.tdf.
No formal solution.
d. Save the report as p6q3.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 7
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating reports for the Web using the Report Wizard
Examining the Web source code
Modifying a Web report using the Report Wizard
Introduction
In this practice session, you create simple reports for the Web using the Report Wizard.
You also examine the Web source code to identify specific JSP tags.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 7
1. Create a tabular report, Web and paper layout, entitled Compensation Report. The
Oracle University Internal and TransAmerica Training Management Inc Partner use only
report should contain the following data:
SELECT d.department_name, e.first_name, e.last_name,
e.job_id, e.salary
FROM departments d, employees e
WHERE d.department_id = e.department_id
a. Display all fields. Select the predefined Blue template. Do not make any
changes to the other Wizard pages.
Create a new report using the Report Wizard. Create both a Web and
paper layout. Select Tabular as the style and enter Compensation Report
as the title. Select SQL as the data source and enter the query text from
above. Select all fields for display. Do not create any totals. Select the
Blue template and Finish the Wizard.
b. Run the Web layout to test.
Select Program > Run Web Layout from the menu or select the Run
Web Layout icon from the horizontal tool bar.
c. Examine the Web source. How many <rw:foreach> tags are in the code?
Why this number?
Display the Web Source view of the Report Editor by one of the
following methods:
- Double-click the Web Source object icon in the Object Navigator.
- Click the Web Source button in the Report Editor toolbar.
Use Edit > Find and Replace to locate the rw:foreach tag(s). There is one
tag in this Web source code because there is one group in the data model.
d. Modify the report using the Report Wizard. Make this a Group Left break
report displaying employing information grouped by department. Include a
sum for salary. Reenter the Wizard. Select Group Left as the style. On the
Groups page, select DEPARTMENT_NAME from the Available Fields
list and copy into the Group Fields list. On the Totals page, select
SALARY and click Sum >. Finish the Wizard.
e. Examine the Web source again. Now how many <rw:foreach> tags are in the
code?
Display the Web Source view of the Report Editor. Use Edit > Find and
Replace to locate the rw:foreach tag(s). There are two rw:foreach tags,
one for each group in the Data Modelone for the master group, one for
the detail group.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 7 (continued)
f. Which JSP tag identifies the overall appearance and formatting of the data in
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the Web report?
The rw:style tag identifies the style sheet for the report.
g. Which JSP tag delimits the data model and layout information? Can you
view this information in the Reports Builder?
The rw:objects tag delimits the data model and the layout information
for a Reports JSP. Reports Builder displays the <rw:objects > tags,
but, hides the data model and layout information. To see this, use a text
editor such as Wordpad.
h. Run the Web layout to test. Save the report as p7q1.jsp.
2. Create a report for the Web that displays current product information.
a. Use the Report Wizard to create a new tabular report called Our Products.
Include the following data from the PRODUCT_INFORMATION table:
Column Label
product_id Product No.
product_name Name
product_description Description
catalog_url Catalog URL
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 8
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying report hierarchy by creating additional groups
Restricting records in a query
Restricting records with a packaged filter
Introduction
In this practice session, you modify an existing tabular report and create a break report.
Using two different techniques, you restrict the records in a report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 8
1. Open report p8q1_a.jsp, a tabular report showing customer information.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Run the paper layout.
Select Program > Run Paper Layout from the menu or select Run Paper
Layout from the toolbar.
b. In the Data Model view, create a break group using NLS_TERRITORY as
the break column. Rename the group G_COUNTRY.
Click the Data Model button in the toolbar of the Report Editor.
Click and drag NLS_TERRITORY up out of the G_CUSTOMER_ID
group, creating a new group above G_CUSTOMER_ID.
Double-click the group bar to display the Property Inspector for this new
group. Enter G_COUNTRY in the Name property field.
Alternative solution: In the Object Navigator, double-click on the name
to obtain the I-beam, and then edit the name as desired.
c. Reenter the Report Wizard to update the layout. Select the Group Left style.
Ensure that all fields are displayed.
Select Tools > Report Wizard from the menu or the right-mouse-button
menu.
On the Style tab select Group Left.
On the Fields tab, make sure that all fields are listed in the Displayed
Fields area.
Click Finish.
Examine the Web Source and note that is was updated with the new
group information. Locate the <rw:foreach . . .> tag for the
group G_country.
d. Save the report as p8q1.jsp. Do not close the report.
2. Modify the previous report to restrict the number of customer records processed by
the group.
a. Place a filter on the G_CUSTOMER_ID group to display only the first ten
customers. Run to test.
Select the group G_CUSTOMER_ID in the data model and open the
Property Inspector. Set the property Filter Type to First and enter 10 for
the Number of Records property. Run the paper layout.
b. Save the report as p8q2.jsp and close it.
3. Modify p8q1.jsp to restrict the report to customers who have a credit limit
greater than 1500. You need to modify the query properties.
a. Include CREDIT_LIMIT in the query statement, although you do not need to
display it. Restrict the query statement to show those customers who have a
credit limit greater than 1500.
In the Data Model, right-click the query Q_1, and select Edit Query.
Alternatively, you can also modify the query in the Property Inspector.
Enter WHERE CREDIT_LIMIT > 1500 directly in the query
statement area.
b. Save the report as p8q3.jsp and run the Web layout.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 9
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a second query in an existing report
Creating a data link
Creating a report using a pluggable data source
Creating a report containing a REF cursor query
Introduction
In this practice session, you include new data in a report by adding a query to an existing
single-query report using the Data Wizard. You also practice linking data from different
queries to alter the report structure. You will create a new report using the XML
pluggable data source and a SQL query.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 9 (continued)
1. Open p8q1_a.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. In the Data Model, create the following query:
QUERY: Q_ORDERS
select customer_id, order_id, to_char(order_date,
'dd-Mon-yyyy') order_date,
order_total
from orders
Open p8q1_a.jsp from the file system. Display the Data Model view of
the Report Editor by double-clicking the Data Model icon in the Object
Navigator.
Select the SQL Query tool and click in the Data Model painter area.
Enter the query as above and click OK.
b. Change the name of the group to G_ORDERS.
Double-click the group bar to display the Property Inspector for new
group. Enter G_ORDERS in the Name property field.
c. Open the Report Wizard, create both a Web and paper layout, and select a
Tabular style.
Invoke the Report Wizard. Make the appropriate selections on the
Report Type and Style pages.
d. Copy group G_ORDERS to the Displayed Groups area.
On the Groups page, select G_ORDERS from the Available Groups area
and click the Down > button.
e. Copy all remaining fields to the Displayed Fields area.
On the Fields page, select all the remaining fields from the Available
Fields area and copy to the Displayed Fields area.
f. Select a template and click Finish.
g. Note how the data appears in the Paper Design view. The
G_CUSTOMER_ID data appears before the G_ORDERS data. Remember
that you can alter the order in which the data is displayed by modifying the
query order in the Data Model. You may want to try that.
Note: If you do adjust the order of the queries, put them back in the original
order and save before the next question.
h. Save the report as p9q1.jsp.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 9 (continued)
2. Continue with the same report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. In the Data Model, link the two queries together on the primary and foreign
keys.
Select the Data Link tool. Click and drag from the CUSTOMER_ID
column in the Customer group to the CUSTOMER_ID1 column in the
Orders group.
b. Redo the layout by opening the Report Wizard. Select the Group Above
style.
Do not display CUSTOMER_ID.
Reenter the Report Wizard and make the necessary changes.
c. Save the report as p9q2.jsp.
d. Run the Web layout.
3. Create a new report that lists the sales representatives and the products they have
sold.
a. Create both a Web and paper layout and select a Group Above report style.
b. Import the query file p9q3_a.sql.
c. Make NAME and EMPLOYEE_ID the group fields. Make sure that these
fields are in one group, at Level 1, and not two separate groups.
On the Groups page, select NAME and EMPLOYEE_ID in the Available
Fields area and copy them to the Group Fields area, making sure they
are both at the same level.
d. Do not display EMPLOYEE_ID, but display all other fields in the order
described in the table below.
e. Change the following field attributes:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 9 (continued)
h. Now you need to show not only which products the sales representatives
Oracle University Internal and TransAmerica Training Management Inc Partner use only
have sold but also who are the customers they have done business with.
Go to the Data Model and add a new query, importing the file
p9q3_b.sql.
This query returns the customer names, their IDs, and the total sales per
customer for each sales representative.
Display the Data Model view. Select the SQL Query tool and click in the
painter area. Select Import SQL Query and locate the file p9q3_b.sql.
i. Ensure that the group is named G_CUSTOMER.
j. Link the second query to the correct group.
Select the Data Link tool. Click and drag EMPLOYEE_ID in G_NAME
to SALES_REP_ID in G_CUSTOMER.
k. Use the Report Wizard to display the new group. Display only the
CUSTOMER, CUSTOMER_ID, CUST_TOTAL fields.
Reenter the Wizard and make the requested changes.
l. Change the following field attributes:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 9 (continued)
c. Create an XML Query. For the Data Definition, locate the file
Oracle University Internal and TransAmerica Training Management Inc Partner use only
warehouse_inventory.xsd. For the Data Source, locate the file
warehouse_inventory.xml.
Select the XML Query tool. Click in the painter area of the Data Model
view. Specify the Data Definition by clicking the Browse button and
locating the file warehouse_inventory.xsd. Make sure the file type
selected in the Open dialog box is XSD.
Specify the Data Source by clicking the Browse button and locating the
file warehouse_inventory.xml
d. Link the two data sources together so that your report will provide a general
description of each warehouse along with the specific inventory for each
location.
Select the Data Link tool. Click and drag from WAREHOUSE_ID in the
SQL query group to WAREHOUSE_ID1 in the XML query group.
e. Create both a Web and paper layout for this report. Select the Group Above
style. Ensure that both groups are selected and display all fields. Use the Blue
template for this report.
Invoke the Report Wizard. Work through the pages of the Wizard
making the selections as indicated. Click Finish to run the paper layout.
f. Save the report as p9q4.jsp.
g. Run the Web layout.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 9 (continued)
5. Create a new report using a REF cursor query.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. In the Object Navigator, create a local package called RefCur defining a
record and a REF cursor. The record has the following fields:
Name Definition
last_name employees.last_name%type
first_name employees.first_name%type
salary employees.salary%type
Create a new report manually. Select the Program Units node in the
Object Navigator and click the Create icon.
In the New Program Unit dialog box, enter RefCur as the name for the
package and choose Package Spec.
Enter the code for the package specification. This code is available in
p9q5a.txt.
PACKAGE RefCur IS
TYPE EmpRec IS RECORD (
last_name employees.last_name%TYPE,
first_name employees.first_name%TYPE,
salary employees.salary%TYPE);
Type EmpCur IS REF CURSOR RETURN EmpRec;
END;
Compile the code and close the PL/SQL editor.
b. In the Data Model, create a REF Cursor Query. The function opens the cursor
for the following SELECT statement:
SELECT last_name, first_name, salary
FROM employees
Select the Ref Cursor Query tool and click in the painter area. Define the
following function or copy the code from the text file p9q5b.txt.
function QR_1RefCurDS return RefCur.EmpCur is
V_EmpCur RefCur.EmpCur;
begin
OPEN V_EmpCur
FOR
SELECT last_name, first_name, salary
FROM employees;
RETURN V_EmpCur;
end;
Compile the code and close the PL/SQL editor.
c. Open the Report Wizard to create the layout for the tabular report. Select all
the fields and choose a template. Click Finish to run the paper layout.
d. Save the report as p9q5.jsp and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 10
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a new report with summaries
Opening an existing report to add summary calculations to the columns
Creating a new report with ranking summary columns
Opening an existing report to add placeholders for the highest and lowest values in
the report
Introduction
In your reports, you may need to include additional columns with summary functions
or even add summaries, such as break totals and report totals. This practice gives you the
opportunity to create summaries and additional columns with functionality that cannot
be achieved using SQL alone.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 10
1. Create a new report using the Report Wizard. Create both a Web and paper layout
Oracle University Internal and TransAmerica Training Management Inc Partner use only
and select a Group Above report style.
a. Select the following columns in the Query Builder:
Table Columns
ORDERS order_id, order_date
ORDER_ITEMS line_item_id, product_id, unit_price, quantity
Hint: Manually edit the query created by Query Builder to modify the
display of order_date using the TO_CHAR function and specify an alias:
TO_CHAR(order_date, dd-Mon-yyyy)Order_Date
b. Modify the query to include line_total as a calculation of
unit_price*quantity.
Enter the formula unit_price*quantity into the query text and
give it an alias name of line_total.
You can also use the Query Builder to create expressions in the query:
Select the table ORDER_ITEMS.
Select Define Column from the toolbar.
Enter Line_Total inside the Defined Columns box.
Enter the expression unit_price*quantity inside the Defined as
box and click OK.
Note: Performing the calculation directly in the query is a better solution
than having a formula column.
c. Group the data on Order ID and Order Date and display all the fields.
Move Order_ID and Order Date to the Group Fields section. Make sure
they are at the same level.
d. Create the following summaries. Can you use the Report Wizard to create the
summaries?
Because this is a single query report, you can use the Report Wizard.
Column Summary
line_total sum
line_total % Total
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 10 (continued)
f. Use the Gray template and finish the Wizard.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In the Template tab choose and apply the template. Finish and run the
report.
g. In the Data Model, alter the position of columns in the G_ORDER_ID group
so that ORDER_DATE is above ORDER_ID, and change the break order on
ORDER_DATE so that it is sorted in descending order.
Click on ORDER_DATE and drag it above ORDER_ID; be careful not
to drag it outside the group.
Open the Property Inspector for ORDER_DATE and change the Break
Order property to Descending.
h. Run both the paper and Web layouts to test the report (do not reenter the
Wizard).
i. Save the report as p10q1.rdf and close it.
2. Open report p9q3.jsp.
a. Create columns to show the percentage of the total per sales representative
for PROD_TOTAL and CUST_TOTAL.
In the Data Model, select Summary Column in the vertical toolbar and
click inside the group G_PRODUCT. This creates a new summary.
Open the Property Inspector for the new column and name it
PCT_PROD.
In the Summary section select the function % of Total.
The Source is PROD_TOTAL.
Reset at G_PRODUCT.
Compute at G_NAME.
Select Summary Column in the vertical toolbar and click inside the
group G_CUSTOMER. This creates a new summary.
Open the Property Inspector for the new column and name it
PCT_CUST.
In the Summary section select the function % of Total.
The Source is CUST_TOTAL.
Reset at G_CUSTOMER.
Compute at G_NAME.
b. Update the layout. Make all the new summaries four characters wide.
Reenter the Wizard to update the layout. Display the new columns and
ensure each has a width of four.
c. Save the report as p10q2.jsp.
d. Run the Web layout.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 10 (continued)
3. Create a new report to list employees by department ranked by their salaries.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Create both a Web and paper layout and select the Group Left report style.
a. Import the query from p10q3.sql. Select the group field as
DEPARTMENT_NAME and display the following data.
Table Column Label Width
departments department_name Department 10
employees employee_id ID 2
first_name First Name 6
last_name Last Name 6
salary Salary 8
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 10 (continued)
Hint: You need one formula column and two summaries and two
Oracle University Internal and TransAmerica Training Management Inc Partner use only
placeholders. You can import the code for the formula column from the file
p10q4.txt.
Display the Data Model for the report.
Create two summary columns at the report level :
Name Function Source Reset At
CS_Max Maximum SumLineTotalPerORDER_ID Report
CS_Min Minimum SumLineTotalPerORDER_ID Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 11
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Opening an existing report to add header and trailer pages
Distributing a report to various destinations
Modifying an existing report to add a repeating frame to the header section
displaying order information.
Opening an existing report and adding flexible lines
Introduction
In this practice session, you use reports created in earlier practice sessions.The aim is to
familiarize you with the different layout sections and regions of a report, and to use
report bursting. You also add flexible lines to a frame.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 11 (continued)
1. Open report p10q1.rdf. Modify the report as follows:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Create a header section.
Open the Paper Layout view of the Report Editor. Select Header Section
from the horizontal toolbar or choose View > Layout Section > Header
from the menu. Make sure that you are editing the Body region, not the
Margin.
Display the monitor.jpg file as fixed boilerplate in the Body region.
Select Insert > Image from the menu to insert the file. Move and resize it.
Add a rectangle boilerplate object. Give it fill color.
Select the Rectangle tool from the vertical toolbar. Make the rectangle
large enough to fit the image inside.
Select Fill Color from the vertical toolbar.
Place the image on top of the rectangle. Center the two objects.
Hint: Use the Layout option from the menu.
Select the rectangle and select Layout > Send To Back from the menu.
Select the image, press the [Shift] key, and select the rectangle.
Select Layout > Alignment from the menu. In the dialog box select Align
to Each Other and then Align Center both horizontally and vertically.
Click OK.
Include todays date in the top right portion of the margin.
Select Edit Margin from the horizontal toolbar. Select Insert > Date and
Time from the menu. Select Top-Right as the placement of the date field.
Select any of the formats for the date. Click OK.
b. Add a report title in the body region.
Use Arial bold as the font and 20 as the size.
Click the Text tool from the vertical toolbar and click in the layout area.
Enter the text and click outside the text object.
While the text object is selected, choose font and size from the stylebar.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 11 (continued)
c. Add a trailer section that displays todays date with the text End of Report
Oracle University Internal and TransAmerica Training Management Inc Partner use only
on one line, and Report run on: on the second line in the body region.
Select a larger font.
Hint: Copy and paste the date from the Margin Area of the header section of
the report.
Select Trailer Section from the horizontal toolbar, or Select View >
Layout Section > Trailer from the menu. Make sure that you are editing
the Body region.
Click the text tool from the vertical toolbar and click in the layout area.
Enter the text and click outside the text object.
While the text object is selected, select font and size from the stylebar.
Select Edit Margin from the horizontal toolbar. Now select Header
Section.
Select the f_date1 field and then select Edit > Copy from the menu.
Select Trailer Section from the horizontal toolbar. Deselect Edit Margin.
Select Edit > Paste from the menu and move the field to the desired
place.
d. Save the report as p11q1.rdf.
e. Run the Paper Layout. Run the Web layout. What is different?
The paper layout has the header and trailer sections, the Web layout
does not.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 11 (continued)
2. Open report p10q1.rdf.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Modify the report to add a header section that lists all order numbers, order
dates, and order totals in the body region.
Open the Paper Layout view of the Report Editor. Select Header Section
from the horizontal toolbar, or choose View > Layout Section > Header
from the menu. Make sure that you are editing the Body region.
Select the Report Block tool from the vertical toolbar and click in the
Layout area. In the Report Block Wizard, select a tabular layout.
Select the group G_ORDER_ID and give a print direction down.
Select the fields ORDER_ID, ORDER_DATE, and
SumLinetotalPerOrder_Id.
b. Add Executive Summary as boilerplate text in the margin region of the
header section.
From the horizontal toolbar, choose Edit Margin. Select the Text tool
and create the boilerplate text.
c. Set the distribution for the header section to an HTMLCSS file.
In the Object Navigator, open the Property Inspector for the Header
Section. Select the Distribution property. In the Distribution Dialog box
set the Distribution ID to any string identifier, DESNAME to the
filename that you want, and DESFORMAT to HTMLCSS.
d. Set the distribution for the main section to a PDF file.
In the Object Navigator, open the Property Inspector for the Main
Section. Select the Distribution property. In the Distribution Dialog box
set the Distribution ID, DESNAME, and DESFORMAT fields. Make
sure the output format is PDF.
e. Run and test the report using the Distribute facility in Reports Builder.
Select File > Distribute.
f. Look at the output generated for both file formats.
Locate the files in your file system having the filenames that you
specified in the DESNAME field. Double-click each of them to look at
the output.
g. Save the report as p11q2.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 11 (continued)
3. Open report p11q3.rdf. Modify the report to burst on repeating data, based on
Oracle University Internal and TransAmerica Training Management Inc Partner use only
warehouse ID, and distribute a PDF report for each warehouse.
a. In the Paper Layout view of the Report Editor, select the outermost repeating
frame and delete it.
Invoke the Paper Layout view of the Report Editor. Locate the repeating
frame R_G_WAREHOUSE_ID in the Object Navigator. The repeating
frame is now selected in the Paper Layout. With focus on the Paper
Layout, delete the repeating frame. Be sure you do not delete the frame
from the Object Navigator as this will delete all the objects within the
frame as well.
b. Set the property for the main section of the report to burst on each warehouse
ID.
Select the Main Section node in the Object Navigator. Double-click the
object icon to display the Property Inspector or select Tools > Property
Inspector from the menu.
Locate the Repeat On property and select G_WAREHOUSE_ID from
the drop-down list.
c. Define the distribution for the report. Generate a PDF file for each
warehouse, using the warehouse name as a unique identifier for each PDF
file, such as rptBejiing.pdf.
Select the Distribution property for the Main section. In the Distribution
Dialog box set the Distribution ID, DESNAME, and DESFORMAT
fields. Use warehouse_name in the DESNAME field, for example:
rpt&<warehouse_name>.pdf. Make sure the output format is PDF.
d. Activate the distribution.
Select File > Distribute from the menu.
e. Save the report as p11q3.rdf.
f. Look at the output generated for several of the warehouses.
Locate the files in your file system, for example, rptBeiging.pdf,
rptBombay.pdf and double-click several of them to look at the output.
4. Open report p11q4.rdf.
a. Use the Report Wizard to increase the width of PRODUCT_DESCRIPTION
to 30.
b. Add a flexible line vertically between the PRODUCT_NAME and
PRODUCT_DESCRIPTION fields.
Select the line tool from the vertical toolbar. Create a line between the
fields. If you want to ensure that the line is vertical, press the [Shift] key
while drawing. In the Property Inspector, set Line Stretch with Frame to
R_G_PRODUCT_ID.
c. Run the Paper Layout to test.
d. Save the report as p11q4.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 11 (continued)
5. Open and run report p2q10.rdf.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Using the Paper Design view, compare the output with s11q5a.rdf
from the \Soln directory. What is different? Change the report so that
it looks like s11q5a.rdf.
Both are master detail reports. But in s11q5a.rdf the groups are
intermixed.
b. Fully expand the Paper Layout node for p2q10.rdf.
Select the Paper Layout node for p2q10.rdf. Then select Expand All
in the Vertical toolbar.
c. Open the Paper Layout and move the window to the right. Make sure it
doesnt obscure the Object Navigator window.
d. Move the F_EMPLOYEE field down 2 inches. It should not be enclosed by
any frame.
Select Flex Off and Confine Off in the Horizontal toolbar. Click and
drag the F_EMPLOYEE field down 2 inches. Notice where the field is
being placed in the object hierarchy.
e. Resize the R_G_EMPLOYEE frame so that it only encloses the F_SALARY
and F_JOB_ID fields.
In the Object Navigator, select R_G_EMPLOYEE. In the Paper Layout,
resize the frame.
f. Resize the M_G_EMPLOYEE_GRPFR frame so that it encloses the
R_G_EMPLOYEE repeating frame.
In the Object Navigator, select M_G_EMPLOYEE_GRPFR. In the
Paper Layout, resize the frame.
g. Move the F_DEPARTMENT_NAME and F_DEPARTMENT_ID fields to
the right.
Click and drag the fields to the right.
h. Create a new repeating frame in the free space. Set the Line color attribute to
No line.
Select Repeating Frame form the Vertical toolbar. Click and drag an
area in the space previously occupied by F_DEPARTMENT_ID and
F_DEPARTMENT_NAME.
Using the Line Color palette, set the line color to No Line.
Note: Ensure that the new repeating frame R_1 is at the same level as
M_G_EMPLOYEE_GRPFR. Use the Object Navigator to verify this.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 11 (continued)
i. Link the repeating frame to the G_EMPLOYEE group.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Open the Property Inspector for the new repeating frame and set the
Source property to G_EMPLOYEE.
j. Move the F_EMPLOYEE field inside the repeating frame R_1.
k. Save the report as p11q5a.rdf and run the paper layout. What happens?
A run-time error occurs as the F_EMPLOYEE field is at the wrong
hierarchy level, meaning not enclosed by the right parent object.
l. Fix the layout hierarchy error.
Select F_EMPLOYEE, the from the menu select Layout > Bring to
Front.
The field is now enclosed by R_1.
m. Rearrange the column headers.
Click and drag the column headers to match the column positions.
n. Run the paper layout.
The two data groups are now intermixed.
o. Close the report. Save as p11q5a.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 12
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a break report with continuation pages displaying limited information
Modifying properties for object Web support
Introduction
Sometimes detail records get separated from their master header. You ensure that this
does not happen.
All paper layout objects support Web features. You will create a report that takes you to
a PDF document with a simple click using a hyperlink.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 12
1. Create a new break report showing each customer and the relevant orders.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Create a group above master detail report. Use the query p12_1.sql to
create the report.
In the Report Wizard, select the Group Above report style and use
Import SQL Query.
b. Select Name as the group field and display all the customer data in the break
group. Create a sum for the quantity.
The break group should contain all the fields from the CUSTOMERS
table. Create totals by using the Sum function on the quantity column.
c. Modify the width for the fields listed below:
Column Label Width
name Name: 20
street_address Address: 10
city City: 10
state_province State / Province: 10
postal_code Zip: 5
country_id Country: 2
credit_limit Credit Limit: 6
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 12 (continued)
2. Create a new tabular report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Define the SQL query as:
select last_name, first_name, hire_date
from employees
Display all fields. Choose the Wine template.
b. In the Margin region of the reports Main Section, delete the company logo.
Resize the margin to 1.75 inches. Insert the image dinner1.bmp. Create a
rectangle around it and give it a solid fill. Move the rectangle behind the
image to create the effect of a colored border around the image.
In the Paper Layout, select Edit Margin. Select the Your Company, Inc.
logo and delete it.
Select the margin rectangle. Using the central handle on the top edge,
size the margin to 1.75 inches.
Then from the menu, select Insert > Image and browse for
dinner1.bmp. Click OK.
From the vertical toolbar, select Rectangle.
Click and drag a rectangle around the image. Give it a solid fill. From
the menu, select Layout > Send to Back.
c. When you click on the image in HTML output you want to open a local
.pdf file named mousse.pdf.
Open the Property Inspector for the image and set the hyperlink
property to mousse.pdf.
d. Save the report as p12q2.rdf and generate a file in paginated HTMLCSS
format. Open the file in your browser and test the hyperlink.
Save the report. Select File > Generate to File > Paginated HTMLCSS.
Start your browser, open the file, and click on the image.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 13
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying the printing of a mailing label report
Controlling the number of records on a page
Adding a link file to a report
Ensuring that all details of a master are printed on the same page
Introduction
Modify a mailing label report to ensure you fill the printed page with label records. You
then restrict the number of labels that are printed on each page.
You add a link file to display a company logo by dynamically referencing a file at run
time.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 13
1. Open report p4q4.rdf.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Modify the layout so that the mailing labels are 2 inches wide and 1 inch
high. Use the Layout option on the menu. Ensure that the customer names are
printed in alphabetical order across the page.
Open the Paper Layout view of the Report Editor and select the
repeating frame. From the menu, select Layout > Size Objects. Select
Custom for both width and height and enter the size in the fields. You
can also drag and resize the repeating frame in the Paper Layout.
Add an ORDER BY clause to the query to sort the labels on
cust_last_name.
b. Give each label a solid fill.
Select Fill Color from the vertical toolbar and select a color.
c. Make the boilerplate object 1.8 inches wide and center it horizontally and
vertically in the repeating frame.
Select the boilerplate object in the Paper Layout and choose Layout >
Size Objects from the menu. Select Custom for the width and No Change
for the height. Enter the width in the field below.
Select both the boilerplate object and the repeating frame and choose
Layout > Alignment from the menu. Select Align to Each Other, and
then Align Center, both horizontally and vertically.
d. Add spacing between the labels: .25 inch between each column of labels
across the page; .5 inch between each row of labels down the page.
Select the repeating frame and open its Property Inspector. Set Horiz.
Space Between Frames to .25 and Vert. Space Between Frames to .5.
e. Run the paper layout to test. Save the report as p13q1.rdf.
2. Continue with report p13q1.rdf.
a. Modify the report so that only six labels are printed on each page.
Select the repeating frame and open its Property Inspector. Set
Maximum Records per Page to 6.
b. Run the paper layout to test. Save the report as p13q2.rdf and close it.
3. Open p10q1.rdf.
a. On the operating system, copy the file summitlo.tif to a file
logo.tif.
Ask your instructor for help if needed.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 13 (continued)
b. Delete the logo in the margin area and create a file link in its place to display
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the contents of logo.tif.
Select Edit Margin from the horizontal toolbar. Select the logo
boilerplate and press [Delete]. Select the File Link tool from the vertical
toolbar and create an external boilerplate object in the margin region
where the logo was. Set the following properties:
Property Value
Name B_logo
Source File Format Image
Source Filename logo.tif
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 14
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Adding dynamic content to an existing Web page to create a Reports JSP
Customizing a Web report using JSP tag attributes
Introduction
In this practice, you will create a Web report by adding dynamic report data to an
existing HTML page. You will also customize the Web report by using JSP tag
attributes.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 14
1. Create a new Web report by adding dynamic content to an existing Web page.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Open the file mywebpage.htm in Reports Builder.
b. Define a data model using the Data Wizard. Import the query p14q1.sql.
Use DEPARTMENT_ID and DEPARTMENT_NAME as the group fields.
Include a sum of the salaries.
Display the Data Model view of the Report Editor. Right-mouse-click in
the Data Model painter area and select Data Wizard from the menu.
Select SQL Query on the Data Source page.
Import the query p14q1.sql.
Copy department_id and department_name from the Available
Fields area to the Group Fields area. Be sure both columns are at the
same level (Level 1).
Select the salary column and click Sum >.
Click Finish to complete the Data Wizard.
c. Save the report as p14q1.jsp.
d. Create a report block and add it to the Reports JSP. The Web source code has
a place holder for your report block. Choose the Group Left style and include
a title Salaries by Department. Include all groups and display in the down
direction. Display all fields. Use a label of Name for
DEPARTMENT_NAME and Title for JOB_ID. Select the predefined Beige
template.
Display the Web Source view of the Report Editor by double-clicking on
the object icon for the Web Source in the Object Navigator.
Scroll through the code until you locate the placeholder Insert your
report block here.
With your cursor in that position, select Insert > Report Block from the
menu.
Select the style Group Left and enter Salaries by Department in the title
field.
Select the group G_department_id and click Down >.
Select the group G_Employee and click Down >.
Copy all the columns from the Available Fields area to the Displayed
Fields area.
On the labels page, make the appropriate changes.
Select the Beige template. Click Finish.
e. Run the Web layout to test. Save the report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 14 (continued)
2. Customize report p14q1.jsp using JSP tag attributes.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Display the salary and summary values with an appropriate currency format.
Display the Web Source view of the Report Editor. Locate the rw:field
tag for F_SALARY and add the formatMask attribute:
<rw:field id="F_salary" src="salary"
nullValue=" " formatMask="$999,999.00">.
Locate the rw:field tag for F_SumsalaryPerdepartment_id and add the
same format mask attribute:
<rw:field id="F_SumsalaryPerdepartment_id...
"formatMask="$999,999.00">
Locate the rw:field tag for F_SumsalaryPerReport and apply the same
formatMask attribute.
b. Run the Web layout to test. Did you remember to format the report
summary? Save the report as p14q2.jsp.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 15
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Running a report using an XML definition
Applying an XML report definition to an existing .rdf file
Introduction
Using XML you can build fully functional reports or partial reports that can serve as a
customization file.
You will run an XML file and apply an XML definition to an existing report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 15 (continued)
1. Run an XML report definition.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Open p15q1.xml using Wordpad. Examine the code. What type of report
definition is this? What goes on in this file?
It is a full XML report definition with both a fully functional data model
and layout. It builds a two query group above report. It creates a data
link between the two queries and a summary column in the master
group. It uses the template rwbeige.tdf, but overrides the formatting
for the F_SAL field through a formatting exception.
b. Execute p15q1.xml using the Run Paper Layout option in Reports Builder.
Open p15q1.xml in Reports Builder and select Program > Run Paper
Layout from the menu or use the Run Paper Layout icon from the
toolbar.
2. Apply run-time customizations.
a. Open p15q2.rdf. Run the paper layout.
b. What type of report is this? Investigate the data model, the paper layout, and
the report sections.
It is a simple tabular report. There is nothing in the Header and Trailer
sections. There are no summary fields, and no data formatting.
c. Open p15q2.xml. Examine the code. What goes on in this XML definition
file?
It has a data source that is different from what is in the p15q2.rdf
report. The data is going to be formatted in the header section. In the
main section it has a formatting specification for the SALARY column in
the main section.
d. Apply p15q2.xml to p15q2.rdf using the RWRUN command and send
the output to a PDF file.
Specify the following command in the Command Prompt window:
RWRUN report=p15q2.rdf customize=p15q2.xml
destype=file desformat=PDF desname=myreport.pdf
userid=<username>/<password>@<database>
e. Examine the newly created report output. What do you see?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 16
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Modifying an existing report to use a bind parameter
Adding a dynamic list of values
Adding a lexical parameter
Adding a static list of values
Creating a customized parameter form
Introduction
In this practice session, you create bind and lexical parameters to restrict records in the
report. You add lists of values to select valid values at run time.
You then create your own default parameter form and customize it to include extra text
and graphics.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 16
1. Open report p13q3.rdf.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Modify the data model and add the following columns from the
CUSTOMERS table. Create a new group for the customer information above
the G_ORDER_ID group.
Column Label Width
cust_first_name || || cust_last_name Name 30
cust_email Email 20
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 16 (continued)
b. Save the report as p16q2.rdf. Do not close it for the moment.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
c. Run the paper layout to test the report. Run the Web layout as well.
3. Open report p5q3.rdf.
a. Create a lexical parameter to enable users to order the data by different
columns (or not at all) at run time. Include an ORDER BY clause in the
query with a lexical reference to the parameter. Enter an initial value for the
parameter to order by the employees last name.
In the Object Navigator, expand the Data Model node. Double-click the
User Parameters node to create a parameter.
Select the parameter name P_1 and change it to P_ORDER.
Open the parameter Property Inspector.
Make sure that the datatype is Character and increase the width to 50.
Enter an Initial Value:
ORDER BY employees.last_name
In the Data Model, open the query Property Inspector and add the
following lexical reference to the end of the query:
&P_ORDER
b. Add a static list of values for the parameter P_ORDER. Code two or three
alternative ORDER BY clauses. Allow any clause to be entered at run time.
Display the Property Inspector for the parameter P_ORDER and select
List of Values.
In the dialog box choose Static Values and enter other ORDER BY
clauses in the Value field; for example:
ORDER BY employees.last_name
ORDER BY employees.job_id
For each value, remember to select Add>> to add the value to the list.
Clear the Restrict List to Predetermined Values check box.
c. Run the paper layout to test.
Select an ORDER BY clause from the list.
Enter your own ORDER BY clause.
Delete the initial parameter value.
d. Save the report as p16q3.rdf and close it.
4. Continue with report p16q2.rdf.
a. Create a default parameter form.
Include a Title message but not a Hint message.
Display the P_CUSTOMER parameter.
Select Tools > Parameter Form Builder from the menu.
Enter your own Title message. Delete the Hint message.
Select P_CUSTOMER.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 16 (continued)
b. Use your imagination to customize the form in the Parameter Form editor.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Make sure that the parameter P_CUSTOMER is placed in a prominent
position for user entry.
Add some graphics; modify colors and fill patterns.
No formal solution.
c. Add a format mask to the field displaying line_total.
Open the Property Inspector for F_LINE_TOTAL. In the Format Mask
property, select one of the masks, such as $<N,NNNN.00>.
d. Run the paper layout to test. Select a customer from the list.
e. Save the report as p16q4.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 17
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Using the Graph Wizard to create a graph in an existing report
Altering the graph with the Graph Wizard
Creating graphs in an existing report that will be printed once for each record of a
group
Creating a graph for a Web report
Customizing a graph for a Web report
Introduction
In this practice session you open existing reports to add graphs using the Graph Wizard.
You reenter the Graph Wizard to change the characteristics of a graph. You will also
add and customize a graph in a Web report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 17
1. Open report p17q1a.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Run the paper layout to become familiar with the report.
b. Rename SumCust_totalPersales_rep_id to Total_Sales (a shorter, more
meaningful name looks better in a chart).
Display the Data Model and open the Property Inspector for
SumCust_totalPersales_rep_id to change the name. Alternatively,
change the summary field name in the Object Navigator > Data Model >
Groups node.
c. Use the Graph Wizard to create a bar chart.
In the Paper Layout, select Insert > Graph from the menu and enter the
following properties on the Wizard pages:
In the layout page of the Graph Wizard, drag sales_rep_id from the
Groups section to the Bars section.
d. Run the paper layout to test. Resize the graph in the Paper Layout, if
necessary.
e. Save report as p17q1.jsp.
2. Reenter the Graph Wizard to change the characteristics of the graph created in the
previous exercise.
In the Paper Layout view, make sure that the graph is selected; otherwise you
will create a new graph.
Select Graph Wizard from the right-mouse menu.
a. Give the graph the following characteristics:
Enter the following properties in the Wizard pages:
Click OK.
b. Run the paper layout to test.
c. Save report to p17q2.jsp.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 17 (continued)
3. Continue with report p17q2.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Run the Web layout. What do you see?
There is no graph displayed in the Web output because you have not yet
added it to the Web source.
Also, an error message displayed: Cannot find cursor containing column
"SumCust_totalPersales_rep_id" because the name of the summary
column was changed in the Data Model but not in the Web source.
b. Update the Web source with the correct column name.
Display the Web Source view. Locate the reference for <rw:field
id="F_SumCust_totalPersales_rep_id"...>. Edit the source
attribute for this field to src="Total_Sales".
c. Run the Web layout again to test.
d. Add a graph to the Web source. Position the graph at the beginning of the
report.
Display the Web Source view. Scroll down the code and position your
cursor just before the Data Area Generated by Reports Developer.
Select Insert > Graph from the menu and enter the following properties
on the Wizard pages:.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 17 (continued)
4. Open report p9q3.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Use the Graph Wizard to create a pie chart for the data group G_PRODUCT.
Invoke the Graph Wizard with the focus on the Paper Layout.
Display the Paper Layout view of the Report Editor. Select Insert >
Graph from the menu, and enter the following properties on the Wizard
pages:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 17 (continued)
b. Run the Web layout to test. Ensure that a graph displays for each sales
Oracle University Internal and TransAmerica Training Management Inc Partner use only
representative.
c. Resize the graph to a width of 800 and a height of 450.
Display the Web Source view. Locate the rw:graph tag. Add width and
height settings to the attribute list: <rw:graph id="graph
src="G_PRODUCT" groups="PRODUCT_ID
dataValues="PROD_TOTAL" width="800" height="450">
d. Save the report as p17q5.jsp. Run the Web layout to test.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 18
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Opening and changing an existing matrix report
Building a nested matrix report
Adding summaries to the nested matrix report
Displaying zeros for summary values and restricting the number of columns per
page
Displaying more meaningful column information and rotating the text
Introduction
In this practice session, you use an existing matrix report to investigate the different
methods of displaying the cell values and the implications. You use an existing SQL
query to create a nested matrix report. You then add row- and column-level summaries
to the report and display zeros for null values.
If you have time, include the product names instead of the product IDs and rotate the
names.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 18
1. Open report p4q6.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. How many repeating frames do you have?
There are two repeating frames, R_G_NAME and R_G_PRODUCT_ID.
b. Change the properties of the cell object to display zero for a null value.
Open the Property Inspector for F_SumTOTAL_VALUE and set Value
if Null to 0.
c. Run the paper layout to test the report.
All cells without a value now display 0.
d. Close the report without saving it.
2. Create a new report, importing the query p4q6.sql from your working
directory.
Select File > New > Report from the menu, or open a new report in the Object
Navigator. Use the Report Wizard.
a. Select the following settings:
product_id Product 5
month Month 4
SumTotal_value Total 5
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 18 (continued)
c. Increase the width of the Main Section of the report to 17 inches.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Open the Property Inspector for the Main Section of the paper layout.
Set the Width property to 17.
d. Save the report as p18q2.jsp. Run the paper layout.
e. Which summaries were created?
SumTOTAL_VALUEPerName
SumTOTAL_VALUEPerPRODUCT_ID
SumTOTAL_VALUEPerReport
These are the row, the column, and the report summaries.
f. Use the Data Model view to create summaries for each month and for the
level month and product.
In the Data Model, click the Summary Column button in the tool palette
and click inside the cross product group G_SumTOTAL_VALUE.
Repeat the steps for the second summary column.
Property Value
Name SumMonth
Product Order G_MONTH
Function Sum
Source SumTOTAL_VALUE
Reset At G_MONTH
Property Value
Name SumMonthProduct
Product Order G_MONTH G_PRODUCT_ID
Function Sum
Source SumTOTAL_VALUE
Reset At G_PRODUCT_ID
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 18 (continued)
g. Use the Paper Layout view to create the fields. You must expand the
Oracle University Internal and TransAmerica Training Management Inc Partner use only
appropriate repeating frame.
Select and expand R_G_MONTH. You must enable Flex Mode. Do not
forget to disable it again when you have finished.
Select the Field tool from the vertical toolbar.
Create a field below F_SumTOTAL_VALUE. Position the field in the
R_G_MONTH and the R_G_PRODUCT_ID repeating frames.
Set the following properties:
Property Value
Name F_SumMonthProduct
Source SumMonthProduct
Property Value
Name F_SumMonth
Source SumMonth
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 18 (continued)
If You Have Time
Oracle University Internal and TransAmerica Training Management Inc Partner use only
4. Open the report as p18q3.jsp.
a. Make the necessary changes in the Data Model view to include the product
name.
Use the right mouse button and click Edit Query.
The query in the SQL Query Statement dialog box should read:
SELECT C.CUST_FIRST_NAME || ' ' || C.CUST_LAST_NAME
Name,
I.PRODUCT_ID,
SUM(I.UNIT_PRICE * QUANTITY TOTAL_VALUE),
TO_CHAR (O.ORDER_DATE, 'MM/RR') MONTH,
P.PRODUCT_NAME PRODUCT
FROM CUSTOMERS C, ORDER_ITEMS I, ORDERS O,
PRODUCT_INFORMATION P
WHERE I.PRODUCT_ID LIKE '1%
AND O.CUSTOMER_ID = C.CUSTOMER_ID
AND I.ORDER_ID = O.ORDER_ID
AND P.PRODUCT_ID = I.PRODUCT_ID
GROUP BY C.CUST_FIRST_NAME || ' ' ||
C.CUST_LAST_NAME,
I.PRODUCT_ID,
TO_CHAR (O.ORDER_DATE, 'MM/RR'),
P.PRODUCT_NAME
b. In the Paper Layout view, delete the product_id field and insert a boilerplate
object to display the product name. Rotate this object by 90 degrees.
Note: You may have to expand the R_G_PRODUCT_ID frame and the
outermost frame. Watch out for frequency errors.
Select F_PRODUCT_ID and press [Delete].
Select the Text tool from the vertical toolbar and create a text object in
the place of the F_PRODUCT_ID field.
Enter: &PRODUCT.
Select the boilerplate object.
Select the Rotate tool from the vertical toolbar.
Press [Shift] and click the boilerplate object to rotate it by 90 degrees.
Open the Property Inspector for the boilerplate object and set Vertical
and Horizontal Elasticity to Variable.
Open the Data Model view and ensure that the G_PRODUCT_ID group
contains the PRODUCT column by dragging it in there.
c. Run the paper layout. Save the report as p18q4.jsp.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 19
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating a format trigger to conditionally display different layouts
Creating and use a report-level PL/SQL function
Creating and use an external PL/SQL library
Creating a PL/SQL group filter
Introduction
In this practice session, you create a format trigger to conditionally flag one of two
paper layouts for the same data. You also conditionally flag some records in a report by
creating and referencing a report-level (local) PL/SQL function. You then move the
code into a new PL/SQL library and alter the reference to use the library function
instead.
If you have time, restrict the number of records processed in a report by creating your
own group filter.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 19 (continued)
1. Create a new report, using p19q1.sql.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Display the records in two different layouts, showing different columns in
each.
b. Create a Group Above layout using the following columns from the query:
Select Group Above as the report style in the Report Wizard.
Import the SQL Query from file p19q1.sql.
Select customer_id as the group field. Do not display order_status. Select
Labels and other properties as you wish.
Group Column
G_CUSTOMER_ID customer_id
G_ORDER_ID order_id
order_date
order_mode
order_total
c. Create a Tabular layout using the following columns from the query:
In the Paper Layout view, select the Report Block tool from the vertical
toolbar or using Insert > Report Block from the menu.
Select the G_order_id group and click the Down button. Display the
following fields. Select Labels and other properties as you wish.
Column
order_id
order_date
order_total
d. Create a user parameter, user_type, that has two possible values: Sales
Representative and Sales Clerk.
In the Object Navigator, select the User Parameters node and click the
Create icon.
Open the Property Inspector for the parameter. Enter USER_TYPE in
the Name property.
Ensure the Datatype property is set to Character.
Create a static list of values containing Sales Representative and
Sales Clerk.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 19 (continued)
e. Ensure that only the Group Above layout is displayed when the user type is
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Sales Representative, and that only the Tabular layout is displayed when the
user type is Sales Clerk.
To create a format trigger on the M_G_CUSTOMER_ID_GRPFR
group, select the frame in the first layout, open the Property Inspector
and select the Format Trigger property. An alternative way of creating a
format trigger is to select the group in the Object Navigator, right-click
and select the PL/SQL Editor menu option.
function M_G_CUSTOMER_ID_GRPFRFormatTri return
BOOLEAN is
begin
if :user_type = 'Sales Representative' then
return(true);
else
return(false);
end if;
end;
Create a format trigger on the M_G_ORDER_ID_GRPFR1 group frame
in the second layout with the reverse logic:
function M_G_ID_GRPFR1FormatTri return BOOLEAN is
begin
if :user_type = 'Sales Clerk' then
return(true);
else
return(false);
end if;
end;
Note: You can implement the same logic using the Conditional
Formatting property in the Property Inspector for both the group
frames.
To test the result, display the USER_TYPE parameter in the margin of the
report.
Display the Paper Layout view and select Edit Margin. Create a field. In
the Property Inspector, specify the source as USER_TYPE.
Make sure that you can enter a parameter value at run time.
Select Tools > Parameter Form Builder from the menu and select
USER_TYPE from the Parameter list. Click OK to create the Paper
Parameter Form.
Test the report by changing the User Type parameter on the Runtime
Parameter Form.
f. Save the report as p19q1.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 19 (continued)
2. Continue with the previous report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Modify the report so that the Tabular (Sales Clerk) layout displays an extra
column that indicates, with an asterisk, those orders that have an order status
of 5.
Create a new Program Unit, by using the Program Units node in the
Object Navigator. Create a function called ASTERISK:
function asterisk(ostatus number)
return varchar2 is
begin
if ostatus = 5 then
return('*');
else
return('');
end if;
end;
In the Data Model view, create a formula column in the detail group
G_ORDER_ID.
Open the Property Inspector and alter the following properties for the
column CF_ASTERISK:
Name Datatype Width
CF_ASTERISK Character` 1
Click PL/SQL Formula to open the PL/SQL editor, and call the
ASTERISK function from the formula.
function CF_asteriskFormula return varchar2 is
begin
return(asterisk(:order_status));
end;
In the Paper Layout view, increase the width of the R_G_ORDER_ID
repeating frame in the second layout to allow room for another field.
Create a field inside the repeating frame, rename it F_CF_ASTERISK,
and source it to CF_ASTERISK.
b. Remember to change user type to Sales Clerk during testing.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 19 (continued)
c. Move the function code into a new PL/SQL library named p19lib.pll.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In the Object Navigator, select the PL/SQL Libraries node and click the
Create icon to create a new library.
Open the library node and click and drag the ASTERISK function into
the Program Units node below the library.
Save the PL/SQL library as a file with the name P19LIB.PLL.
Delete the report-level ASTERISK function.
To attach the library to the report, click the Attach Library node in the
Object Navigator. Click the Create button. In the Attach Library dialog
box, use the Browse button to locate the .pll file. Click the Attach button.
In the warning dialog box, click Yes to remove the path for the attached
library.
Recompile the formula column, CF_ASTERISK.
d. Run the report.
The report that was previously calling the report-level function will now
call the external function.
e. Save the report to p19q2.rdf.
3. Continue with the previous report.
a. Modify the same layout to display additional spacing between every two
records.
In the Data Model view, create a summary column in the G_ORDER_ID
group to keep a running total of records.
Name Function Source Reset At
In the Paper Layout view, increase the height of the repeating frame for
the second layout. Remember to switch Flex mode on, so that you can
increase the repeating frame and the group frame together.
Open the repeating frame Property Inspector and change the Vertical
Elasticity to Variable.
Select the rectangle tool and click and drag an area inside the repeating
frame, below the fields. Make sure the rectangle is transparent: no fill,
no line.
In the Object Navigator, rename the rectangle to B_space and create the
following format trigger:
function B_spaceFormatTrigger return boolean is
begin
if mod(:count_ord,2) = 0 then return(TRUE);
else return(FALSE);
end if;
end;
b. Save the report as p19q3.rdf and close it.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 19 (continued)
If You Have Time
Oracle University Internal and TransAmerica Training Management Inc Partner use only
4. Open report p19q1.rdf.
a. Write your own group filter to restrict the number of customers displayed,
depending on the value of a parameter that you enter at runtime.
Hint: You need to create two parameters, to keep track of how many records
have been processed, compared to the cutoff number of records required.
Make sure that you can enter the cutoff parameter at run time.
In the Object Navigator, open the Data Model node, and select the User
Parameters node select the Create icon to create the first parameter.
Select the Create icon to create a second parameter.
Rename the parameters P_COUNT_CUST and P_CUTOFF.
Give P_COUNT_CUST an initial value of 0.
Open the G_CUSTOMER_ID group Property Inspector.
Set Filter Type to PL/SQL
Select PL/SQL Filter to open the PL/SQL editor.
Enter the following code:
function G_CUSTOMER_IDGroupFilter return boolean
is
begin
:p_count_cust := :p_count_cust + 1;
if :p_count_cust <= :p_cutoff then
return(TRUE);
else
return(FALSE);
end if;
end;
Display the Paper Parameter Form and include a parameter form field
PF_cutoff along with descriptive text.
b. Test the report several times by changing the cutoff parameter at run time.
c. Save the report as p19q4.rdf.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 20
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Building a report containing conditional highlighting
Modifying a Web report with conditional highlighting
Executing a detail report from a master report
Writing to a temporary table from a report
Introduction
In this practice session, you highlight values based on conditional PL/SQL code.
You build a master report that enables you to call a detail report and generate a separate
PDF file for each detail report.
If you have time, you add report-level triggers to an existing report to write messages to
a temporary table at various stages of report execution.
Write PL/SQL functions as local PL/SQL (report-level), and reference the code in a
condition within the relevant object trigger in the report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 20
1. Open report p9q3.jsp.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Display the column CUST_TOTAL in the customer group as red, bold italics
if its value is 10,000 or more.
Hint: Check the Help system for the SRW.SET <attributes> or use
conditional formatting.
Mask Attribute Suggested Value
SRW.SET_TEXT_COLOR Red
SRW.SET_FONT_WEIGHT SRW.BOLD_WEIGHT
SRW.SET_FONT_STYLE SRW.ITALIC_STYLE
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 20 (continued)
c. Write the necessary format triggers.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Create a format trigger on the F_CUST_TOTAL field to call the
function.
function F_CUST_TOTALFormatTrigger return
boolean is
begin
if :cust_total >= 10000 then
return(field_mask);
else
return(TRUE);
end if;
end;
Create a format trigger on the R_G_CUSTOMER repeating frame to
call the function.
function R_G_CustomerFormatTrigger return
boolean is
begin
if :cust_total <= 5000 then
return(record_mask);
else
return (TRUE);
end if;
end;
d. Save the report as p20q1.jsp.
e. Run the paper layout.
2. Continue with the same report.
a. Run the Web layout for the report. Is there formatting on the CUST_TOTAL
column?
There is no formatting in the Web layout. The format triggers that you
created in the previous exercise were applied to the paper layout objects
only.
b. Modify the Web source so that the column CUST_TOTAL in the customer
group displays as red, bold italics if its value is 10,000 or more.
Display the Web Source view.
Locate the rw:field tag for F_CUST_TOTAL. Use Edit > Find and
Replace and search for F_CUST_TOTAL.
Add the formatMask attribute to the rw:field tag and set its value to
F_CUST_TOTALFORMATTRIGGER:
<rw:field id="F_Cust_total" src="Cust_total"
nullValue=" "
formatTrigger="f_cust_totalformattrigger">
c. Save the report as p20q2.jsp.
d. Run the Web layout to test.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 20 (continued)
3. Execute a detail report from a master report.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
a. Create a simple tabular report called MGR_MASTER. The report should
query last names and employee IDs for those employees who are managers.
Display all fields. You can use the query:
SELECT distinct manager.last_name Manager,
manager.employee_id
FROM employees worker, employees manager
WHERE worker.manager_id = manager.employee_id
Create a new tabular report using the Report Wizard. Enter the SQL
query above. Display all fields and select labels and template as desired.
b. Save the report as mgr_master.rdf.
c. Create another tabular report, the detail report, and name it EMP_RPT. The
report should return department number, employee name, and salary for a
specific manager. The manager_id will be passed to EMP_RPT by
MGR_MASTER.
Create a new tabular report using the Report Wizard. Define the SQL
query:
SELECT department_id,
first_name ||' '|| last_name Employee, salary
FROM employees
WHERE manager_id = :mgr_no
Display all fields and select labels and template as desired.
d. Save the report as emp_rpt.rdf and close it.
e. Write the code to execute the detail report. For each manager returned,
MGR_MASTER should invoke the detail report, EMP_RPT, pass it the
managers employee_id, and produce a report in PDF format containing
information about the employees working for that manager. Use the
managers employee_id to create an output filename for each manager:
MGR_<employee_id>.PDF.
Hint: You can write the code in the group filter.
Open the Property Inspector for the group G_MANAGER. Set the Filter
Type property to PL/SQL. Select the PL/SQL Filter property to open the
PL/SQL editor. Create the following function:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 20 (continued)
f. Compile the PL/SQL code and close the window.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
g. Run the paper layout for MGR_MASTER to test. Access the file system and
locate the output for the detail reports. View two or three of the output files.
h. Save mgr_master.rdf and close it.
If You Have Time
4. Open report p10q1.rdf
In this report, you use report triggers to create a temporary table at the start of
report execution, and you insert rows into the table at various stages of the
execution.
a. Write a trigger that creates a temporary table to hold the date and userid each
time the report is run. The table should contain three columns: one date
column, one character column of width 10, and one character column of
width 80.
CREATE TABLE RUNREPORT
(DATE_RUN DATE, USER_RUN VARCHAR2(10), COMMENTS
VARCHAR2(80))
In the Object Navigator, expand the Report Triggers node, and double-
click the Before Report PL/SQL icon to open the PL/SQL editor.
Create the following function:
function BeforeReport return boolean is
begin
srw.do_sql('CREATE TABLE RUNREPORT
(DATE_RUN DATE, USER_RUN VARCHAR2(10),
COMMENTS VARCHAR2(80))');
return(true);
exception
when srw.do_sql_failure then null;
end;
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 20 (continued)
b. The same trigger should also insert the current date, userid, and Starting
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Report into this table.
INSERT INTO RUNREPORT
(DATE_RUN, USER_RUN, COMMENTS)
VALUES (SYSDATE, USER, 'Starting Report')
Hint: Think about how you code the single quotes.
Add the following code:
function BeforeReport return boolean is
begin
srw.do_sql('CREATE TABLE RUNREPORT
(DATE_RUN DATE, USER_RUN VARCHAR2(10),
COMMENTS VARCHAR2(80))');
srw.do_sql('INSERT INTO RUNREPORT
(DATE_RUN, USER_RUN, COMMENTS)
VALUES (SYSDATE, USER,
''Starting Report'')');
srw.do_sql(COMMIT);
return(TRUE);
end;
c. Compile the PL/SQL code and close the window.
d. Save the report as p20q4.jsp.
e. Run the paper layout.
f. Using SQL*Plus, verify that your table exists and was populated
successfully.
g. Log on to SQL*Plus (in Microsoft Windows, select the SQL*Plus icon in the
Oracle group) using the same userid as you used for Reports.
h. Display all records in the RUNREPORT table.
SQL> col comments format a40
SQL> SELECT * FROM RUNREPORT;
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 20 (continued)
i. Try running the report more than once. When you run the report a second
Oracle University Internal and TransAmerica Training Management Inc Partner use only
time, the table already exists and Reports Builder raises an exception. Make
the necessary change to your code so that the report runs even when the table
exists.
You need two PL/SQL blocks so that, if the table already exists, the
record is inserted after the exception has been handled.
Add the following code:
function BeforeReport return boolean is
begin
begin
srw.do_sql('CREATE TABLE RUNREPORT
(DATE_RUN DATE, USER_RUN
VARCHAR2(10),
COMMENTS VARCHAR2(80))');
exception
when srw.do_sql_failure then
null;
end;
begin
srw.do_sql('INSERT INTO RUNREPORT
(DATE_RUN, USER_RUN, COMMENTS)
VALUES (SYSDATE, USER, ''Starting
Report'')');
srw.do_sql(COMMIT);
return(TRUE);
end;
end;
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 20 (continued)
j. Write a trigger that inserts a record with the comment Printing another
Oracle University Internal and TransAmerica Training Management Inc Partner use only
page whenever it begins a new page.
In the Object Navigator, expand the Report Triggers node, and double-
click the Between Pages PL/SQL icon to open the PL/SQL editor.
Or, if the editor is already open, change the Name to Between Pages.
Create the following function.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 21
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Constructing a URL to run a report on the Web
Creating an entry in the key map file
Introduction
You publish your reports using OracleAS Reports Services in the Oracle
Application Server. This practice session consists of paper-based questions to test your
understanding of OracleAS Reports Services.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 21
1. You created a report called SalaryByDept.jsp that displays the salary
Oracle University Internal and TransAmerica Training Management Inc Partner use only
information for a particular department value by accepting a runtime parameter
p_deptno. You need to deploy the report on the Web using a URL.
Component Description
Web server neptune
domain name world
port 8889
alias for the directory path salarydata
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 21
3. In addition to using a URL, what are the other methods for requesting a report?
Oracle University Internal and TransAmerica Training Management Inc Partner use only
RWCLIENT command, OracleAS Portal, SRW.RUN_REPORT, and the
Event-Driven Publishing API
4. What is the JSP runtime architecture used for?
The JSP runtime architecture runs the Web layout.
5. Which two facilities can be used to monitor OracleAS Reports Services?
Oracle Enterprise Manager and Reports Queue Manager
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Overview: Lesson 22
This practice session contains:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Generating and interpreting report trace information
Modifying a report to make it more efficient
Introduction
Report performance is always an issue. Reports Builder offers a few tools that allow you
to measure performance. In this practice you will use them and interpret the results.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Practice Session Solutions: Lesson 22
1. Name four main areas to investigate when tuning reports.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The Data Model, the Paper Layout, Web Layout and JSP report definitions,
and run-time arguments.
2. What is the name of the font mapping file?
uifont.ali
3. Generate and interpret Reports Runtime Trace information.
a. Open report p19q4.rdf. From the menu select Program > Tracing.
b. In the Runtime Trace Settings dialog box specify p19q4.txt as the trace file
and select the All check box under Trace Settings.
c. Select OK to close the dialog box.
d. Run the paper layout. Paginate through the report in the Paper Design view.
e. Open p19q4.txt and look at the results. Where does this report spend
time?
The time is spent on the layout and formatting of the report.
f. Repeat the same steps for report p22q2b.rdf. Specify p22q2.txt as the
trace file. Compare the result. How do you explain this?
The statistics for p22q2.rdf also show that time is spend formatting
the report. The figures are a bit higher because of the dynamic
customized formatting of the F_ORDER_MODE and
F_ORDER_TOTAL fields.
There is also a group filter on G_ORDER_ID. The predefined Last
filter is inefficient as it causes all records to be retrieved from the
database.
4. Make a suggestion to improve performance.
a. Open the report p12q1.rdf and generate Reports Trace information. Look
at the time statistics.
b. Examine the Data Model. What could you possibly do to make the report run
faster?
Set the Break Order property for all columns except the NAME column
to None, thus avoiding forcing (unnecessary) extra sorting.
c. Implement your change and regenerate the time statistics. Did things
improve?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Table Descriptions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Overall Description
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The sample company portrayed by the Oracle Database 10g Sample Schemas operates
worldwide to fill orders for several different products. The company has several divisions:
The Human Resources division tracks information on the companys employees and
facilities.
The Order Entry division tracks product inventories and sales of the companys products
through various channels.
The Product Media division maintains descriptions and detailed information on each
product sold by the company.
The Shipping division manages the shipping of products to customer.
Each of these divisions is represented by a schema. In this course, the user has access to the
objects in all of these schemas.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Overall Description (continued)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
HR Human Resources
OE Order Entry
QS PM
Queued Product
Shipping Media
The Oracle Database Sample Schemas are a set of interlinked schemas. This set of schemas is
aimed at providing a layered approach to complexity:
A simple schema (Human Resources, HR) for introducing basic topics.
A second schema (Order Entry, OE) for dealing with matters of intermediate complexity. A
multitude of data types is available in this schema.
The Online Catalog (OC) subschema is a collection of object-relational database objects
built inside the OE schema.
A schema dedicated to multimedia data types (Product Media, PM)
A set of schemas gathered under the main schema name QS (Queued Shipping) to
demonstrate Oracle Advanced Queuing capabilities.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Human Resources (HR)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
In the companys human resource records, each employee has a unique identification number,
e-mail address, job identification number, salary, and manager. Some employees earn a
commission in addition to their salary, which is also tracked. When an employee switches jobs,
the company records the start date and end date of the former job, the job identification number,
and department.
The company also tracks information about jobs within the organization. Each job has an
identification number, 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 jobs within the
company. When an employee switches jobs, the company records the start date and end date of
the former job, the job identification number, and the department.
The sample company is regionally diverse, so it tracks the locations of not only its warehouses
but also of its departments. Each of the companys employees is assigned to a department. Each
department is identified by a unique department code and a short name. Each department is
associated with one location. Each location has a full address that includes the street address,
postal code, city, state or province, and country code.
For each country where it has facilities, the company records the country name, currency
symbol, currency name and the region in which the county resides geographically.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Human Resources (HR) (continued)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Human Resources (HR) Row Counts
Oracle University Internal and TransAmerica Training Management Inc Partner use only
SQL> select count(*) from countries;
COUNT(*)
----------
25
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Order Entry (OE)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The company sells several categories of products, including computer hardware and software,
music, clothing, and tools. The company maintains product information that includes product
identification numbers, the category into which the product falls, the weight group (for shipping
purposes), the warranty period if applicable, the supplier, the status of the product, a list price, a
minimum price at which a product will be 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 different
languages.
The company maintains warehouses in several locations to facilitate filling customer orders.
Each warehouse has a warehouse identification number, name, and location identification
number.
Customer information is tracked in some detail. Each customer is assigned an identification
number. Customer records include name, street address, city or province, country, phone
numbers (up to five phone numbers for each customer), and postal code. Some customers order
through the Internet, so e-mail addresses are also recorded. Because of language differences
among customers, the company records the NLS language and territory of each customer. The
company places a credit limit on its customers to limit the amount they can purchase at one
time. Some customers have account managers, whom we monitor. We keep track of a
customer's phone numbers. In this day, we never know how many phone numbers a customer
might have, but we try to keep track of all of them. Because of the language differences of our
customers, we identify the language and territory of each customer.
When a customer places an order, the company tracks the date of the order, the mode of the
order, status, shipping mode, total amount of the order, and the sales representative who helped
place the order. This may be the same individual as the account manager for a customer, it may
be different, or, in the case of an order over the Internet, the sales representative is not recorded.
In addition to the order information, we also track the number of items ordered, the unit price,
and the products ordered.
For each country in which it does business, the company records the country name, currency
symbol, currency name, and the region in which the county resides geographically. This data is
useful for tracking customers living in different geographic regions around the world.
Product Media (PM)
The company stores multimedia and print information about its products in the database.
Examples of such information are:
Promotional audio and video clips
Product images and thumbnails for web publishing
Press release texts
Print media ads
Other promotion texts and translations
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Order Entry (OE) and Product Media (PM)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Order Entry (OE) and Product Media (PMP Row Counts
SQL> select count(*) from customers;
Oracle University Internal and TransAmerica Training Management Inc Partner use only
COUNT(*)
----------
319
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Queued Shipping (QS)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
The sample company has decided to test the use of messaging to manage its proposed B2B
applications. The plan calls for a small test that will allow a user from outside the firewall to
place an order and track its status. The order must be booked into the main system. Then,
depending on the location of the customer, the order is routed to the nearest region for shipping.
Eventually, the company intends to expand beyond its current in-house distribution system to a
system that will allow other businesses to provide the shipping. Therefore, the messages sent
between the businesses must also travel over HTTP and be in a self-contained format. XML is
the perfect format for the message, and both the Advanced Queuing Servlet and Oracle Internet
Directory provide the appropriate routing between the queues.
After the orders are either shipped or back ordered, a message needs to be sent back to
appropriate employees to inform them of the order's status and to initiate the billing cycle. It is
critical that the message be delivered only once and that there be a system for tracking and
reviewing messages to facilitate resolution of any discrepancies with the order.
For the purpose of this test application, the company utilizes a single database server and a
single application server. The application provides a mechanism for examining the XML
messages as well as looking at the queues. To demonstrate connectivity from outside the
firewall, both the generation of a new order and customer service reporting are performed using
queues. The new order application directly enqueues a queue, while the customer service
queries require XML messaging to dequeue a queue.
The users associated with this application are:
QS (Queue Shipping)
QS_ES (Eastern Shipping)
QS_WS (Western Shipping)
QS_OS (Overseas Shipping)
QS_CB (Customer Billing)
QS_CS (Customer Service)
QS_ADM (Administration), and
QS_CBADM (Customer Billing Administration)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Table Descriptions
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Creating Web
Layout Templates
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating Web Layout Templates
This appendix explains how to create a Web layout template for Oracle Reports Builder.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
You can use templates to define common characteristics and objects that you want to apply to
multiple reports. For example, you can define a template that includes the company logo and
sets fonts and colors for selected areas of a report.
To create an Oracle Reports Web Layout template:
1. Create a template file (.tdf file).
2. Create an HTML file that describes the layout.
3. Update the Web Template description file (rwTemplates.xml).
4. Test the new template.
5. Deploy the template in Oracle Reports and Oracle Application Server.
6. Add the template to the template library.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
To create a Web layout template in Oracle Reports, you need three files:
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. A paper layout template (.tdf file) that is used to register the template in reports and
to make the relationship between the HTML and the CSS file in the
rwTemplates.xml file. It can also be used as a paper template.
2. A Web layout template (.html file) that is used to create the layout of the template
(default header and footer, position of the data area)
3. A Cascading Style Sheet (CSS) file that is used to define the HTML font of the different
parts of a report.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 1: Create a template file (.tdf)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
First, create a Reports template file:
1. In Oracle Reports Builder, choose File > New > Template.
2. In the Object Navigator, under Templates, your new template name is displayed.
3. Specify a name for your template in the Property Inspector, for example MyCompany.
Note: This name is used by Oracle Reports to create the relationship between the HTML
and CSS files.
4. Save the file as MYCOMPANY.tdf in the $ORACLE_HOME/reports/templates/
directory.
You have now created a template. You can edit this template for paper reports by using the
Report Wizard.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 2: Create an HTML file that describes the layout
In an HTML editor, such as Macromedia Dreamweaver, create an HTML page that will define
Oracle University Internal and TransAmerica Training Management Inc Partner use only
the areas of your Web layout template.
1. Add the JSP header and taglib, then add the rw:report tag to reference the report
environment:
2. Put all your generic HTML below the following HTML tags:
3. The <rw:style> tag is used to create the link between the template and the CSS that we
created and references into the rwTemplates.xml file:
4. Put all your generic HTML, such as the company logo in the <BODY> tag:
5. Specify the <rw:dataArea> tag, where the Wizard will insert the report block:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 2: Create an HTML file that describes the layout (continued)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
6. Specify all your generic HTML, such as copyright and contact information before the
</BODY> tag
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 3: Update the Web layout template description file
The Web layout template description file rwTemplates.xml is located under
Oracle University Internal and TransAmerica Training Management Inc Partner use only
$ORACLE_HOME/reports/templates. This file references Oracle Reports templates with
their associated styles.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 3: Update the Web layout template description file (continued)
1. In the rwTemplates.xml file, add a new <webTemplate> tag entry file to register your
Oracle University Internal and TransAmerica Training Management Inc Partner use only
new template.
You add the <webTemplate> tag between the <webTemplates> </webTemplates> tags.
This tag associates the paper layout template, Web layout template and CSS files. The
code displays a sample <webTemplate> tag for the MyCompany template.
Attribute Value
id references the name of the module in the Reports template file, for
example, mycompany.tdf. This is not the name of the file, but
the name that you see in the Object Navigator.
cssFile references the name of the CSS file that Report Wizard will place in
the <LINK> tag.
classSet references the classSet id into the current XML file. The classSet
makes the relationship between each field type and the CSS Class.
htmlFile references the file name of the HTML template, for example
myCompany.html.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 3: Update the Web Layout Template Description File (continued)
Oracle University Internal and TransAmerica Training Management Inc Partner use only
2. If you have a specific CSS file with new class names, you need to add a new classSet
entry in the rwTemplates.xml file. The classSet tag contains all the class name (css)
for each field type. You add the <classSet> tag between the <classSets> </classSets> tags.
Name Value
TableStyle specifies the class name of the <table> tag
ColumnHeader specifies the class name of the <th> tag used for the column header
RowHeader specifies the class name of the <th> tag used at the row header in
matrix reports
CellText specifies the class name of the <td> tag used for alphanumeric data
CellNumber specifies the class name of the <td> tag used for numeric data.
CellDate specifies the class name of the <td> tag used for date data
TotalText specifies the class name of the <th> tag used for the summary empty
cells
TotalNumber specifies the class name of the <td> tag used for the summary non
empty cells
GroupAboveHeader specifies the class name of the <th> and <caption> tags used for the
group above section
3. After adding the <webTemplate> and <classSet> entries, save the rwTemplates.xml
file and restart Reports Builder.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 4: Test the new Web layout template
Oracle University Internal and TransAmerica Training Management Inc Partner use only
1. Create a new report using the Report Wizard, and choose the TDF file you created, for
example, MyCompany.tdf template.
2. When you click Finish, you see the new report with your template code. The Report
Wizard replaces the empty <rw:style> and <rw:dataArea > tags with the generated code.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 5: Deploying the new Web layout template
You should configure Reports Builder to make sure that all associated elements such as images
Oracle University Internal and TransAmerica Training Management Inc Partner use only
and CSS files are in the correct place on the file system
Location Description
$ORACLE_HOME/reports/docroot/ Default root directory of Oracle
Reports Builder
$ORACLE_HOME/reports/docroot/images Default image directory of Oracle
Reports Builder
$ORACLE_HOME/reports/docroot/css Default CSS directory of Oracle
Reports Builder
While deploying a Web report on the Oracle Application Server, you need to make sure that all
the associated elements such as images and CSS files are in the correct location on the server.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Creating a Web Layout Template
Step 6: Add the Web Layout Template to the Oracle Reports Template Library
If you want your new template to always display in the Predefined Templates list on the
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Template page of the Report Wizard, you can add it Oracle Reports Template Library.
You can register your template file as a predefined template by inserting an entry in the
Oracle Reports preferences file and storing the template and (optional) image in the correct
template directory.
Note: This is an optional step.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
Glossary
Oracle University Internal and TransAmerica Training Management Inc Partner use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.
A
Oracle University Internal and TransAmerica Training Management Inc Partner use only
API (Application Program Interface) Data Model view Displays a structural
A language and message format used by representation of the data in a report.
an application program to communicate The objects do not appear in the report
with the operating system or some other output, but the structure determines the
control program such as a database layout style, and the data objects provide
management system or communications the values that appear in the layout
protocol. objects.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
links to other documents on Web servers
you enter, edit, or delete data. (2) A
on the Internet. End users with Web
layout object that defines how the data
browsers view HTML documents and
for a specific query column appears.
follow links to display other documents.
foreign key A value or column in one
table that refers to a primary key in HTTP (HyperText Transfer Protocol)
another table. Acronym for HyperText Transfer
Protocol. The protocol used to carry
format mask A setting that defines the Web traffic between a Web browser
computer and the Web server being
appearance of the value of a field. For
accessed.
example, a format mask is used to
specify the display of currency amounts
and dates. Hyperlink A reference/link from one
document to another document or
format trigger A PL/SQL function that another place in the same document. A
allows you to dynamically change the Web browser usually displays a
formatting attributes of an object. hyperlink in some distinguishing way,
such as different color, font, or style.
formula column A user-created column When users activate hyperlinks by
that gets its data from a PL/SQL clicking on them with a mouse, the
function or expression, a SQL statement, browser displays the target of the link.
or a combination of these.
I
frame A layout object used to enclose icon A graphic representation of a
other layout objects and control the window or tool.
formatting, frequency, and positioning of
several objects simultaneously. image A bitmapped object that can be
stored and loaded into an application.
G The client cannot modify an imported
image.
group (1) In Reports Builder, a data
model object that is created intranet An internal TCP/IP network,
automatically to contain all the columns access to which is restricted (via a
selected by a query, or created by the firewall) to individuals inside the
user to modify the hierarchy of the data company or organization. An intranet
appearing in a report; it is used primarily provides similar services within an
for creating breaks in a report, as well as organization to those provided by the
for resetting computations. (2) An object Internet, but is not necessarily connected
that is composed of several other to the Internet. A common example of an
objects. intranet is when a company sets up one
or more Web servers on an internal
H
network for distribution of information
HTML (Hypertext Markup or applications within the company.
Language) Acronym for Hypertext
Oracle University Internal and TransAmerica Training Management Inc Partner use only
supports programming for the Internet in appears at the top and bottom of each
the form of platform-independent logical page in a report section: Header,
"applets." Main, and Trailer. The margin may
include any layout object, but typically
JAR Acronym for Java ARchive. A file contains boilerplate and fields for page
used for aggregating many files, such as numbers, page totals, grand totals, and
Java class files, images, and other files current date and time.
into one file.
O
J2EE (Java 2 Platform, Enterprise
Edition) An environment for object (1) An item that can be placed on
developing and deploying enterprise the layout. The following are examples
applications in Java consisting of a set of of objects: rectangle, line, ellipse, arc,
services, application programming polygon, polyline, rounded rectangle,
interfaces, and protocols that provide for freehand, graph, text, symbol, and text
developing multitiered, Web-based field. (2) In an Oracle database, an
applications. instance of an object type. An object can
be a row in an object table, or the portion
JDBC (Java Database Connectivity)An of a row contained in a column object in
industry standard for database and a relational table.
Java platform connectivity providing a
call-level API for SQL-based database Object Navigator A hierarchical
access. browsing and editing interface that
enables you to locate and manipulate
JSP (JavaServer Page) An extension application objects quickly and easily.
to the servlet functionality that enables a Features include:
simple programmatic interface to Web A hierarchy represented by
pages. JSPs are HTML pages with indentation and expandable nodes.
special tags and embedded Java code The top-level nodes show module
that is executed on the Web or types, database objects, and built-in
application server providing dynamic packages, enabling tasks such as
functionality to HTML pages. JSPs are creating, editing, renaming, and
actually compiled into servlets when deleting objects.
first requested and run in the server's A find field and icons, enabling
JVM. forward and backward searches for
any level of node or for an individual
L item in a node
layout The area of an editor in which
you can create, modify, position, or
delete objects.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
used to print report output.
functions
OracleAS Reports Services The runtime
Oracle Application Server A strategic environment for Reports Developer
platform for network application applications. OracleAS Reports
deployment. By moving application Services executes, distributes, and
logic to application servers and publishes your reports for enterprise
deploying network clients, organizations wide reporting. Using OracleAS Reports
can realize substantial savings through Services to deploy your reports results in
reduced complexity, better gains of flexibility, time savings, and
manageability, and simplified processing capacity.
development and deployment. Oracle
Application Server provides the only P
business-critical platform that offers
Paper Design view Displays output for
easy database Web publishing and
paper reports and allows you to make
complete legacy integration while
many commonly required, simple
transitioning from traditional client-
modifications to the layout, such as
server to network application
spacing, formatting fields,color, and
architectures.
editing text, without having to open the
Paper Layout view.
Oracle Developer Suite Combines
leading Oracle application development Paper Layout view Displays the layout
and business intelligence tools into a objects in a paper report and allows you
single, integrated product. Built on to make many modifications to any
Internet standards such as Java and layout object. All layout objects have
XML, the suite provides a complete and properties that you can modify using the
highly productive development Property Inspector. The hierarchy of the
environment for building applications layout objects is determined by the data
for Oracle Application Server and the model.
Oracle database.
Paper Parameter Form view Displays
<Oracle_Home> An alternate name for the layout of the Parameter Form that, at
the top directory in the Oracle directory runtime, allows user input of parameter
hierarchy on some directory-based values in the Runtime Parameter Form.
operating systems. An environment
variable that indicates the root directory
PDF (Portable Document Format) A
of Oracle products.
file format (native for Adobe Acrobat)
for representing documents in a manner
Oracle AS Portal An HTML-based
that is independent of the original
development tool for building scalable,
application software, hardware, and
secure, extensible HTML applications
operating system used to create the
and Web sites. OracleAS Reports
documents. A PDF file can describe
Services uses OracleAS Portal to control
documents containing any combination
end user access to reports published on
the Web by storing information about
Oracle University Internal and TransAmerica Training Management Inc Partner use only
format. jobs
PL/SQL Oracle's proprietary extension REP file A file that contains a single
to the SQL language. Adds procedural report definition in binary format. .REP
and other constructs to SQL that make it files are used solely to run reports; you
suitable for writing applications. cannot edit a .REP file.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
an alternative to CGI (Common
Reports Runtime (rwrun) An Oracle Gateway Interface) scripts. Because they
Reports executable that runs a report are written in Java, servlets are portable
using the OracleAS Reports Services in- between servers and operating systems.
process server. The Reports Servlet and JSP are
components of OracleAS Reports
Reports Server (rwserver) An Oracle Services that process custom (JSP)
Reports executable that enables running report tags and deliver information
reports on a remote server. A component between the Oracle HTTP Server and the
of OracleAS Reports Services that Reports Server.
processes client requests, including user
authentication, scheduling, caching, and SQL A standard interface for storing
report distribution. Use rwclient to and retrieving information in a relational
send a report to the Reports Server. database. SQL is an acronym for
Structured Query Language.
Reports Servlet (rwservlet) An Oracle SQL file A file that contains a query
Reports executable that translates and stored in text (e.g., ASCII or EBCDIC)
delivers information between either a format.
Web Server or a J2EE Container for
example, OC4J, and the Reports Server, SQL script A file containing SQL
enabling you to run a report dynamically statements that you can run to perform
from your Web browser. database administration quickly and
easily. Several SQL scripts are shipped
row One set of field values in a table; for with Oracle products.
example, the fields representing one
employee in the example table EMP. SQL statement A SQL instruction to
Oracle. A SELECT statement is one type
Runtime Parameter Form A screen or of SQL statement.
window appearing optionally at runtime
in which a user can modify print options style sheet HTML extensions that
and parameters prior to report execution. provide powerful formatting flexibility
in HTML documents. To view an
RTF (Rich Text Format) A Microsoft HTML document that takes advantage of
standard for encoding formatted text and style sheets, display it in a browser that
graphics. supports style sheets.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
columns.
in which you perform a specific set of
tabular A default layout displaying tasks, such as defining a report data
labels at the top of the page and rows of model, layout, or Parameter Form. (2) A
data underneath the labels. virtual table whose rows do not actually
exist in the database, but which is based
template A skeleton definition on a table that is physically stored in the
containing common style and standards, database.
and can include graphics. A template
provides a standard format to enable W
quick and easy development of Web browser A program that end users
professional standard look-and-feel utilize to read HTML documents and
reports. programs stored on a computer (serviced
by a Web server).
Template Editor A work area in which
you can define objects and formatting Web server A server process (HTTP
properties for your templates. It is daemon) running at a Web site that
similar to the Paper Layout view of the sends out Web pages in response to
Report Editor. You can create, delete, HTTP requests from remote Web
and modify objects (e.g., page numbers, browsers.
text, and graphics) in the margin area.
You cannot create and delete objects in Web source view Displays the HTML /
the body area, but you can modify the JSP source for a report. You can use this
properties of body objects in the view to add dynamic content to a Web
Property Inspector. page using the Report Block Wizard and
the Graph Wizard. Experienced Java
tool An iconic button used to create and developers can edit the Web source
manipulate objects in an application. directly in this view.
tool palette A collection of tools. window A rectangular area of the
desktop that contains an application.
toolbar A collection of iconic buttons Each window has an area where you can
that perform product commands. Usually interact with the application. Windows
aligned horizontally along the top, or can be opened, resized, moved, reduced
vertically down the side of a window. to an icon, or enlarged to fill the entire
desktop.
U
wizards Provide an easy step-by-step
URL (Uniform Resource Locator) A interface for commonly performed tasks.
URL, a form of URI, is a compact string The wizards in Reports Builder are:
representation of the location for a
Report Wizard: Guides you through
resource that is available through the
the steps to create a basic paper or
Internet. It is also the text string format
Web report. Each page of the wizard
clients use to encode requests to
Oracle Application Server.
Oracle University Internal and TransAmerica Training Management Inc Partner use only
Data Wizard: Helps you quickly metalanguage using SGML to define and
define or modify a query for a structure data. Reports Builder supports
multiquery data models. XML output to enable Web publishing
Graph Wizard: Adds a variety of as well as electronic data exchange with
charts and graphs, including true 3- third-party applications. You can also
dimensional graphs. Implemented in use XML to build report definitions that
Reports Builder with the Oracle BI can be merged with other report
graph bean. definitions at run time or can be run
Report Block Wizard: Enables you to separately.
add data to a static HTML page.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED.