Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
If this documentation is delivered to a U.S. Government Agency of the Department of
Technical Contributors
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
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
Preface
I Introduction
Course Objectives I-2
Course Content I-3
1 Introduction to Oracle Reports Developer
Objectives 1-2
Business Intelligence 1-3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
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
vii
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
viii
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 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
ix
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Glossary
xi
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Preface
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle University and EGABI SOLUTIONS 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:
• 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
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
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
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
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 Developer Suite 10g (9.0.4) Release Notes for Windows and B10668-01
UNIX [Chapter 9: Oracle Reports]
Additional Publications
• System release bulletins
• Installation and user’s guides
• read.me files
• International Oracle User’s 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
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)
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
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.
Preface - 9
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Introduction
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
OracleCOMPUTER
Reports Developer
IS STRICTLY10g: Build Reports I-2
PROHIBITED
Course Content
Day 1:
• Introducing Oracle Reports Developer
• Designing and running reports
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
OracleCOMPUTER
Reports Developer
IS STRICTLY10g: Build Reports I-3
PROHIBITED
Course Content
Day 3:
• Using the paper layout
• Modifying properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer
IS STRICTLY10g: Build Reports I-4
PROHIBITED
Course Content
Day 5:
• Extending functionality using the SRW package
• Using OracleAS Reports Services
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer
IS STRICTLY10g: Build Reports I-5
PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
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 Oracle’s end-to-end business intelligence solution.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-2
PROHIBITED
Business Intelligence
Discoverer Server Reports Server
XML
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-3
PROHIBITED
What Is Business Intelligence? (continued)
Oracle’s set of integrated BI tools allow you to seamlessly move between the roles of
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-4
PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-5
PROHIBITED
Enterprise Reporting (continued)
Enterprise reporting offers a number of important benefits. These include:
• 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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-6
PROHIBITED
Enterprise Reporting
Reporting
Advanced
Web Client analysis
Data Server
Application Server
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-7
PROHIBITED
Enterprise Reporting (continued)
• Reduced time to market:
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-8
PROHIBITED
Web Publishing
hyperlinks
JavaScript
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-9
PROHIBITED
Paper Publishing
8.5”
GIF89a
JavaScript
OLAP
XML
TEXT
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-11
PROHIBITED
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-12
PROHIBITED
Oracle 10g Products
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-13
PROHIBITED
Oracle Database 10g
Multimedia
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-14
PROHIBITED
Oracle Developer Suite 10g
Application Development
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-15
PROHIBITED
Oracle Developer Suite 10g (continued)
For application development, Oracle Developer Suite 10g provides capabilities in:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-16
PROHIBITED
Oracle Developer Suite 10g
Business Intelligence
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-17
PROHIBITED
Oracle Application Server 10g
Oracle DB
Browser Non-Oracle
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-18
PROHIBITED
Oracle Application Server 10g (continued)
• Business Logic Services: Oracle Application Server provides several ways to develop
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-19
PROHIBITED
Oracle Reports Developer
• User-friendly wizards
• Pluggable data sources
• Customizable report templates
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-20
PROHIBITED
What Is Oracle Reports Developer? (continued)
• Web publishing tools that dynamically generate Web pages based on your data
• 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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-21
PROHIBITED
OracleAS Reports Services
• Flexible reporting
• Reduced overhead
• Fast distribution
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-22
PROHIBITED
OracleAS Reports Services Architecture
for the Web
HTTP
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-23
PROHIBITED
OracleAS Reports Services Architecture (continued)
The major components of OracleAS Reports Services include:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-24
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 1-25
PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Designing and Running Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-2
PROHIBITED
Understanding User Requirements
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-3
PROHIBITED
Understanding User Requirements (continued)
Helpful questions to help you determine the user requirements:
• 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-4
PROHIBITED
Designing Reports
Specification
Data retrieval
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-5
PROHIBITED
Designing Reports (continued)
The majority of report requirements fall into the following categories:
• Tabular
• Master-detail
• Master and multiple details
• Matrix
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-6
PROHIBITED
Tabular
List of Products
Product
Number Description Price
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-7
PROHIBITED
Master-Detail
Outstanding Customer Items
Customer Name
Product
Number Price
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-8
PROHIBITED
Master with Two Details
Customer Statistics
Customer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-9
PROHIBITED
Matrix
Customer Matrix
Product ID
Customer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-10
PROHIBITED
Retrieving and Sharing Data
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-11
PROHIBITED
Retrieving and Sharing Data (continued)
Report Structures
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-12
PROHIBITED
Running a Report
• Your browser
• OracleAS Portal application
• Command line (Start > Run)
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-13
PROHIBITED
Running a Report (continued)
• A Java application
• 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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-14
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-15
PROHIBITED
Print Preview
1
2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-16
PROHIBITED
Print Preview
1 2 3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-17
PROHIBITED
Previewing Reports (continued)
Zoom in and zoom out buttons are available on the toolbar. Select the large plus sign to
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-18
PROHIBITED
Supported File Types
• RDF
• REP
• JSP
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-19
PROHIBITED
Supported File Types (continued)
Reports defintions RDF and REP are “owned” by Oracle Reports. In other words, you will
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-20
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-21
PROHIBITED
Practice 2 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-22
PROHIBITED
Practice Session: Lesson 2
1. Invoke the Reports Builder executable.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-23
PROHIBITED
Practice Session: Lesson 2 (continued)
g. Run the paper layout again. This time enter Customer ID 999.
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 2-24
PROHIBITED
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
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-2
PROHIBITED
Reports Developer Executables
Developer
Reports Builder Reports Runtime Reports Converter
rwbuilder rwrun rwconverter
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-3
PROHIBITED
Reports Developer Executables (continued)
The main Reports Developer executables are:
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-4
PROHIBITED
Invoking Reports Builder
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-5
PROHIBITED
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 units—procedures,
Library functions, packages—that can be called from multiple reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-6
PROHIBITED
Report Data and Layout
Paper
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-7
PROHIBITED
Reports Builder Components
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-8
PROHIBITED
Reports Builder Components (continued)
Property Inspector
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-9
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-10
PROHIBITED
Navigating Around the Oracle Reports Main Menu (continued)
The main menu options in Reports Builder are:
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
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-11
PROHIBITED
Wizards
• Report Wizard
• Data Wizard
• Graph Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-12
PROHIBITED
Report Editor
• Data Model
• Web Source
• Paper Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-13
PROHIBITED
The Report Editor (continued)
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
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-14
PROHIBITED
PL/SQL Development Environment:
Syntax Palette
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-15
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-16
PROHIBITED
Report-Level Objects
• Properties
• Triggers
• PL/SQL Program Units
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-17
PROHIBITED
Data Model Objects
• Parameters
• Queries
• Groups
• Frames
• Repeating frames
• Fields
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-19
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-20
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-21
PROHIBITED
Customizing Your Oracle Reports
Developer Session
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-22
PROHIBITED
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.
• REPORTS_PATH
• REPORTS_TMP
• REPORTS_RESOURCE
•
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-24
PROHIBITED
Oracle Reports Environment Variables (continued)
Generic Oracle Path
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-25
PROHIBITED
Using the Online Help System
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-27
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-28
PROHIBITED
Practice 3 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-29
PROHIBITED
Practice Session: Lesson 3
1. Start Reports Builder and open the existing report: p3q1.jsp. Run the paper layout.
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.
b. What is RWCLIENT?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 3-30
PROHIBITED
Creating a Paper Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-2
PROHIBITED
Report Module Components
• Data Model
• Web Source
• Paper Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-3
PROHIBITED
Building a Paper Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-4
PROHIBITED
Invoking the Report Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-5
PROHIBITED
Choosing the Layout Type
Wizard Pages
• Report Style
• Data Source
Type
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-6
PROHIBITED
Creating a Tabular Report
Wizard Pages
• Report Style
• Data Source
Type
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-7
PROHIBITED
Creating a Tabular Report Using the Wizard (continued)
Wizard Pages
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-8
PROHIBITED
Selecting the Data Source Type
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-9
PROHIBITED
Using Query Builder
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-10
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-11
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-12
PROHIBITED
Query Builder Functions (continued)
You can select from a table, view, or synonym. The letter T, V, or S appears in the object
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-13
PROHIBITED
Selecting Displayed Fields
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-14
PROHIBITED
Totals and Labels
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-15
PROHIBITED
Selecting a Report Template
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-16
PROHIBITED
Viewing the Paper Report Output
1 Magnify tool
2 Page buttons
xxx.rdf yyy.rdf
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-18
PROHIBITED
Reentering the Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-19
PROHIBITED
Creating Other Report Styles (continued)
When you reenter the Report Wizard, you see a tab for each page. You can navigate
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-20
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-21
PROHIBITED
Creating Break Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-22
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-23
PROHIBITED
Creating Mailing Labels and Letters
Wizard pages:
• Style
• Data
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-24
PROHIBITED
Creating Mailing Labels and Letters (continued)
You can type directly into the text area instead of selecting from the Available Fields list.
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-25
PROHIBITED
Creating a Matrix Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-27
PROHIBITED
Previewing a Paper Report in a Browser
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-28
PROHIBITED
Previewing a Paper Report in a Browser
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-29
PROHIBITED
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-30
PROHIBITED
Practice 4 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-31
PROHIBITED
Practice Session: Lesson 4
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
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-32
PROHIBITED
Practice Session: Lesson 4 (continued)
5. Using the reentrant Wizard, modify the report to create a Form Letter style.
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>.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-33
PROHIBITED
Practice Session: Lesson 4 (continued)
8. Web-enable a paper report.
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 4-34
PROHIBITED
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
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-2
PROHIBITED
What Is the Paper Design?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-3
PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-4
PROHIBITED
Modifying a Report
Common modifications:
• Align columns
• Set format masks
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-5
PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-6
PROHIBITED
Setting a Format Mask
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-7
PROHIBITED
Setting a Format Mask (continued)
To alter a numeric format:
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-8
PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-9
PROHIBITED
Modifying Visual Attributes
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-10
PROHIBITED
Modifying Visual Attributes (continued)
To modify color fills and lines:
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-11
PROHIBITED
Applying Conditional Formatting
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-12
PROHIBITED
Applying Conditional Formatting (continued)
Formatting is applied in the order that the format exceptions are listed; a format exception
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-13
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-14
PROHIBITED
Inserting Page Numbers, Dates, and Times (continued)
The Insert Date and Time dialog box displays the current date in many different formats.
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-15
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-16
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-17
PROHIBITED
Practice 5 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-18
PROHIBITED
Practice Session: Lesson 5
1. Open report p4q2.rdf. Make the following changes in the Paper Design view:
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-19
PROHIBITED
Practice Session: Lesson 5 (continued)
If You Have Time
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 5-20
PROHIBITED
Managing Report Templates
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-2
PROHIBITED
Using Report Templates
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-3
PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-4
PROHIBITED
Modifying a Template (continued)
Modify template objects in the Template Editor or in the Object Navigator.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-5
PROHIBITED
Customizing the Template Margin
Include
objects
such as:
• Images
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-6
PROHIBITED
Customizing the Template Body
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-7
PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-8
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
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-9
PROHIBITED
Predefining Your Own Templates
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-10
PROHIBITED
Predefining Your Own Templates (continued)
To register a customized template in the predefined list in the Wizard:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-11
PROHIBITED
Adding a Template Preview Image
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-12
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-13
PROHIBITED
Practice 6 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-14
PROHIBITED
Practice Session: Lesson 6
1. Customize an existing template, adding a company logo and report title to the 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.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-15
PROHIBITED
Practice Session: Lesson 6 (continued)
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.
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 6-16
PROHIBITED
Creating a Web Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-2
PROHIBITED
What Is JSP Technology?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-3
PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-4
PROHIBITED
JSP Advantages (continued)
Since the JavaServer Pages cleanly separate dynamic application logic from static HTML
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-5
PROHIBITED
Simple JSP Example
<HTML>
<HEAD><TITLE>Simple JSP Example</TITLE></HEAD>
<BODY>
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-7
PROHIBITED
Using the Report Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-8
PROHIBITED
Report Editor: Web Source View
Reports JSP
Custom Tag
Library
Start of report
End of report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-9
PROHIBITED
Web Source View (continued)
A Reports JSP includes both standard JSP tags and Reports custom JSP tags.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-10
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-11
PROHIBITED
JSP Tags (continued)
Reports Custom JSP Tag Library
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
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-12
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-13
PROHIBITED
Example (continued)
Modifying a Web Report Using the Report Wizard
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-14
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-15
PROHIBITED
Generating Output (continued)
Another way to publish a report on a Web site is to create an OracleAS Portal component.
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-16
PROHIBITED
Image Format Support
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-17
PROHIBITED
Image Format Support (continued)
Oracle Reports supports the following formats:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-18
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-19
PROHIBITED
Practice 7 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-20
PROHIBITED
Practice Session: Lesson 7
1. Create a tabular report, Web and paper layout, entitled Compensation Report. The
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 7-21
PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Enhancing Reports Using the Data Model:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-2
PROHIBITED
The Data Model Objects
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-4
PROHIBITED
Modifying Properties of a Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-5
PROHIBITED
Modifying Properties of a Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-6
PROHIBITED
Modifying Properties of a Query (continued)
Oracle Reports checks the syntax when you try to leave the SQL Query Statement dialog
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-7
PROHIBITED
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-8
PROHIBITED
More Properties (continued)
Restricting Rows
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-9
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-10
PROHIBITED
Applying Changes (continued)
For Web reports, reentering the Report Wizard will delete the layout that was previously
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-11
PROHIBITED
Changing the Group Structure
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-13
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-14
PROHIBITED
Group Hierarchy (continued)
Creating a New Group
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-15
PROHIBITED
Ordering Data in a Group
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-16
PROHIBITED
Ordering Data in a Group (continued)
Break Order in Break Groups
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-17
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-18
PROHIBITED
Query Modifications (continued)
If you create a break group containing DEPARTMENT_ID and DEPARTMENT_NAME, but
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-19
PROHIBITED
Filtering Data in a Group
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-20
PROHIBITED
Using a Packaged Filter
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-21
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-22
PROHIBITED
Practice 8: Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-23
PROHIBITED
Practice Session: Lesson 8
1. Open report p8q1_a.jsp, a tabular report showing customer information.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 8-24
PROHIBITED
Enhancing Reports Using the Data Model:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Objectives
Overview
To keep pace with today’s 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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-2
PROHIBITED
Data Source Types
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-3
PROHIBITED
Data Source Types (continued)
The information you need to publish is often derived from various data sources. These
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,
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-4
PROHIBITED
Pluggable Data Sources
Text
Express JDBC OLAP SQL XML
files
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-5
PROHIBITED
Out-of-the-Box Options
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-6
PROHIBITED
Using XML as a Data Source
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-7
PROHIBITED
Using XML as a Data Source (continued)
To define an XML query:
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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-8
PROHIBITED
Example: XML Data Stream
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-9
PROHIBITED
Example: XML Data Stream (continued)
The Document Type Definition
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)>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-10
PROHIBITED
XML Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-11
PROHIBITED
OLAP Data Source
OLAP database
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-12
PROHIBITED
Defining an OLAP Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-13
PROHIBITED
Example: OLAP Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-14
PROHIBITED
Using Text as a Data Source
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-15
PROHIBITED
Setting Up the textpds.conf File
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-16
PROHIBITED
Setting Up the Text PDS Configuration File (continued)
For example, the textpds.conf entry for the text file Products_CSV.txt is:
<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>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-17
PROHIBITED
Defining a Text Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-18
PROHIBITED
Sample Text PDS Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-19
PROHIBITED
Using JDBC as a Data Source
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-20
PROHIBITED
Configuring the jdbcpds.conf File
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-21
PROHIBITED
Technical Note
Oracle provides a set of Merant DataDirect drivers that can be downloaded from the
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-22
PROHIBITED
Defining a JDBC Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-23
PROHIBITED
Defining a JDBC Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-24
PROHIBITED
Adding New Data
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-25
PROHIBITED
Adding New Data
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-26
PROHIBITED
Adding New Data (continued)
Creating a New Query Manually
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-27
PROHIBITED
Using REF Cursor Queries
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-28
PROHIBITED
Using REF Cursor Queries (continued)
2. In the Data Model view of the Report Editor, select the Ref Cursor Query tool and
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;
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-29
PROHIBITED
Viewing Output from Multiple Query
Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-30
PROHIBITED
Viewing Output from Multiple Query Reports (continued)
Example
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-31
PROHIBITED
Using Data Links
Equijoin
DEPARTMENTS
Department_Id Department_Name
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-32
PROHIBITED
Using Data Links
• Compound join:
– Multicolumn primary or foreign key
– Define multiple equijoins
• Nonequijoin:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-34
PROHIBITED
Creating a Column-to-Column Link (continued)
To modify the link definition, open the Property Inspector using the right mouse button or
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-35
PROHIBITED
Other Data Link Methods
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-37
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-38
PROHIBITED
Efficiency Issues: Multiple- or Single-Query Hierarchy (continued)
Data Ratio
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-39
PROHIBITED
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-40
PROHIBITED
Practice 9 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-41
PROHIBITED
Practice Session: Lesson 9
1. Open p8q1_a.jsp.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-42
PROHIBITED
Practice Session: Lesson 9 (continued)
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.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-43
PROHIBITED
Practice Session: Lesson 9 (continued)
4. An international business has warehouses around the world. The database at
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
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 9-44
PROHIBITED
Enhancing Reports Using the Data Model:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 10-2
PROHIBITED
Data Model Columns
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 10-4
PROHIBITED
Maintaining Data Source Columns
Read-only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 10-5
PROHIBITED
Maintaining Data Source Columns (continued)
For data source columns, some of the property settings are not editable in the Property
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 10-6
PROHIBITED
Producing File Content Output
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 10-7
PROHIBITED
Producing File Content Output (continued)
To create a file column:
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 10-8
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 10-9
PROHIBITED
Creating a Column (continued)
To create a column:
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-10
PROHIBITED
Creating Summary Columns
• Specific properties:
– Function
– Source
– Reset At
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-11
PROHIBITED
Creating Summary Columns (continued)
The datatype of a summary column depends on the data type of the source of the
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-12
PROHIBITED
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_DEPARTMENT—that 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-13
PROHIBITED
Displaying Subtotals (continued)
The Reset At property displays only options that are valid for each summary.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-14
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-15
PROHIBITED
Displaying Percentages (continued)
The Reset At property works the same way that the Sum function does. The default, Reset
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-16
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-17
PROHIBITED
Creating a Formula Column
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-18
PROHIBITED
Creating a Formula Column (continued)
Note: The code displayed is a simple example to illustrate the syntax. The
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-19
PROHIBITED
Creating a Placeholder Column
• An empty container at
design time
CP_xxx • Populated by another
object at run time
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-20
PROHIBITED
Creating a Placeholder Column (continued)
Using placeholder columns, you can:
• 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 placeholder’s own Formula
property.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-21
PROHIBITED
Populating a Placeholder Column
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-22
PROHIBITED
Populating a Placeholder Column (continued)
To create the columns:
1. Create a summary column CS_MAX_SALARY at report level (outside all groups).
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-23
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-24
PROHIBITED
Practice 10 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-25
PROHIBITED
Practice Session: Lesson 10
1. Create a new report using the Report Wizard. Create both a Web and paper layout
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
Column Summary
line_total sum
line_total % Total
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-26
PROHIBITED
Practice Session: Lesson 10 (continued)
2. Open the p9q3.jsp report .
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-27
PROHIBITED
Practice Session: Lesson 10 (continued)
4. Open the p10q1.rdf report to display the highest and lowest orders at the end of
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 10-28
PROHIBITED
Enhancing Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 11-2
PROHIBITED
Viewing the Paper Layout
Header Compensation
section Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 11-3
PROHIBITED
Viewing the Paper Layout (continued)
Header Section: The header section consists of one or more pages that appear once, on a
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 11-4
PROHIBITED
Viewing the Section Areas
Trailer Body/
End of report
section Margin
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 11-5
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 11-6
PROHIBITED
Designing Multipanel Reports (continued)
To define dimensions for a section of the report:
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 11-7
PROHIBITED
Printing Multipanel Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 11-8
PROHIBITED
Different Objects in the Paper Layout
4
5
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 11-9
PROHIBITED
Different Objects in the Paper Layout (continued)
• Field: A field defines the appearance of a column’s data. It may contain character,
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-10
PROHIBITED
The Paper Layout Layers
F_xxx F_xxx
Body
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-12
PROHIBITED
Avoiding Layout Errors
• Confine Mode
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-13
PROHIBITED
Avoiding Layout Errors (continued)
• Flex Mode
- 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-14
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-15
PROHIBITED
Report Processing (continued)
Layout objects often show symbols and icons that indicate their characteristics. The
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-16
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-17
PROHIBITED
Creating Layout Objects (continued)
When you create a layout object, the default name is an alphabetic character that indicates
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-18
PROHIBITED
Paper Layout Tools
• Frame Select
• Report Block
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-20
PROHIBITED
Report Bursting
Dept 10
West East
Dept 20
;
Dept 30
West East
Dept 40
…
…
Dept 80
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-21
PROHIBITED
Bursting on a Repeating Group
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-22
PROHIBITED
Bursting on a Repeating Group
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-23
PROHIBITED
Creating an Additional Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-24
PROHIBITED
Creating an Additional Layout (continued)
Using the Report Block Tool
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-25
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-26
PROHIBITED
Distributing a Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-27
PROHIBITED
Tracing the Report Distribution
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-28
PROHIBITED
Tracing the Report Distribution (continued)
To trace the report distribution:
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-29
PROHIBITED
Creating Variable Length Lines
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-30
PROHIBITED
Creating Variable Length Lines (continued)
• To make the line stretch to fit the group frame, draw the line from the top of the
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-31
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-32
PROHIBITED
Practice 11 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-33
PROHIBITED
Practice Session: Lesson 11
1. Open report p10q1.rdf. Modify the report as follows:
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 today’s 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 today’s date with the text “End of Report” on
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-34
PROHIBITED
Practice Session: Lesson 11 (continued)
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.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 11-35
PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Controlling the Paper Layout:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 12-2
PROHIBITED
Modifying Paper Layout Object Properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 12-3
PROHIBITED
Modifying Paper Layout Object Properties (continued)
• Using the Object Navigator:
- 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 12-4
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 12-5
PROHIBITED
Common Layout Properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 12-6
PROHIBITED
Sizing Objects
Layout icons
Elasticity Vertical Horizontal
fixed
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 12-7
PROHIBITED
Sizing Objects (continued)
How Wizard Report Styles Affect Elasticity
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 12-8
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 12-9
PROHIBITED
Anchors (continued)
The chart below compares implicit and explicit anchors.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-10
PROHIBITED
Layout Object Relationships
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-11
PROHIBITED
Layout Object Relationships
4
1
2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-12
PROHIBITED
Layout Object Relationships (continued)
More About the Push Path
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-13
PROHIBITED
Pagination Icons in the Paper Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-14
PROHIBITED
Pagination Icons in the Paper Layout (continued)
The Paper Layout displays icons representing each of the properties when they are set to
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-15
PROHIBITED
Using Page Break Before
-1-
1
-2-
xxx
-1-
xxx -2-
2 xxx
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-16
PROHIBITED
Using Page Break Before (continued)
Examples
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-17
PROHIBITED
Using Page Break After
-1-
xxx
1 xxx
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-18
PROHIBITED
Using Page Break After (continued)
Examples
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-19
PROHIBITED
Using Page Protect
-1-
40
xxxxxxxx
f_dept_id
xxxxxxxx
Employee
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-21
PROHIBITED
Controlling Print Frequency
-1-
Your Company Your Company
-2-
Your Company
-3-
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-22
PROHIBITED
Controlling Print Frequency (continued)
Which Parent?
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-23
PROHIBITED
Using Format Triggers
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-24
PROHIBITED
Layout Object Properties for Web Support
• Hyperlink
• Hyperlink
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-25
PROHIBITED
Layout Object Properties for Web Support (continued)
Examples
• Dynamic Hyperlink
‘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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-26
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-27
PROHIBITED
Practice 12 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-28
PROHIBITED
Practice Session: Lesson 12
1. Create a new break report showing each customer and the relevant orders.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 12-29
PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Controlling the Paper Layout:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 13-2
PROHIBITED
Properties of a Repeating Frame
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 13-3
PROHIBITED
Specifying Print Direction
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 13-4
PROHIBITED
Specifying Print Direction (continued)
Example
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 13-5
PROHIBITED
Controlling the Number of
Records per Page
1 2
-1- -1-
-2-
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 13-6
PROHIBITED
Controlling Spacing Between Records
Mailing Labels
1
2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 13-7
PROHIBITED
Minimum Widow Records
Page 1 Page 1
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 13-8
PROHIBITED
Column Mode
Page 1 Page 1
10 20 10 20 30
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 frame’s print
direction is Across, and the employee repeating frame’s 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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 13-9
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-10
PROHIBITED
Properties of a Field (continued)
The Source property provides a list of columns, of which there are three categories:
• Columns in the Data Model
• Parameters (always listed in uppercase)
• System variables, such as today’s 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-11
PROHIBITED
System Variables
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-12
PROHIBITED
Page Numbering
Page 4 of 4
Example 1
Page 3 of 4
End
Page 2 of 4
Page 1 of 4
Example 2
Report
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-13
PROHIBITED
Page Numbering (continued)
Example 2
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-14
PROHIBITED
Valid Source Columns
G_Region
R_Region
F_1 R_Dept
G_Emp F_REPORT
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-15
PROHIBITED
Valid Source Columns (continued)
Report-Level Fields
If you create a field outside any repeating frame, that is, at report level, the source column
must be a report-level column—outside 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-16
PROHIBITED
Displaying File Contents
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-17
PROHIBITED
Displaying File Contents (continued)
To create a file link object:
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-18
PROHIBITED
When Are the Contents Updated?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-19
PROHIBITED
Linking and Importing Files
1 2
Import
3 4
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-20
PROHIBITED
Comparing a File Link and a File Column
Q_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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-21
PROHIBITED
Specifying the Format Order
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-22
PROHIBITED
Specifying the Format Order (continued)
You then use report triggers to build a table containing the TOC entries. You learn about
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-23
PROHIBITED
PDF Document Taxonomy Properties
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-24
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-25
PROHIBITED
Practice 13 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-26
PROHIBITED
Practice Session: Lesson 13
1. Open report p4q4.rdf.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 13-27
PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Web Reporting
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 14-2
PROHIBITED
High Quality Web Publishing
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 14-3
PROHIBITED
High Quality Web Publishing (continued)
JSP-Based Runtime Environment
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-
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 14-4
PROHIBITED
Comparing Static and Dynamic Reporting
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 14-5
PROHIBITED
Comparing Static and Dynamic Reporting (continued)
Dynamic Reports
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 14-6
PROHIBITED
Adding Dynamic Content
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 14-7
PROHIBITED
Adding Dynamic Content to a Web Page (continued)
Defining the Data Model
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 14-8
PROHIBITED
Creating a Report Block
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 14-9
PROHIBITED
Creating a Report Block (continued)
Example:
<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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-10
PROHIBITED
Invoking the Report Block Wizard
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-11
PROHIBITED
Examining the Web Source Code
<rw:report id="report">
<rw:objects id="objects">
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-12
PROHIBITED
Examining the Web Source Code
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-13
PROHIBITED
rw:foreach Tag
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-14
PROHIBITED
rw:field Tag
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-15
PROHIBITED
Customizing Reports JSPs
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-16
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-17
PROHIBITED
Customizing Reports JSPs Using Style Sheets (continued)
Example: In the Reports JSP source code shown, the Oracle Reports template rwbeige
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,
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-18
PROHIBITED
Customizing Reports JSPs
Using HTML Tags and Attributes
<thead>
<tr>
<th <rw:id id="HBEMPLOYEEID" asArray="no"/>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-19
PROHIBITED
Customizing Reports JSPs
Using Reports Custom Tags
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-20
PROHIBITED
Customizing Reports JSPs Using Reports Custom Tags (continued)
• formatMask: Contains the Reports format mask to be applied to the field’s value.
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 field’s 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-21
PROHIBITED
Customizing Reports JSPs
Using Reports Custom Tags
<tbody> <rw:foreach id="R_G_EMPLOYEE_ID_1"
src="G_EMPLOYEE_ID">
<tr>
…
<td
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-22
PROHIBITED
Customizing Reports JSPs
Using Reports Custom Tags
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-23
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-24
PROHIBITED
Practice 14 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-25
PROHIBITED
Practice Session: Lesson 14
1. Create a new Web report by adding dynamic content to an existing Web page.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 14-26
PROHIBITED
Extending Functionality Using XML
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 15- 2
PROHIBITED
Why Use XML Report Definitions?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 15- 3
PROHIBITED
Why Use XML Report Definitions? (continued)
Run-Time Customizations
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 15- 4
PROHIBITED
Creating XML Report Definitions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 15- 5
PROHIBITED
Creating and Using XML Report Definitions (continued)
Example
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"/>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 15- 6
PROHIBITED
Partial Report Definitions:
Format Modification Example
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 15- 7
PROHIBITED
Partial Report Definitions (continued)
Formatting modification example
<report name="sales" DTDVersion="1.0">
<data>
</data>
<layout>
<section name="main">
<field name="f_orderdate"
source="orderdate"
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 15- 8
PROHIBITED
Partial Report Definitions:
Format Exception Example
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 15- 9
PROHIBITED
Partial Report Definitions (continued)
Formatting exception example:
<report name="emp" DTDVersion="1.0">
<data>
</data>
<layout>
<section name="main">
<field name="f_sal" source="sal">
<exception textColor="red">
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 10
PROHIBITED
Full Report Definition:
Data Model Modification Example
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 11
PROHIBITED
Full Report Definition
Data model modification example:
<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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 12
PROHIBITED
Full Report Definition:
Data Model Modification Example
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 13
PROHIBITED
Full Report Definition (continued)
• The query uses column aliases. If you do not use an alias, the name of the column is
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 14
PROHIBITED
Running XML Report Definitions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 15
PROHIBITED
Running XML Report Definitions (continued)
Applying One XML Report Definition
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 16
PROHIBITED
Running XML Report Definitions
rwconverter source="(...)"
dest=... customize=...
batch=yes
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 18
PROHIBITED
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
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 19
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.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 20
PROHIBITED
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
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 21
PROHIBITED
Practice 15 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 22
PROHIBITED
Practice Session: Lesson 15
1. Run an XML report definition.
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?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTERDeveloper 10g:
IS STRICTLY Build Reports 15- 23
PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 16-2
PROHIBITED
Creating User Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 16-3
PROHIBITED
Creating User Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 16-4
PROHIBITED
Creating User Parameters (continued)
Parameter Properties
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 16-5
PROHIBITED
Referencing Parameters in a
Report Query
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 16-6
PROHIBITED
Referencing Parameters in a Report Query (continued)
What Is a Lexical Reference?
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 16-7
PROHIBITED
Using Bind References
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 16-8
PROHIBITED
Using Bind References (continued)
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 16-9
PROHIBITED
Using Lexical References
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-10
PROHIBITED
Using Lexical References (continued)
• To specify a WHERE clause, ORDER BY clause, or both at run time (as one
parameter):
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-11
PROHIBITED
Hints and Tips When Referencing
Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-12
PROHIBITED
Hints and Tips for Referencing Parameters (continued)
Example:
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-13
PROHIBITED
Creating a List of Values
4
5
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-14
PROHIBITED
Creating a List of Values (continued)
To create a static list of values:
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-15
PROHIBITED
Creating a List of Values
1
3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-16
PROHIBITED
Creating a List of Values (continued)
To see a more meaningful list of descriptive values, instead of the primary or foreign key
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-17
PROHIBITED
Referencing System Parameters
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-18
PROHIBITED
Referencing System Parameters (continued)
The system parameters are:
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-19
PROHIBITED
Building a Paper Parameter Form
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-20
PROHIBITED
Building a Paper Parameter Form (continued)
If you create many parameters in your report, the run-time parameter form can spread
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-21
PROHIBITED
Customizing a Paper Parameter Form
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-22
PROHIBITED
Customizing a Paper Parameter Form (continued)
Creating Parameter Boilerplate Objects
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-23
PROHIBITED
Using Parameter Form HTML Extensions
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-24
PROHIBITED
Using Parameter Form HTML Extensions (continued)
To create a boilerplate text object for HTML tags:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-25
PROHIBITED
Parameter Form Header and Footer
Footer
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-26
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-27
PROHIBITED
Practice 16 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-28
PROHIBITED
Practice Session: Lesson 16
1. Open report p13q3.rdf.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-29
PROHIBITED
Practice Session: Lesson 16 (continued)
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.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 16-30
PROHIBITED
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
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 17-2
PROHIBITED
Adding a Graph to a Paper Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 17-3
PROHIBITED
Creating and Embedding a Graph in a Report (continued)
From the Paper Design view:
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 17-4
PROHIBITED
Adding a Graph to a Web Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 17-5
PROHIBITED
Adding a Graph to a Web Report
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 17-6
PROHIBITED
Selecting the Graph Type
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 17-7
PROHIBITED
Selecting the Graph Data
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 17-8
PROHIBITED
Adding Options to the Graph
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 17-9
PROHIBITED
Adding Options to the Graph (continued)
• Use the X-Axis page to specify options for the x-axis of your graph. Options include
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-10
PROHIBITED
Customizing Web Graphs
Graph XML
</rw:graph>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-11
PROHIBITED
The rw:graph Tag
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-12
PROHIBITED
The rw:graph Tag (continued)
Use the Web Source editor to modify or add attributes. In the previous slide, the width and
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-13
PROHIBITED
Customizing Graphs Using
the Graph.XML File
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-14
PROHIBITED
Customizing Graphs Using the Graph.XML File (continued)
The Graph.DTD File
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-15
PROHIBITED
Using Graph Hyperlinks
• Document
on same
machine
• Any
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-16
PROHIBITED
Using Graph Hyperlinks (continued)
Examples:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-17
PROHIBITED
Technical Note
When delimiting parameters in a URL, you can use the ampersand (&) or the plus sign
(+). 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-18
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-19
PROHIBITED
Practice 17 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-20
PROHIBITED
Practice Session: Lesson 17
1. Open report p17q1a.jsp.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-21
PROHIBITED
Practice Session: Lesson 17 (continued)
4. Open report p9q3.jsp.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 17-22
PROHIBITED
Enhancing Matrix Reports
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 18-2
PROHIBITED
The Matrix Data Model
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 18-3
PROHIBITED
The Matrix Data Model (continued)
There is an extra group that surrounds the row and column groups. It is called the cross
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 18-4
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 18-5
PROHIBITED
The Matrix Paper Layout (continued)
For the simple matrix style, the Report Wizard creates:
• 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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 18-6
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 18-7
PROHIBITED
Creating Matrix Summaries (continued)
Setting the Product Order
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 18-8
PROHIBITED
Creating the Matrix Manually
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 18-9
PROHIBITED
Creating the Matrix Manually (continued)
Building the entire matrix report manually:
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-10
PROHIBITED
The Matrix with Group Data Model
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-11
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-12
PROHIBITED
Building a Nested Matrix
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-13
PROHIBITED
Building a Nested Matrix (continued)
To recreate the cross product group:
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-14
PROHIBITED
Nested Matrix Paper Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-15
PROHIBITED
Nested Matrix Paper Layout (continued)
Creating a Matrix Object
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-16
PROHIBITED
Creating Nested Matrix Summaries
F_Sum_CITY
F_SumSALPerJOB_
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-17
PROHIBITED
Creating Nested Matrix Summaries (continued)
The Product Order indicates the way in which Reports Builder evaluates a summary.
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/
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-18
PROHIBITED
Displaying Zeros
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-19
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-20
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-21
PROHIBITED
Practice 18 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-22
PROHIBITED
Practice Session: Lesson 18
1. Open report p4q6.jsp.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-23
PROHIBITED
Practice Session: Lesson 18 (continued)
f. Use the Data Model view to create summaries for each month and for the level
month and product.
Property Value
Name SumMonth
Product Order G_MONTH
Function Sum
Source SumTOTAL_VALUE
Reset At G_MONTH
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 18-24
PROHIBITED
Coding PL/SQL Triggers
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 19-2
PROHIBITED
Types of Triggers in Reports
• Report:
– Five triggers
– Report Triggers node in Object Navigator
• Data Model:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 19-3
PROHIBITED
Types of Triggers in Reports (continued)
• Data Model:
- 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 parameter—or the corresponding layout object—field, repeating
frame, or parameter field.
• Layout:
- Format triggers on most paper layout objects (excluding anchors). Each trigger
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 19-4
PROHIBITED
Trigger Code
Boolean:
true
false
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 19-5
PROHIBITED
Using Report Triggers
Before
Parameter F
Form
1 2 If readonly=yes 3
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 19-6
PROHIBITED
Using Report Triggers (continued)
You can access the report triggers from the Object Navigator. Open the Report Triggers
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 19-7
PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 19-8
PROHIBITED
Using Report Triggers: Creating a Dynamic WHERE Clause (continued)
There are two possibilities at run time:
• 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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 19-9
PROHIBITED
Using Data Model Triggers:
PL/SQL Group Filter
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-10
PROHIBITED
Using Data Model Triggers: PL/SQL Group Filter (continued)
Example
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-11
PROHIBITED
Using Data Model Triggers:
Parameter Validation
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-12
PROHIBITED
Using Data Model Triggers: Parameter Validation (continued)
Example: To prevent report output from being sent directly to a printer, test the value of
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-13
PROHIBITED
Using Layout Triggers
Format triggers:
• Exist on most layout objects
• Can suppress an entire layout section (master
group frame): No records fetched
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-14
PROHIBITED
Using Layout Triggers (continued)
Suppressing Individual Records
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-15
PROHIBITED
Using a Format Trigger on a Frame
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-16
PROHIBITED
Coding a Format Trigger on a Frame (continued)
Example:
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);
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-17
PROHIBITED
Using a Format Trigger on a
Repeating Frame
Dynamically Altering the Display of Records
Employee Details
Employee Details
King 17-JUN-87 24000
1 3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-18
PROHIBITED
Using a Format Trigger on a Repeating Frame (continued)
Example:
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-19
PROHIBITED
Using a Format Trigger on a Field
Employee Details
Employee Details
King 17-JUN-87 24000 1
f_name f_date f_salary
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-21
PROHIBITED
Using a Format Trigger on a
Boilerplate Object
Insert Spacing Between Groups of Records
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-22
PROHIBITED
Using a Format Trigger on a Boilerplate Object (continued)
Example
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-23
PROHIBITED
Writing Common Code
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-25
PROHIBITED
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 employee’s 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 employee’s 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-26
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-27
PROHIBITED
Event-Driven Publishing API (continued)
The API consists of several key elements:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-28
PROHIBITED
Invoking a Report from a Database Event
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-29
PROHIBITED
Invoking a Report from a Database Event (continued)
Example: Send a report when an employee has submitted an expense report. The code for
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-30
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-31
PROHIBITED
Summary (continued)
Objects That Must Return a Value
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-32
PROHIBITED
Practice 19 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-33
PROHIBITED
Practice Session: Lesson 19
1. Create a new report, using p19q1.sql.
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-34
PROHIBITED
Practice Session: Lesson 19 (continued)
2. Continue with the previous report.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 19-35
PROHIBITED
Oracle University and EGABI SOLUTIONS use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Extending Functionality Using
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 20-2
PROHIBITED
Contents of the SRW Package
SRW.SET_BOOKMARK SRW.DO_SQL
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 20-3
PROHIBITED
Contents of the Reports Builder Built-in Package (continued)
Rules
• 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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 20-4
PROHIBITED
Outputting Messages
• Warning:
WHEN <exception> THEN
SRW.MESSAGE (999, ‘Warning: report continues’);
• 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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 20-5
PROHIBITED
Outputting Messages (continued)
Is It a Warning or an Error?
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 20-6
PROHIBITED
Executing a Nested Report
1 KING.LIS 2
xxx xxxxxxx
KING xxx xxxxxxx
KOCHHAR
KOCHHAR.LIS
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 20-7
PROHIBITED
Executing a Nested Report (continued)
Example
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 20-8
PROHIBITED
Executing a Nested Report
• Example:
SRW.RUN_REPORT
('Report=EMPS
DESTYPE=FILE
DESNAME='||:LAST_NAME||'.LIS
• 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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 20-9
PROHIBITED
Executing a Nested Report (continued)
Reports Builder raises a specific exception that applies to the SRW.RUN_REPORT
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-10
PROHIBITED
Restricting Data
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-11
PROHIBITED
Restricting Data (continued)
Example
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);
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-12
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-13
PROHIBITED
Initializing Fields (continued)
You can use SRW.SET_FIELD to retrieve the current logical page number and
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-14
PROHIBITED
Creating a Table of Contents
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-15
PROHIBITED
Creating a Table of Contents (continued)
Example: You want to generate a report of all e-mail addresses of your customers. Your
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-16
PROHIBITED
Performing DDL Statements
• Example:
SRW.DO_SQL('CREATE TABLE SRW_LOG
(RPT_NAME VARCHAR2(40),
REC_NUM NUMBER,
• Exception: SRW.DO_SQL_FAILURE
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-17
PROHIBITED
Performing DDL Statements (continued)
Querying from Temporary Tables
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-18
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-19
PROHIBITED
Setting Format Attributes
• Visual attributes:
SRW.SET_FILL_PATTERN('solid');
SRW.SET_BORDER_WIDTH(250);
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-20
PROHIBITED
Setting Format Attributes (continued)
Example (continued)
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);
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-21
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-22
PROHIBITED
Using Format Attributes in a Web Layout (continued)
Example
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-23
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-24
PROHIBITED
Practice 20 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-25
PROHIBITED
Practice Session: Lesson 20
1. Open report p9q3.jsp.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-26
PROHIBITED
Practice Session: Lesson 20 (continued)
3. Execute a detail report from a master report.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-27
PROHIBITED
Practice Session: Lesson 20 (continued)
b. The same trigger should also insert the current date, userid, and “Starting
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 20-28
PROHIBITED
Maximizing Performance Using
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 21-2
PROHIBITED
Running Reports Using
OracleAS Reports Services
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 21-3
PROHIBITED
Running Reports Using OracleAS Reports Services (continued)
Benefits of OracleAS Reports Services
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 21-4
PROHIBITED
Report Request Methods
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 21-5
PROHIBITED
Report Request Methods (continued)
• SRW.RUN_REPORT: This is a packaged PL/SQL procedure that submits a report to
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-
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 21-6
PROHIBITED
Oracle Application Server Components
Web
Enterprise Application Development Framework Services
System Management
Management
Portal Business Integration
Intelligence Broker
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 21-7
PROHIBITED
OracleAS Reports Services Architecture (continued)
First, you should be familiar with the key components of Oracle Application Server:
• 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 21-8
PROHIBITED
Enabling Single Sign-On Access
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 21-9
PROHIBITED
Enabling Single Sign-On Access (continued)
SSO enables you to establish unique identities for each user which are tied to resources
unique to that user. The user’s 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 user’s 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-10
PROHIBITED
Running the Web Layout:
JSP Run-time Architecture
HTTP
CORBA/IIOP CORBA/IIOP
OID
OracleAS Reports
Reports Services Engine
PDS
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-11
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-12
PROHIBITED
Running a Paper Report on the Web
URL syntax:
http://vesuvius.world.com:8888/reports/rwservlet?
report=emp_dept.rdf&desformat=html&destype=cache&
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-13
PROHIBITED
Running a Paper Report on the Web (continued)
In the example, the first line contains the Web server hostname (vesuvius), the domain name
(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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-14
PROHIBITED
Running a Report from the Command Line
• SERVER = <server_name>
• MODULE|REPORT = <runfile>
• DESTYPE = FILE, PRINTER, MAIL, CACHE,
LOCALFILE, SYSOUT,ORACLEPORTAL
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-15
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-16
PROHIBITED
The Schedule Parameter
RWCLIENT...
SCHEDULE=monthly_last_weekday_from_17:00_Nov_22,_2003_
TIME
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-17
PROHIBITED
The Schedule Parameter (continued)
Syntax
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>
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-18
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-19
PROHIBITED
Using Oracle Enterprise Manager
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-20
PROHIBITED
Managing and Monitoring OracleAS
Reports Services
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-21
PROHIBITED
What Is the Queue Manager?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-22
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-23
PROHIBITED
Queue Manager
All my jobs
All jobs
Refresh
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-24
PROHIBITED
Using the Queue Manager
RSVR1
Queue
Manager
RSVR2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-25
PROHIBITED
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-26
PROHIBITED
Practice 21 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-27
PROHIBITED
Practice Session: Lesson 21
1. You created a report called SalaryByDept.jsp that displays the salary
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 21-28
PROHIBITED
Building Reports: Efficiency Guidelines
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 22-2
PROHIBITED
Tuning Reports
• No absolute rules
• Investigate specific areas:
– Data Model
– Paper Layout
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 22-3
PROHIBITED
Tuning Oracle Reports (continued)
The Reports Trace Option
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 22-4
PROHIBITED
Performance Measurement
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 22-6
PROHIBITED
Non SQL Data Sources (continued)
You can also specify an Extensible Stylesheet Language file (XSL) for the XML data
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
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 22-7
PROHIBITED
Investigating the Data Model
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 22-8
PROHIBITED
Investigating the Data Model (continued)
• Efficient use of SQL: Inefficient SQL can severely impact performance. As
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle COMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports 22-9
PROHIBITED
Investigating the Data Model
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-10
PROHIBITED
Investigating the Data Model (continued)
• Redundant queries: Ideally, a report should have no queries that return data that is
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-11
PROHIBITED
Investigating the Paper Layout
• Frames
• Object size
• Format triggers
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-12
PROHIBITED
Investigating the Paper Layout (continued)
• Format triggers: Care should be taken when using format triggers as the trigger fires
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-13
PROHIBITED
Running the Report
• RUNDEBUG=NO
• Array processing
• LONGCHUNK
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-14
PROHIBITED
Running the Report (continued)
If the report has columns of the LONG, CLOB, or BLOB datatype, the LONGCHUNK
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-15
PROHIBITED
Different Development and Run-Time
Environments
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-16
PROHIBITED
Different Development and Run-Time Environments (continued)
Character Mode Environment
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).
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-17
PROHIBITED
Developing Reports to Run in Different
GUIs
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-18
PROHIBITED
Developing Reports to Run in Different GUIs (continued)
Example
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 */
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-19
PROHIBITED
Setting NLS Language Environment
Variables
• NLS_LANG
• DEVELOPER_NLS_LANG, USER_NLS_LANG
NLS_LANG=French_France.WE8DEC
NLS_LANG=<lang>_<territory>.UTF8
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-20
PROHIBITED
Building Reports to Run in Different Languages (continued)
Syntax
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-21
PROHIBITED
Translating an Oracle Reports Application
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-22
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-23
PROHIBITED
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 Oracle’s 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-24
PROHIBITED
Practice 22 Overview
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-25
PROHIBITED
Practice Session: Lesson 22
1. Name four main areas to investigate when tuning reports.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports 22-26
PROHIBITED
A
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:
• 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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports A-2
PROHIBITED
Practice Session Solutions: Lesson 2
1. Invoke the Reports Builder executable.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports A-3
PROHIBITED
Practice Session Solutions: Lesson 2 (continued)
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.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports A-4
PROHIBITED
Practice Session Solutions: Lesson 2 (continued)
5. Open report p2q5.jsp and run the Web layout.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports A-5
PROHIBITED
Practice Session Solutions: Lesson 2 (continued)
d. Close the Paper Design view.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports A-6
PROHIBITED
Practice Session Overview: Lesson 3
This practice session contains:
• 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
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports A-7
PROHIBITED
Practice Session Solutions: Lesson 3
1. Start Reports Builder and open the existing report: p3q1.jsp. Run the paper
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports A-8
PROHIBITED
Practice Session Solutions: Lesson 3 (continued)
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.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
OracleCOMPUTER
Reports Developer 10g:
IS STRICTLY Build Reports A-9
PROHIBITED
Practice Session Overview: Lesson 4
This practice session contains:
• 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-10
PROHIBITED
Practice Session Overview: Lesson 4 (continued)
Invoking Reports Builder and the Wizard
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-11
PROHIBITED
Practice Session Overview: Lesson 4 (continued)
2. Using the reentrant Report Wizard, make the following modifications (test your
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-12
PROHIBITED
Practice Session Overview: Lesson 4 (continued)
4. Create a new report as follows:
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-13
PROHIBITED
Practice Session Overview: Lesson 4 (continued)
5. Using the reentrant Wizard, modify the report to create a Form Letter style.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-14
PROHIBITED
Practice Session Overview: Lesson 4 (continued)
e. Display the sum of the total values in the cells.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-15
PROHIBITED
Practice Session Overview: Lesson 4 (continued)
8. Web-enable a paper report.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-16
PROHIBITED
Practice Session Overview: Lesson 5
This practice session involves modifying reports by applying changes in the Paper
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-17
PROHIBITED
Practice Session Solutions: Lesson 5
1. Open report p4q2.rdf. Make the following changes in the Paper Design view:
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-18
PROHIBITED
Practice Session Solutions: Lesson 5 (continued)
2. Open report p4q3.rdf. 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. 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-19
PROHIBITED
Practice Session Solutions: Lesson 5 (continued)
3. Open report p5q3_a.rdf. 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 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-20
PROHIBITED
Practice Session Solutions: Lesson 5 (continued)
If You Have Time
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-21
PROHIBITED
Practice Session Overview: Lesson 6
This practice session contains:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-22
PROHIBITED
Practice Session Solutions: Lesson 6
1. Customize an existing template, adding a company logo and report title to the
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-23
PROHIBITED
Practice Session Solutions: Lesson 6 (continued)
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.
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?
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-24
PROHIBITED
Practice Session Solutions: Lesson 6 (continued)
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.
Select the Character, Number, and Date fields and change the text color
with the Text color palette.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-25
PROHIBITED
Practice Session Overview: Lesson 7
This practice session contains:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-26
PROHIBITED
Practice Session Solutions: Lesson 7
1. Create a tabular report, Web and paper layout, entitled Compensation Report. The
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-27
PROHIBITED
Practice Session Solutions: Lesson 7 (continued)
f. Which JSP tag identifies the overall appearance and formatting of the data in
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.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-28
PROHIBITED
Practice Session Overview: Lesson 8
This practice session contains:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-29
PROHIBITED
Practice Session Solutions: Lesson 8
1. Open report p8q1_a.jsp, a tabular report showing customer information.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-30
PROHIBITED
Practice Session Overview: Lesson 9
This practice session contains:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-31
PROHIBITED
Practice Session Solutions: Lesson 9 (continued)
1. Open p8q1_a.jsp.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-32
PROHIBITED
Practice Session Solutions: Lesson 9 (continued)
2. Continue with the same report.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-33
PROHIBITED
Practice Session Solutions: Lesson 9 (continued)
h. Now you need to show not only which products the sales representatives
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-34
PROHIBITED
Practice Session Solutions: Lesson 9 (continued)
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.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-35
PROHIBITED
Practice Session Solutions: Lesson 9 (continued)
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-36
PROHIBITED
Practice Session Overview: Lesson 10
This practice session contains:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-37
PROHIBITED
Practice Session Solutions: Lesson 10
1. Create a new report using the Report Wizard. Create both a Web and paper layout
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-39
PROHIBITED
Practice Session Solutions: Lesson 10 (continued)
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-40
PROHIBITED
Practice Session Solutions: Lesson 10 (continued)
Hint: You need one formula column and two summaries and two
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-41
PROHIBITED
Practice Session Overview: Lesson 11
This practice session contains:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-42
PROHIBITED
Practice Session Overview: Lesson 11 (continued)
1. Open report p10q1.rdf. Modify the report as follows:
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-43
PROHIBITED
Practice Session Overview: Lesson 11 (continued)
c. Add a trailer section that displays today’s 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.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-44
PROHIBITED
Practice Session Overview: Lesson 11 (continued)
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.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-45
PROHIBITED
Practice Session Overview: Lesson 11 (continued)
3. Open report p11q3.rdf. Modify the report to burst on repeating data, based on
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-46
PROHIBITED
Practice Session Overview: Lesson 11 (continued)
5. Open and run report p2q10.rdf.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-47
PROHIBITED
Practice Session Overview: Lesson 11 (continued)
i. Link the repeating frame to the G_EMPLOYEE group.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-48
PROHIBITED
Practice Session Overview: Lesson 12
This practice session contains:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-49
PROHIBITED
Practice Session Solutions: Lesson 12
1. Create a new break report showing each customer and the relevant orders.
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:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-50
PROHIBITED
Practice Session Solutions: Lesson 12 (continued)
2. Create a new tabular report.
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 report’s 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-51
PROHIBITED
Practice Session Overview: Lesson 13
This practice session contains:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-52
PROHIBITED
Practice Session Solutions: Lesson 13
1. Open report p4q4.rdf.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-53
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
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-54
PROHIBITED
Practice Session Overview: Lesson 14
This practice session contains:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-55
PROHIBITED
Practice Session Solutions: Lesson 14
1. Create a new Web report by adding dynamic content to an existing Web page.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-56
PROHIBITED
Practice Session Solutions: Lesson 14 (continued)
2. Customize report p14q1.jsp using JSP tag attributes.
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">
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-57
PROHIBITED
Practice Session Overview: Lesson 15
This practice session contains:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-58
PROHIBITED
Practice Session Overview: Lesson 15 (continued)
1. Run an XML report definition.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-59
PROHIBITED
Practice Session Overview: Lesson 16
This practice session contains:
• 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-60
PROHIBITED
Practice Session Solutions: Lesson 16
1. Open report p13q3.rdf.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-61
PROHIBITED
Practice Session Solutions: Lesson 16 (continued)
b. Save the report as p16q2.rdf. Do not close it for the moment.
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 employee’s 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-62
PROHIBITED
Practice Session Solutions: Lesson 16 (continued)
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.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-63
PROHIBITED
Practice Session Overview: Lesson 17
This practice session contains:
• 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-64
PROHIBITED
Practice Session Solutions: Lesson 17
1. Open report p17q1a.jsp.
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-65
PROHIBITED
Practice Session Solutions: Lesson 17 (continued)
3. Continue with report p17q2.jsp.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-66
PROHIBITED
Practice Session Solutions: Lesson 17 (continued)
4. Open report p9q3.jsp.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-67
PROHIBITED
Practice Session Solutions: Lesson 17 (continued)
b. Run the Web layout to test. Ensure that a graph displays for each sales
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-68
PROHIBITED
Practice Session Overview: Lesson 18
This practice session contains:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-69
PROHIBITED
Practice Session Solutions: Lesson 18
1. Open report p4q6.jsp.
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-70
PROHIBITED
Practice Session Solutions: Lesson 18 (continued)
c. Increase the width of the Main Section of the report to 17 inches.
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-71
PROHIBITED
Practice Session Solutions: Lesson 18 (continued)
g. Use the Paper Layout view to create the fields. You must expand the
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
Property Value
Name F_SumMonth
Source SumMonth
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-72
PROHIBITED
Practice Session Solutions: Lesson 18 (continued)
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.
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),
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-73
PROHIBITED
Practice Session Overview: Lesson 19
This practice session contains:
• 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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-74
PROHIBITED
Practice Session Solutions: Lesson 19 (continued)
1. Create a new report, using p19q1.sql.
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-75
PROHIBITED
Practice Session Solutions: Lesson 19 (continued)
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.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-76
PROHIBITED
Practice Session Solutions: Lesson 19 (continued)
2. Continue with the previous report.
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
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-77
PROHIBITED
Practice Session Solutions: Lesson 19 (continued)
c. Move the function code into a new PL/SQL library named p19lib.pll.
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 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-78
PROHIBITED
Practice Session Solutions: Lesson 19 (continued)
If You Have Time
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-79
PROHIBITED
Practice Session Overview: Lesson 20
This practice session contains:
• 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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-80
PROHIBITED
Practice Session Solutions: Lesson 20
1. Open report p9q3.jsp.
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-84
PROHIBITED
Practice Session Solutions: Lesson 20 (continued)
b. The same trigger should also insert the current date, userid, and “Starting
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-85
PROHIBITED
Practice Session Solutions: Lesson 20 (continued)
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.
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
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-86
PROHIBITED
Practice Session Solutions: Lesson 20 (continued)
j. Write a trigger that inserts a record with the comment “Printing another
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-87
PROHIBITED
Practice Session Overview: Lesson 21
This practice session contains:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-88
PROHIBITED
Practice Session Solutions: Lesson 21
1. You created a report called SalaryByDept.jsp that displays the salary
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-89
PROHIBITED
Practice Session Overview: Lesson 21
3. In addition to using a URL, what are the other methods for requesting a report?
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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-90
PROHIBITED
Practice Session Overview: Lesson 22
This practice session contains:
• 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
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-91
PROHIBITED
Practice Session Solutions: Lesson 22
1. Name four main areas to investigate when tuning reports.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Oracle Reports
COMPUTER Developer 10g:
IS STRICTLY Build Reports A-92
PROHIBITED
B
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
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 company’s employees and
facilities.
• The Order Entry division tracks product inventories and sales of the company’s 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.
HR Human Resources
OE Order Entry
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.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. B-10
COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Table Descriptions
Queued Shipping (QS)
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.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. B-11
COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Table Descriptions
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. B-12
COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
C
Creating Web
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.
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.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. C-2
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:
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.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. C-3
COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Creating a Web Layout Template
Step 1: Create a template file (.tdf)
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. C-4
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
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:
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:
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. C-5
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)
6. Specify all your generic HTML, such as copyright and contact information before the
</BODY> tag
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. C-6
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_HOME/reports/templates. This file references Oracle Reports templates with
their associated styles.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. C-7
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
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.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. C-8
COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Creating a Web Layout Template
Step 3: Update the Web Layout Template Description File (continued)
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.
3. After adding the <webTemplate> and <classSet> entries, save the rwTemplates.xml
file and restart Reports Builder.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR Developer
USE IN 10g: Build
THIS CLASSROOM Reports
ONLY. C-9
COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Creating a Web Layout Template
Step 4: Test the new Web layout template
1. Create a new report using the Report Wizard, and choose the TDF file you created, for
example, MyCompany.tdf template.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR USE Developer 10g: Build
IN THIS CLASSROOM Reports
ONLY. C-10
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
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
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR USE Developer 10g: Build
IN THIS CLASSROOM Reports
ONLY. C-11
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
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.
Oracle
THESE eKIT MATERIALS ARE Reports
FOR YOUR USE Developer 10g: Build
IN THIS CLASSROOM Reports
ONLY. C-12
COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Glossary
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
A
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.
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.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED