Professional Documents
Culture Documents
Build Reports
D12997GC10
Production 1.0
June 2002
D34780
Author Copyright Oracle Corporation, 2002. All rights reserved.
Publisher
John B Dawson
Contents
.....................................................................................................................................................
Contents
Preface
Profile xvi
Resources xvii
Typographic Conventions xviii
Introduction
Course Objectives I-3
Course Content I-5
.....................................................................................................................................................
Oracle9i Reports Developer: Build Reports iii
Contents
.....................................................................................................................................................
.....................................................................................................................................................
iv Oracle9i Reports Developer: Build Reports
Contents
.....................................................................................................................................................
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
Overview 8-3
Describing the Report Data Model 8-5
Modifying Properties of a Query 8-7
Changing the Group Structure 8-15
The Group Hierarchy 8-17
Ordering Data in a Group Hierarchy 8-19
Filtering Data in a Group 8-23
Summary 8-25
Practice Session Overview: Lesson 8 8-27
Practice Session: Lesson 8 8-28
.....................................................................................................................................................
Oracle9i Reports Developer: Build Reports v
Contents
.....................................................................................................................................................
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
Overview 10-3
The Data Model Column Types 10-5
Maintaining Data Source Columns 10-7
Using a Data Source Column to Output Contents of a File 10-9
Creating a Column 10-11
Creating Summary Columns 10-13
Example Report Displaying Subtotals 10-15
Example Report Displaying Percentages 10-17
Creating Formula Columns 10-21
Creating Placeholder Columns 10-23
Example Report to Populate a Placeholder 10-25
Summary 10-27
Practice Session Overview: Lesson 10 10-29
Practice Session: Lesson 10 10-30
.....................................................................................................................................................
vi Oracle9i Reports Developer: Build Reports
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle9i Reports Developer: Build Reports vii
Contents
.....................................................................................................................................................
.....................................................................................................................................................
viii Oracle9i Reports Developer: Build Reports
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle9i Reports Developer: Build Reports ix
Contents
.....................................................................................................................................................
Appendix A: Solutions
Practice Session Overview: Lesson 2 A-3
Practice Session Solutions: Lesson 2 A-4
Practice Session Overview: Lesson 3 A-8
Practice Session Solutions: Lesson 3 A-9
Practice Session Overview: Lesson 4 A-11
Practice Session Solutions: Lesson 4 A-12
Practice Session Overview: Lesson 5 A-18
Practice Session Solutions: Lesson 5 A-19
Practice Session Overview: Lesson 6 A-23
Practice Session Solutions: Lesson 6 A-24
Practice Session Overview: Lesson 7 A-27
Practice Session Solutions: Lesson 7 A-28
Practice Session Overview: Lesson 8 A-30
Practice Session Solutions: Lesson 8 A-31
Practice Session Overview: Lesson 9 A-33
Practice Session Overview: Lesson 10 A-40
Practice Session Solutions: Lesson 10 A-41
.....................................................................................................................................................
x Oracle9i Reports Developer: Build Reports
Contents
.....................................................................................................................................................
Glossary
.....................................................................................................................................................
Oracle9i Reports Developer: Build Reports xi
Contents
.....................................................................................................................................................
.....................................................................................................................................................
xii Oracle9i Reports Developer: Build Reports
Preface
.................................
Preface
.....................................................................................................................................................
Instructor Note
PowerPoint Slides The slide show provides some manual builds to enable you to
step through your explanation. So that content can be reused for different delivery
formats, Oracle University does not allow the use of animation in the slide show. If
you know how to use PowerPoint, you can add animation or modify the manual builds
if you prefer.
Practice Sessions Students might want to view the report output that they are asked
to produce in each question. Solution files of all reports are available in the SOLN
directory.
Suggest that students use Reports Builder to run any solution report file to see the
desired result. Remind them to use the appropriate option (i.e., Run Web Layout or
Run Paper Layout) to view the output
Setup Environment TThe setup environment for this course contains two tiers: the
database server and the client workstation.
Oracle9i Database Server Enterprise Edition is recommended for the database server.
The tables in the Human Resource (HR) and Order Entry (OE) schemas are used for
the demonstrations and practices. The EMP and DEPT tables are used in the lesson
Extending Functionality Using XML.
Oracle9i Developer Suite (Business Intelligence installation option) is recommended
for each client workstation. All reports, both Web and paper layouts, are run from
Reports Builder.
There is no middle tier application server required for this setup environment.
.....................................................................................................................................................
xiv Oracle9i Reports Developer: Build Reports
.....................................................................................................................................................
Known Issues If your setup environment uses Reports Builder 9.0.2, you need to be
aware of known issues with that release, as they may affect instructor demonsrations
and student practices.
• Query Builder: You cannot open tables containing user-defined objects in Query
Builder because Query Builder does not recognize these object types. These tables
include CUSTOMERS, OC_CORPORATE_CUSTOMERS, OC_CUSTOMERS,
OC_INVENTORIES, OC_ORDERS, OC_PRODUCT_INFORMATION,
PRODUCT_INFORMATION, PRODUCTS, and WAREHOUSES. To create a
report with one of these tables, you have to enter the query directly.
• Query Builder: Using the Sort option causes Reports Builder to crash. Refer to bug
#2352728 in the bug database (http://bug.us.oracle.com) for more information.
• Report Wizard: If you create a report using an object column (e.g.,
CUST_ADDRESS in the CUSTOMERS table) and then reenter the Wizard to
make modifications to the report or the layout, the selections you initially made for
that object column are not retained. Refer to bug #2294059 in the bug database for
more information.
• Templates: If you open one of the predefined templates in Reports Builder and
save it as another name, you receive “REP-69: Internal error”. Note, however, the
template is saved correctly under that new name. Refer to bug #2353764 in the bug
database for more information.
• Creating Columns: Suppose you create a report using the Report Wizard and then
manually create columns in the Data Model view of the Report Editor. In order to
display the new columns, you reenter the Wizard to update the layout. Reentering
the Wizard destroys the data model and you will receive several error messages
(e.g., “invalid reset group”) when you finish the Wizard and the paper layout
attempts to run. Refer to bug #2288263 in the bug database for more information.
• Matrix Reports: If you create a matrix with group report and save it as a JSP, you
will get an error: “ID attribute of rw:field tag is not unique”. Refer to bug
#2310757 in the bug database for more information.
.....................................................................................................................................................
Oracle9i Reports Developer: Build Reports xv
Preface
.....................................................................................................................................................
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
• The following instructor-led training (inClass) courses:
– Introduction to Oracle9i: SQL
– Introduction to Oracle9i: PL/SQL
• Or the following self-paced CD-ROM training (TBT) courses from the SQL
and PL/SQL Library:
– Oracle SQL: Basic SELECT Statements
– Oracle SQL: Data Retrieval Techniques
– Oracle SQL: DDL and DML
– PL/SQL: Basics
– PL/SQL: Procedures, Functions and Packages
– PL/SQL: Database Programming
Suggested
• Oracle9i: Advanced SQL (inClass)
• Or SQL and SQL*Plus: Advanced SELECT Statements (TBT)
• Oracle9i: Advanced PL/SQL (inClass)
.....................................................................................................................................................
xvi Oracle9i Reports Developer: Build Reports
Profile
.....................................................................................................................................................
.....................................................................................................................................................
Oracle9i Reports Developer: Build Reports xvii
Preface
.....................................................................................................................................................
Resources
Oracle Publications
Title Part Number
Oracle9iAS Release 2 Reports Services Release Notes - Solaris A96189-01
and Windows NT
Oracle9i Reports Developer Tutorial A90900-01
Oracle9i Reports Developer Building Reports A92101-01
Oracle9iAS Reports Services Publishing Reports A92102-01
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
• Oracle9i Reports Frequently Asked Questions (FAQ):
http://otn.oracle.com/products/reports/htdocs/faq9i.htm
• Oracle9i Reports whitepapers, presentations, and viewlets:
http://otn.oracle.com/products/reports/content.html
• Getting Started with Oracle9i Reports: http://otn.oracle.com/docs/products/
reports/htdocs/doc_library/getstart/GettingStarted/index/index.html
.....................................................................................................................................................
xviii Oracle9i Reports Developer: Build Reports
Typographic Conventions
.....................................................................................................................................................
Typographic Conventions
Typographic Conventions in Text
Convention Element Example
Bold italic Glossary term (if The algorithm inserts the new key.
there is a glossary)
Caps and lowercase Buttons, Click the Executable button.
check boxes, Select the Can’t Delete Card check box.
triggers,
Assign a When-Validate-Item trigger . . .
windows
Open the Master Schedule window.
Courier new, Code output, Code output: debug.seti('I',300);
case sensitive directory names, Directory: bin (DOS), $FMHOME (UNIX)
(default is filenames,
Filename: Locate the init.ora file.
lowercase) passwords,
pathnames, Password: Use tiger as your password.
URLs, Pathname: Open c:\my_docs\projects
user input, URL: Go to http://www.oracle.com
usernames User input: Enter 300
Username: Log on as scott
Initial cap Graphics labels Customer address (but Oracle Payables)
(unless the term is a
proper noun)
Italic Emphasized words Do not save changes to the database.
and phrases, For further information, see Oracle7 Server
titles of books SQL Language Reference Manual.
and courses,
Enter user_id@us.oracle.com , where
variables
user_id is the name of the user.
Quotation marks Interface elements Select “Include a reusable module
with long names component” and click Finish.
that have only This subject is covered in Unit II, Lesson 3,
initial caps; lesson “Working with Objects.”
and chapter titles in
cross-references
Uppercase SQL column Use the SELECT command to view
names, commands, information stored in the LAST_NAME
functions, schemas, column of the EMP table.
table names
.....................................................................................................................................................
Oracle9i Reports Developer: Build Reports xix
Preface
.....................................................................................................................................................
.....................................................................................................................................................
xx Oracle9i Reports Developer: Build Reports
I
................................
Introduction
Introduction
..........................................................................................................................................................................
Course Objectives
Instructor Note
Topic Timing
Lecture 10 minutes
Total 10 minutes
......................................................................................................................................................
I-2 Oracle9i Reports Developer: Build Reports
Course Objectives
..........................................................................................................................................................................
Course Objectives
Course Description
This course enables you to design and build a variety of standard and custom Web
and paper reports using Oracle9i 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 Oracle9iAS Reports Services to deploy your
reports.
Course Objectives
After completing this course, you should be able to do the following:
• Describe the capabilities of Oracle9i Reports
• Develop reports using data from any source, in any format, and publish to any
destination
• Develop and maintain different styles of reports using Reports Builder
• Lay out and format data to suit user reporting requirements
• Incorporate text, images, and graphics in reports
• Publish a report on the Web
• Manage server resources
• Tune reports
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports I-3
Introduction
..........................................................................................................................................................................
Course Content
Day 1:
• Introducing Oracle9i Reports Developer
• Designing and running reports
• Working in Oracle9i Reports Builder
• Creating and modifying paper reports using the
Wizard
• Enhancing a paper report in the Paper Design view
Day 2:
• Managing templates
• Creating a Web report
• Enhancing report structure
Course Content
Day 3:
• Using the paper layout
• Modifying properties
• Using Web reporting
• Extending functionality using XML
Day 4:
• Customizing reports with parameters
• Embedding graphs
• Enhancing matrix reports
• Adding PL/SQL code
......................................................................................................................................................
I-4 Oracle9i Reports Developer: Build Reports
Course Content
..........................................................................................................................................................................
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 Oracle9i Reports Developer
Designing and Running Reports
Working in Oracle9i 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
Day 3
Enhancing Reports Using the Paper Layout
Controlling the Paper Layout: Common Properties
Controlling the Paper Layout: Specific Properties
Web Reporting
Extending Functionality Using XML
Day 4
Creating and Using Reports Parameters
Embedding a Graph in a Report
Enhancing Matrix Reports
Coding PL/SQL Triggers
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports I-5
Introduction
..........................................................................................................................................................................
Course Content
Day 5:
• Extending functionality using the Reports Builder
built-in package
• Using 9iAS Reports Services
• Efficiency and performance guidelines
......................................................................................................................................................
I-6 Oracle9i Reports Developer: Build Reports
Course Content
..........................................................................................................................................................................
Day 5
Extending Functionlaity Using the SRW Package
Maximizing Performance Using Oracle9iAS Reports Services
Building Reports: Efficiency Guidelines
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports I-7
Introduction
..........................................................................................................................................................................
......................................................................................................................................................
I-8 Oracle9i Reports Developer: Build Reports
1
................................
Introduction to
Oracle9i Reports Developer
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
Objectives
Instructor Note
Topic Timing
Lecture 30 minutes
Total 30 minutes
......................................................................................................................................................
1-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
Oracle9i Reports Developer is a powerful enterprising 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 Oracle9i Reports Developer and
its relationship with Oracle’s end-to-end business intelligence solution.
Objectives
After completing this lesson, you should be able to do the following:
• Explain Oracle’s business intelligence solution
• List the benefits of enterprise reporting
• Describe the differences between Web publishing and paper publishing
• Describe the key features of Oracle9i Reports Developer
• Describe the architecture of Oracle9i Application Server
• Describe Oracle9iAS Reports Services
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-3
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
Business Intelligence
Discoverer Server Reports Server
XML
......................................................................................................................................................
1-4 Oracle9i Reports Developer: Build Reports
What Is Business Intelligence?
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-5
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
Enterprise Reporting
......................................................................................................................................................
1-6 Oracle9i Reports Developer: Build Reports
Enterprise Reporting
.....................................................................................................................................................
Enterprise Reporting
Evolution of 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 where 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-7
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
Enterprise Reporting
Reporting
Ad hoc query
Advanced
Web Client analysis
Data Server
Application Server
......................................................................................................................................................
1-8 Oracle9i Reports Developer: Build Reports
Enterprise Reporting
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-9
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
Web Publishing
GIF89a
hyperlinks
JavaScript
Paper Publishing
8.5”
GIF89a
hyperlinks
11”
JavaScript
......................................................................................................................................................
1-10 Oracle9i Reports Developer: Build Reports
Web Publishing and Paper Publishing
.....................................................................................................................................................
Web Publishing
A Web page is very fluid. A Web page does not have the limitation of page size; a page
can contain as much or as little data as you wish. If there is more content than will fit
in the browser window, scroll bars are displayed to allow users to navigate through the
content. Web specific features, such as bookmarks and hyperlinks, can also aid the
user in navigation.
A Web page comes alive with rich images, color, JavaScript, and animation. Users can
interactively drill down to see details or related data. Style sheets are used to
universally control appearance.
Paper Publishing
A paper report has characteristics that include rigid geometry restrictions, headers and
footers repeated on each page, and higher resolution allowing more details to be
presented to the end user at once, giving the end user the option of printing the output
and the ability to “study” the data.
Oracle Reports has historically done a very good job of publishing high fidelity paper
reports. The tools understands the concept of a paper page. It manages geometry and
includes features to control behavior when a page break occurs.
Effective Publishing
The key to effective publishing is understanding the medium, utilizing the
functionality the medium provides, and generating visually attractive content for that
medium. For the Web, this means the ability to incorporate Java, JavaScript, and
animated Graphic Interchange Formats (GIFs). For paper, it requires the
understanding of paper layouts and complicated geometry management.
Recognizing the differences between Web publishing and paper publishing, Oracle9i
Reports Developer provides a declarative environment with the power to generate
high quality output for the Web and e-business requirements, as well as high fidelity
paper reports.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-11
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
<TEXT>
<Your Data Source>
Benefits
......................................................................................................................................................
1-12 Oracle9i Reports Developer: Build Reports
Oracle9i Reports Developer
.....................................................................................................................................................
Benefits
• Oracle9i 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 you 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.
• Oracle9i 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 Oracle9i Reports: JavaServer
Pages (JSPs), servlets, JavaBeans, CORBA, and IIOP information protocol.
– Flexible design fits any middle-tier configuration.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-13
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
Oracle9i Products
Oracle9i Database
Documents
Multimedia
......................................................................................................................................................
1-14 Oracle9i Reports Developer: Build Reports
Oracle9i Products
.....................................................................................................................................................
Oracle9i Products
Oracle9i provides the complete Internet infrastructure that makes it easy for
companies interested in e-commerce to create and deploy scalable, Web-based
applications. Oracle markets three products to help you achieve this: Oracle9i
Database, Oracle9i Developer Suite (Oracle9iDS), and Oracle9i Application Server
(Oracle9iAS).
The Oracle9i Database manages all of your structured and unstructured data, including
Word documents, Excel spreadsheets, XML, images, and more. It provides a scalable,
secure, and reliable architecture.
The Oracle9i Developer Suite offers a complete set of integrated development tools,
empowering you to easily and quickly create Internet applications for personalized
Web portals and hosted software services. Oracle9i Developer Suite combines leading
Oracle application development and business intelligence tools into a single integrated
product. Built on Internet standards such as Java and XML, Oracle9iDS provides a
complete development environment.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-15
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
......................................................................................................................................................
1-16 Oracle9i Reports Developer: Build Reports
Oracle9i Products
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-17
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
......................................................................................................................................................
1-18 Oracle9i Reports Developer: Build Reports
Oracle9i Products
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-19
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
• User-friendly wizards
• Pluggable data sources
• Customizable report templates
• WYSIWYG live editor for paper reports
• Dynamic Web publishing using JSP/HTML
• Run-time customization
• Dynamic SQL execution
• Portal integration
• Event-based reporting
......................................................................................................................................................
1-20 Oracle9i Reports Developer: Build Reports
What Is Oracle9i Reports Developer?
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-21
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
• Flexible reporting
• Reduced overhead
• Fast distribution
• Real time publishing
HTTP
Instructor Note
The Reports CGI component is maintained only for backward compatibility.
......................................................................................................................................................
1-22 Oracle9i Reports Developer: Build Reports
What Is Oracle9i Reports Developer?
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-23
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
Summary
......................................................................................................................................................
1-24 Oracle9i Reports Developer: Build Reports
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.
• Oracle9i Reports Developer enables you to create and deploy reports using any
data, in any format, for any medium.
• The Oracle9i products provide the infrastructure to easily develop, deploy, and
manage Internet applications and Web sites. Oracle9i Reports Developer is a
component of the Oracle9i Developer Suite. Reports created with Oracle9i Reports
are deployed by Oracle9i Application Server, specifically Oracle9iAS Reports
Services.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 1-25
Lesson 1: Introduction to Oracle9i Reports Developer
.....................................................................................................................................................
......................................................................................................................................................
1-26 Oracle9i Reports Developer: Build Reports
2
................................
Objectives
Instructor Note
Topic Timing
Lecture 20 minutes
Practice 20 minutes
Total 40 minutes
......................................................................................................................................................
2-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
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.
Objectives
After completing this lesson, you should be able to do the following:
• Explain the development process
• Recognize user needs
• Name the common report styles required in a business report
• Describe the structure of common report styles
• Run prebuilt reports
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-3
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
User Requirements
Web or Charts
Paper Drill down
......................................................................................................................................................
2-4 Oracle9i Reports Developer: Build Reports
Designing Reports
.....................................................................................................................................................
Designing Reports
Understanding the User Requirements
In the first stage of the development, you determine what the user needs and expects.
While it may be tempting to skip this stage and start building right away, it is not a
good idea to do so. Without a clear understanding of the users and their reporting
needs, it is virtually impossible to create effective enterprise reports.
To define user requirements:
• Gather relevant policies, business rules, and existing documentation
• Observe users and their daily job activities
• Interview a wide variety of users
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.
• Will users want a report to be embedded in a form? If so, you will have to call the
report from a form and have the form pass the data to the report.
• Will the same report serve different types of users? If so, you need to think about
report sectioning and report distribution.
• Are there any administration or security issues? If so, you need to set up the
necessary specifications in the Oracle9iAS Portal Reports Security option.
• Will the users want run-time customizations? If so, plan on using XML files.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-5
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Designing Reports
Specification
Data retrieval
Common features
Structure
Style
Publishing
Medium
Instructor Note
Assure the students that the publishing medium will be addressed in a later lesson.
This is a high-level description to introduce students to the concept of the group
structure:
• Tabular: One group
• Master-detail: Master-detail hierarchy (may be several levels)
• Master and multiple details: Two or more detail groups at the same level
• Matrix: Two masters, one detail
The Form, Form Letter, and Mailing Label styles are not discussed at this stage,
because these are all variations of a single-group report.
......................................................................................................................................................
2-6 Oracle9i Reports Developer: Build Reports
Designing Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-7
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Tabular
List of Products
Product
Number Description Price
......................................................................................................................................................
2-8 Oracle9i Reports Developer: Build Reports
Design Considerations
.....................................................................................................................................................
Design Considerations
Introduction
Define the report structure by identifying the number of times each piece of data is
printed. Separate the data into groups based on this frequency. You may also need to
identify any relationships that exist between groups, so that you can create a hierarchy
in the internal report structure.
This section describes the four main styles of reports and the group structure for each.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-9
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Master-Detail
Outstanding Customer Items
Customer Name
Product
Number Price
Customer Name
Product
Number Price
......................................................................................................................................................
2-10 Oracle9i Reports Developer: Build Reports
Design Considerations
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-11
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Customer
......................................................................................................................................................
2-12 Oracle9i Reports Developer: Build Reports
Design Considerations
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-13
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Matrix
Customer Matrix
Product ID
Customer
Instructor Note
Another way of describing a matrix report is one which has two masters (parents) and
one detail (child). The detail data displays where the two masters intersect.
......................................................................................................................................................
2-14 Oracle9i Reports Developer: Build Reports
Design Considerations
.....................................................................................................................................................
Two Masters
The matrix style is the only style in which a detail group is related to two different
master groups at the same level.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-15
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
......................................................................................................................................................
2-16 Oracle9i Reports Developer: Build Reports
Retrieving and Sharing Data
.....................................................................................................................................................
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
Customer Statistics 2 or 3
Customer Matrix 1, 2, or 3
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-17
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Running a Report
• Your browser
• Oracle9iAS Portal application
• Command line (Start > Run)
• Oracle9iAS Reports Queue Manager
• Menu integrated with a Forms application
• Button in a Forms application
Instructor Note
Run a few of the pre-built reports in your directory using Reports Builder as this is the
methos the students will use in the practice.
• Run the Web layout for p2q4.jsp.
• Run the paper layout for p2q3.rdf.
• Run the paper layout for p2q6.rdf. This is a report with parameters. Valid
customer IDs include 145, 146, and 147.
• Double-click \demo\ShippingManifest.pdf. This report includes a barcode Java
bean.
• If you can access the Oracle9i Reports hosted demos Web site, show the students
one or two reports. This site contains links that allow you to run reports through
the Oracle9iAS Reports Services, look at source code, download demo scripts and
documentation, and so forth.
......................................................................................................................................................
2-18 Oracle9i Reports Developer: Build Reports
Running a Report
.....................................................................................................................................................
Running a Report
Invoking a Report
There can be many ways of running a report, depending on the application design. You
can call a report from:
• A Web browser
• An Oracle9iAS Portal application
• The command line, using the Start > Run option in Windows NT
• The Oracle9iAS Reports Queue Manager
• A Java application
• A database trigger
• A customized menu in a Forms application
• A button in a Forms application
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-19
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Previewing Reports
Print Preview
1 2 3
......................................................................................................................................................
2-20 Oracle9i Reports Developer: Build Reports
Previewing Reports
.....................................................................................................................................................
Previewing Reports
Introduction
In Reports Builder, there are a number of ways in which you can preview your report.
Print Preview
Select File > Print Preview to display your formatted paper report. Your output
displays in the Previewer window.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-21
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Print Preview
1 2 3
Instructor Note
Demonstration: p5q3.rdf
Select File > Print Preview and demonstrate these features, especially how to split the
screen. This feature is not obvious to students.
......................................................................................................................................................
2-22 Oracle9i Reports Developer: Build Reports
Previewing Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-23
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
• RDF
• REP
• JSP
• HTML
• XML
......................................................................................................................................................
2-24 Oracle9i Reports Developer: Build Reports
Previewing Reports
.....................................................................................................................................................
Reports defintions RDF and REP are “owned” by Oracle9i Reports. In other words,
you will need to use Oracle9i 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 Oracle9i 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-25
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Summary
......................................................................................................................................................
2-26 Oracle9i Reports Developer: Build Reports
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 Oracle9iAS 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-27
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
Practice 2 Overview
......................................................................................................................................................
2-28 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 2
.....................................................................................................................................................
Introduction
This practice session consists of a combination of practical and paper-based questions
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-29
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
......................................................................................................................................................
2-30 Oracle9i Reports Developer: Build Reports
Practice Session: Lesson 2
.....................................................................................................................................................
Run the paper layout again. This time do not specify a customer ID.
e
i What is the result?
ii In a production situation, what should happen in this instance?
f Close the Paper Design view.
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 2-31
Lesson 2: Designing and Running Reports
.....................................................................................................................................................
......................................................................................................................................................
2-32 Oracle9i Reports Developer: Build Reports
3
................................
Working in Oracle9i
Reports Developer
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Objectives
Instructor Note
Topic Timing
Lecture 30 minutes
Practice 15 minutes
Total 45 minutes
......................................................................................................................................................
3-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
This lesson describes the Oracle9i Reports executables and gives an overview of
Reports Builder, including a high-level description of its components and object
hierarchy.
Objectives
After completing this lesson, you should be able to do the following:
• Describe the main Oracle9i Reports executables
• Describe the main components of Reports Builder
• Describe the main objects in a report
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-3
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Executables
Developer
Reports Builder Reports Runtime Reports Converter
rwbuilder rwrun rwconverter
Reports Services
......................................................................................................................................................
3-4 Oracle9i Reports Developer: Build Reports
Reports Developer Executables
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-5
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Instructor Note
If you invoke Reports Builder at this stage, do not choose the Wizard, but select the
option “Open an existing report” and then select a simple report to demonstrate the
components and objects in the builder.
......................................................................................................................................................
3-6 Oracle9i Reports Developer: Build Reports
Reports Developer Executables
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-7
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Modules
Instructor Note
Briefly explain the different module types, but point out that the rest of this lesson
discusses the report definition. The other two objects are discussed later in the course.
......................................................................................................................................................
3-8 Oracle9i Reports Developer: Build Reports
Reports Builder
.....................................................................................................................................................
Reports Builder
Introduction
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.
This section gives an overview of the module types.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-9
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Paper
Web
......................................................................................................................................................
3-10 Oracle9i Reports Developer: Build Reports
Reports Builder
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-11
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Instructor Note
Briefly introduce the main components of Reports Builder. They will be discussed in
more detail later in the lesson.
......................................................................................................................................................
3-12 Oracle9i Reports Developer: Build Reports
Reports Builder Components
.....................................................................................................................................................
Report Editor
The Report Editor contains different views to help you handle the data objects and
layout objects for Web and paper reports. These views will be introduced later in this
lesson.
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:
• Inherit and localize properties from another object
• A Find field and icons, similar to the Object Navigator
PL/SQL Editor
The PL/SQL Editor enables you to create and compile program units such as
procedures, functions, and packages within the current report.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-13
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
......................................................................................................................................................
3-14 Oracle9i Reports Developer: Build Reports
Navigating Around the Oracle9i Reports Main Menu
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-15
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Wizards
• Report Wizard
• Data Wizard
• Graph Wizard
• Report Block Wizard
......................................................................................................................................................
3-16 Oracle9i Reports Developer: Build Reports
Navigating Around the Oracle9i Reports Main Menu
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-17
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Report Editor
• Data Model
• Web Source
• Paper Layout
• Paper Design
• Paper Parameter Form
......................................................................................................................................................
3-18 Oracle9i Reports Developer: Build Reports
Navigating Around the Oracle9i Reports Main Menu
.....................................................................................................................................................
You can create many fully functional paper reports simply by using the Wizard and
modifying the report in the Paper Design view. However, this course also teaches you
in later lessons how to use the Data Model, Paper Layout, and Paper Parameter Form
so that you can create more complex paper reports. You will also learn how to use the
Web Source view to add dynamic content to HTML pages to create reports for Web
publishing.
Technical Note
Oracle9i Reports has been integrated with Oracle9i JDeveloper to enable Java
developers to leverage the powerful publishing capabilities of Oracle9i Reports within
their Java applications. You can create a new JSP-based Web report or a Pluggable
Destination from within Oracle9i JDeveloper. You can also debug a Reports JSP from
within JDeveloper. For more information, see the Oracle Technology Network (http://
otn.oracle.com).
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-19
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
......................................................................................................................................................
3-20 Oracle9i Reports Developer: Build Reports
Navigating Around the Oracle9i Reports Main Menu
.....................................................................................................................................................
Syntax Palette
The Syntax Palette is a programming tool that enables you to display and copy the
constructs of PL/SQL language elements and built-in packages into the PL/SQL
editor.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-21
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Object Navigator
Report-Level Objects
• Properties
• Triggers
• PL/SQL Program Units
• Attached Libraries
......................................................................................................................................................
3-22 Oracle9i Reports Developer: Build Reports
Object Categories
.....................................................................................................................................................
Object Categories
Introduction
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.
Report-Level Objects
The report objects define the measurements, dimensions, triggers, and PL/SQL
program units of a report. The report object itself consists of the following:
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
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-23
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
• Parameters
• Queries
• Groups
• Columns
• Data Links
......................................................................................................................................................
3-24 Oracle9i Reports Developer: Build Reports
Object Categories
.....................................................................................................................................................
With the exception of parameters, you create all objects in the relevant editor, not in
the Object Navigator.
Parameters do not appear in the editor. You create and modify parameters in the
Object Navigator only.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-25
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
• Frames
• Repeating frames
• Fields
• Boilerplate
Instructor Note
When you expand the Paper Layout node in the Object Navigator, you see the report
sections. This will be discussed in detail later in the course. For now, tell the students
that you can define up to three sections (Header, Main, and Trailer) each with a Body
and Margin area. Report sectioning enables you to define multiple layouts in the same
report, each with a different target audience and output format. By default, a report
layout is created in the main section.
......................................................................................................................................................
3-26 Oracle9i Reports Developer: Build Reports
Object Categories
.....................................................................................................................................................
These and other layout objects are discussed later in the course.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-27
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
• Fields
• Boilerplate
......................................................................................................................................................
3-28 Oracle9i Reports Developer: Build Reports
Object Categories
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-29
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
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.
......................................................................................................................................................
3-30 Oracle9i Reports Developer: Build Reports
Object Categories
.....................................................................................................................................................
Object Relationships
Now that you know the different categories of objects, it is also important to
understand the relationship between these objects. The diagram opposite shows the
relationships between some of the most common objects, explained in terms of a
simple tabular report.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-31
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
1 2
......................................................................................................................................................
3-32 Oracle9i Reports Developer: Build Reports
Customizing Your Oracle9i Reports Session
.....................................................................................................................................................
Report Preferences
There are four tab pages in the Reports Preferences dialog box. Press the Help key
([F1] in Windows NT) 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 Measurement Set the unit of measurement that you want to use for
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-33
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
• REPORTS_PATH
• REPORTS_TMP
• REPORTS_RESOURCE
• ORACLE_PATH
Windows: Modify in Registry
......................................................................................................................................................
3-34 Oracle9i Reports Developer: Build Reports
Oracle9i Reports Environment Variables
.....................................................................................................................................................
Setting Pathnames
Oracle9i Reports uses some environment variables to search for files at run time. This
enables you to build applications that are portable across platforms and directory
structures by avoiding hard-coded paths in file references in a report.
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
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-35
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
......................................................................................................................................................
3-36 Oracle9i Reports Developer: Build Reports
Reports Builder Help Options
.....................................................................................................................................................
Technical Note
In Oracle9i Reports Builder 9.0.2.0.1, ‘Quick Tour’ is the option in the Help menu. In
future releases, this option will be changed to ‘Getting Started with Oracle9i Reports’.
The Oracle9i Reports online Help system is also accessible through the Oracle
Technology Network (http://otn.oracle.com).
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-37
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Summary
......................................................................................................................................................
3-38 Oracle9i Reports Developer: Build Reports
Summary
.....................................................................................................................................................
Summary
Oracle9i 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-39
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
Practice 3 Overview
......................................................................................................................................................
3-40 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 3
.....................................................................................................................................................
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 Reports executables.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 3-41
Lesson 3: Working in Oracle9i Reports Developer
.....................................................................................................................................................
b What is RWCLIENT?
......................................................................................................................................................
3-42 Oracle9i Reports Developer: Build Reports
4
................................
Objectives
Instructor Note
Topic Timing
Lecture 60 minutes
Practice 60 minutes
Total 120 minutes
......................................................................................................................................................
4-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
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.
Oracle9i Reports enables you to easily model, design, and publish high fidelity Web
reports. You will learn about this in a later lesson.
Objectives
After completing this lesson, you should be able to do the following:
• Create a simple tabular report using the Report Wizard
• Describe the different methods of building the report query
• Summarize report values
• Modify the style and content of a report by reentering the Wizard
• Create other report styles available in the Report Wizard
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-3
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
• Data Model
• Web Source
• Paper Layout
• Paper Parameter Form
• Program Units
......................................................................................................................................................
4-4 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-5
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Instructor Note
Invoke Reports Builder to show the Wizard at this stage. You might need to close
Reports Builder at the end of the previous lesson. (Later you show the students how to
create a new report using the Wizard when Reports Builder is already open.)
Demonstration:
1 Create a tabular report with a Web and paper layout.
2 Use Query Builder, and base the query on the EMPLOYEES table:
FIRST_NAME, LAST_NAME, JOB_ID, SALARY, DEPARTMENT_ID.
3 Display all fields and reorder some, such as SALARY before JOB_ID.
4 Create a total for SALARY.
5 Change some column labels and reduce widths, such as:
DEPARTMENT_ID: Label=Dept, Width=4
SALARY: Width=6
TOTAL: Width=6
......................................................................................................................................................
4-6 Oracle9i Reports Developer: Build Reports
Invoking Reports Builder and the Report Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-7
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Wizard Pages
• Report Style
• Data Source
Type
• Data Source
Definition
• Fields
• Totals
• Labels
• Template
......................................................................................................................................................
4-8 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
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 report.
Type
Data Source Define the data you want to retrieve for your report.
Definition
Fields Select the fields that you want to display in the output.
Totals Select the fields that you want to summarize.
Labels Alter the labels that appear for each field and the width of each field.
Template Select the template that you want to use for this paper report. A template
contains formatting information and can also contain standard information
such as company logo, date, and so on.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-9
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
......................................................................................................................................................
4-10 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-11
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Building a Query
......................................................................................................................................................
4-12 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-13
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
1 2 3 4
......................................................................................................................................................
4-14 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-15
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
......................................................................................................................................................
4-16 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-17
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
......................................................................................................................................................
4-18 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
Totals Standard SQL aggregate functions are provided for creating totals in your
report. If you choose a total, the Wizard creates the total at each level of the report; that
is, at report level and also at each break level, if your report contains break groups.
You can clear some of these totals later (by reentering the Wizard) if, for example, you
want a report-level total only.
Labels The field label is displayed on one or more lines in the report output. In a
tabular report, the labels appear above the field values.
• If the initial label is wider than the field, Reports Builder allows enough space for
the label, or displays it on multiple lines.
• If you increase the number of characters in the label text in the reentrant Wizard,
the label can appear truncated in the report output.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-19
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
......................................................................................................................................................
4-20 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-21
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
1 Magnify tool
2 Page buttons
......................................................................................................................................................
4-22 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-23
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
xxx.rdf yyy.rdf
......................................................................................................................................................
4-24 Oracle9i Reports Developer: Build Reports
Creating a Tabular Report Using the Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-25
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Instructor Note
Demonstration:
Select Tools > Report Wizard (show the right-mouse-button option also).
On the Style tab, select Form.
Click Finish and explain the output that you see in the Paper Design view: labels to
left; each record on a new page.
In the Paper Design, also show that the page buttons are now available for the
multiple-page report. You might also want to demonstrate opening a new Paper Design
window and displaying different pages in each.
Caution: When you demonstrate the Form report, you must create a new report before
demonstrating the other styles, because Reports retains the page break for each record
and you should avoid confusing students with the Property Inspector at this stage.
The bulleted points opposite may provide useful review questions later in the course.
......................................................................................................................................................
4-26 Oracle9i Reports Developer: Build Reports
Creating Other Report Styles
.....................................................................................................................................................
Tabbed Pages
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-27
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
2 1
1 Reports node
2 Create object button
Instructor Note
Demonstration
Create a new report and show the group styles:
1. Select the Reports node; select Create in the vertical toolbar.
2. Select Create Paper Layout only. Select Group Left style.
3. In Query Builder, include DEPARTMENTS and EMPLOYEES. Select columns:
DEPARTMENTS: DEPARTMENT_NAME
EMPLOYEES: LAST_NAME, JOB_ID, SALARY
4. Edit the query to remove the join clause linking manager_id to manager_id.
5. In the Groups page, select DEPARTMENT_NAME.
6. In the Fields page, reorder JOB_ID and SALARY.
7. Include a summary of SALARY. Complete the Wizard pages.
8. Reenter the Wizard and change style to Group Above.
9. Click the Groups tab. Select JOB_ID to create a Level 2 group.
10. Click the Fields tab and show how summary fields have been automatically
created for subtotals as well as report total.
11. Click Finish. Point out the differences in the output: position of groups and labels.
......................................................................................................................................................
4-28 Oracle9i Reports Developer: Build Reports
Creating Other Report Styles
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-29
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Group Left
Group Above
Location Id xxxx
Department Name xxxxxx
Last Name Job Id
xxxx xxxxx
xxxxxxx xxxx
......................................................................................................................................................
4-30 Oracle9i Reports Developer: Build Reports
Creating Other Report Styles
.....................................................................................................................................................
Group Left The output is displayed as columns across the page, with the groups
next to each other.
All labels appear above the fields.
Group Above The output is displayed with the groups below each other nested
within the parent group. The labels for all master groups appear to the side of the
fields.
Labels for the bottom detail groups appear above the fields, as in a tabular report.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-31
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Wizard pages:
• Style
• Data
• Text
• Template
Instructor Note
Demonstration:
Reenter the Wizard. Change the style to Mailing Label.
Modify the query; add an ORDER BY clause: ORDER BY
EMPLOYEES.LAST_NAME. This allows you to show the print direction of the
records (across, then down). Do not try to change the direction here; this is discussed
later when modifying layout objects.
In the Text tab, select LAST_NAME, DEPARTMENT_NAME, and SALARY.
Do not select JOB_ID. This shows that you do not have to display all columns in your
mailing label text.
Finish and run. Reenter the Wizard and change the style to Form Letter.
Modify the text to include constant text; for example:
The employee &<LAST_NAME> works for the &<DEPARTMENT_NAME>
department and earns a salary of &<SALARY> dollars.
Click Finish and show the output.
Caution: Demonstrate Mailing Labels before Form Letter; otherwise each mailing
label is displayed on a separate page.
......................................................................................................................................................
4-32 Oracle9i Reports Developer: Build Reports
Creating Other Report Styles
.....................................................................................................................................................
The optional angled brackets allow you to display two variables side by side with no
separating space.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-33
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Instructor Note
Demonstration:
Create a new report using the Wizard. Create both a Web and paper layout. Select the
Matrix style.
Query: In Query Builder, select Import SQL Query. Select les04.sql.
Rows: CITY. Columns: JOB_ID. Cell: SALARY select Sum >.
Totals: SUMSALARY - select Sum >. (Caution: Select SUMSALARY).
Change the width of the summary fields to 6.
Click Finish and show output. Note that there are several physical page widths. Point
out that the Report Wizard tab pages for Rows, Columns, and Cell correspond to the
across, down, and body components of the matrix report.
Now run the Web layout, noting that the Web is not restricted by physical page size.
Reenter the Wizard. Select the Rows tab. Add DEPARTMENT_NAME as Level 2.
Click Finish and show output. Note that all departments are displayed for every city
even if there is no applicable value. This is a nested matrix.
Reenter the Wizard. Change the report style to Matrix with Group.
Select Rows. Select CITY and return it to Available Fields list.
Select Groups. Move CITY to Matrix Group Fields.
Make sure all the summary fields have a width of 6.
Click Finish and show difference in output. Note that only the relevant departments
and JOB_IDs are displayed for each city.
......................................................................................................................................................
4-34 Oracle9i Reports Developer: Build Reports
Creating Other Report Styles
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-35
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
......................................................................................................................................................
4-36 Oracle9i Reports Developer: Build Reports
Previewing a Paper Report in a Web Browser
.....................................................................................................................................................
Using Bookmarks
If you have used a break style for your paper report, you have the option of creating an
outline for navigation, or bookmark, within your paginated HTML or PDF report,
using the break column.
1 Select Insert > Bookmark.
Note: This menu option is enabled for the Paper Design and Paper Layout views
only.
2 Select a column from the Available Columns list.
3 Click > to display in the Bookmark area.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-37
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Summary
......................................................................................................................................................
4-38 Oracle9i Reports Developer: Build Reports
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-39
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
Practice 4 Overview
......................................................................................................................................................
4-40 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 4
.....................................................................................................................................................
Introduction
The questions in the practice session are intended to ensure that you have a good
understanding of how to create various styles of reports using the Report Wizard.
Note: When you are completing the practice sessions, use the file naming conventions
that the questions specify. You may need these files in later practices.
In addition, note the field headings and widths. With many reports, you need to change
these to achieve the desired result.
Many of the practice sessions ask you to rename files. Be sure to use Save As, not
Save, so that you do not overwrite the existing filename.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-41
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
......................................................................................................................................................
4-42 Oracle9i Reports Developer: Build Reports
Practice Session: Lesson 4
.....................................................................................................................................................
5 Using the reentrant Wizard, modify the report to create a Form Letter style.
Modify the query to include order information for each customer:
a
select c.cust_first_name || c.cust_last_name Name,
c.cust_address, o.order_id, o.order_total
from customers c, orders o
where c.customer_id = o.customer_id
This query text is available in the file p4q5.sql.
b In the text area, enter some free-flowing text for each order. For example:
Order No. &<ORDER_ID> has been shipped to &<NAME> in &<C_CITY>.
The order has a total value of &<ORDER_TOTAL> dollars.
Thank you for your business.
c Select a different template and click Finish.
d Save the report as p4q5.rdf.
6 Create a new report.
a Create both a Web and paper layout. Select the matrix report style.
b For the query, import the contents of p4q6.sql.
c Display customer names down the left side of the page.
d Display product numbers across the top of the page
e Display the total value in the cells.
f Create a summary to give the total of the sum(total_value) values.
g Change the width of all four summaries to 4. Change the PRODUCT_ID label
to Product. Remove the label for sumTOTAL_VALUE.
h Select any template and click Finish to preview your report.
i Save the report to a file named p4q6.jsp.
7 Modify the matrix report to create a Matrix with Group.
a Select Month as the group and check that all totals have a width of 7.
b Click Finish to preview your report and save the report as p4q7.jsp.
Note: The query for the matrix reports above has been restricted to display only
products beginning with “1,” so that you can see and understand the complete matrix
more easily.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 4-43
Lesson 4: Creating a Paper Report
.....................................................................................................................................................
......................................................................................................................................................
4-44 Oracle9i Reports Developer: Build Reports
5
................................
Enhancing a Basic
Paper Report
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Objectives
Instructor Note
Topic Timing
Lecture 45 minutes
Practice 30 minutes
Total 75 minutes
......................................................................................................................................................
5-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
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.
Objectives
After completing this lesson, you should be able to do the following:
• Describe the report Paper Design view
• Modify the display of report data in the Paper Design view
• Modify the positioning of report data in the Paper Design view
• Highlight data using conditional formatting
• Add page numbering and the current date to a report
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-3
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
......................................................................................................................................................
5-4 Oracle9i Reports Developer: Build Reports
What Is the Paper Design View?
.....................................................................................................................................................
Saving Reports
Save your report definition often, using the Save icon on the toolbar or the Save or
Save As options on the File menu, to preserve the changes that you make in the Paper
Design view.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-5
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Modifying a Report
Common modifications:
• Align columns
• Set format masks
• Manipulate objects
• Edit text
• Modify visual attributes
• Highlight data using conditional formats
• Insert page numbers and current date
......................................................................................................................................................
5-6 Oracle9i Reports Developer: Build Reports
Modifying a Report in the Paper Design View
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-7
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Aligning Columns
Instructor Note
Demonstration:
Create a tabular report, paper layout only:
Use the EMPLOYEES table. Select columns LAST_NAME, JOB_ID, and SALARY.
Include JOB_ID so that you have an extra column to clear (delete) later. Change the
width of Salary to 6.
......................................................................................................................................................
5-8 Oracle9i Reports Developer: Build Reports
Modifying a Report in the Paper Design View
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-9
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
1 2 3 4 5
Instructor Note
Demonstration:
Continue with the report used previously. Add currency sign, thousand separator, and
two decimal places to the Salary column.
If students know about number format masks and ask for specific information, tell
them that Reports Builder formats the number using the L, G, and D local currency
elements in the format mask. You can discuss this in detail in a later lesson when you
demonstrate modifying properties in the property inspector.
......................................................................................................................................................
5-10 Oracle9i Reports Developer: Build Reports
Modifying a Report in the Paper Design View
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-11
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Manipulating Objects
• Clear fields
• Move fields
• Resize fields
Instructor Note
Demonstration:
Continue with the same report.
Resize, move, and clear one of the columns displayed.
Show the Flex Mode tool. With Flex Mode enabled, try to move a column. Disable
Flex Mode and again try to move a column.
Also point out that you can change the interrecord spacing by dragging the second or
subsequent records.
......................................................................................................................................................
5-12 Oracle9i Reports Developer: Build Reports
Modifying a Report in the Paper Design View
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-13
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Instructor Note
Demonstration:
Continue with the same report.
Change the font of one field.
Change the text of a label. For example, change Last Name to Name.
Show how to use the icons to set fill, patterns, and colors. Add a fill, pattern, and color
to the label area, showing how to use the Parent Frame tool.
......................................................................................................................................................
5-14 Oracle9i Reports Developer: Build Reports
Modifying a Report in the Paper Design View
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-15
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Instructor Note
When you apply conditional formats, Reports Builder creates a format trigger that you
can enhance, if necessary.
Demonstration:
Continue with the same report.
Change the appearance of a column based on multiple conditions; for example, change
the font color of the Salary column to red if the value is greater than 10,000 and to blue
if the value is lower than 5,000. Show the format trigger on the Salary column.
......................................................................................................................................................
5-16 Oracle9i Reports Developer: Build Reports
Modifying a Report in the Paper Design View
.....................................................................................................................................................
Conditional Formatting
You can highlight or suppress objects using conditional formats.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-17
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
• Inserted easily
• Customizable extensions
Instructor Note
Using the same report, add page numbers and the date. Point out that many of the
predefined paper templates already add these features to your reports.
Mention that you can add extra date format masks to your preferences.
Show how to customize date extensions to include the time. However, it is much
easier to use the list of examples that shows the current date. The default preferences
file (cagprefs.ora) provides a large list.
The Property Inspector is not used in this lesson because there is so much basic
functionality to discuss in the Paper Design view. If students ask, you can modify the
date after you create it. Double-click the date object to open the Property Inspector.
The Format Mask property is in the Field region.
......................................................................................................................................................
5-18 Oracle9i Reports Developer: Build Reports
Modifying a Report in the Paper Design View
.....................................................................................................................................................
Date and Time Format Masks 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-19
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Customizing Dates
......................................................................................................................................................
5-20 Oracle9i Reports Developer: Build Reports
Modifying a Report in the Paper Design View
.....................................................................................................................................................
Customizing the Date and Time Format 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 Help system fully describes the format mask syntax. Select
Help > Find > Date Syntax, and select Date and Time Format Mask Syntax from the
list of topics.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-21
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Summary
......................................................................................................................................................
5-22 Oracle9i Reports Developer: Build Reports
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-23
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
Practice 5 Overview
......................................................................................................................................................
5-24 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 5
.....................................................................................................................................................
Introduction
In this practice session, you will reuse some of the reports that you created in the last
session.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-25
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
......................................................................................................................................................
5-26 Oracle9i Reports Developer: Build Reports
Practice Session: Lesson 5
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 5-27
Lesson 5: Enhancing a Basic Paper Report
.....................................................................................................................................................
......................................................................................................................................................
5-28 Oracle9i Reports Developer: Build Reports
6
................................
Managing Report
Templates
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Objectives
Instructor Note
Topic Timing
Lecture 45 minutes
Practice 40 minutes
Total 85 minutes
......................................................................................................................................................
6-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
In this lesson, you learn how to open and modify predefined Oracle9i Reports paper
templates and how to register a customized template in the predefined template list.
Objectives
After completing this lesson, you should be able to do the following:
• Describe the template regions
• Describe the difference between default and override template sections
• Modify a predefined paper report template
• Register a customized template in the predefined template list
• Apply an HTML header to a paper template
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-3
Lesson 6: Managing Report Templates
.....................................................................................................................................................
......................................................................................................................................................
6-4 Oracle9i Reports Developer: Build Reports
Using the Report Templates
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-5
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Modifying a Template
Margin Body
Instructor Note
Open a predefined template file from the template directory:
<oracle_home>\reports\templates. Save it as another name in your home
directory.
Show the following nodes in the Object Navigator: Body, Margin. Show the
corresponding button in the Template Editor view, and make sure you are in the Body
region.
Expand the Body node to show Default and Override. (There is a demonstration on a
later page).
In the Template Editor, you can switch the style in the pop-up list, Group Left, Matrix,
and so on, to show the different layouts for different styles.
......................................................................................................................................................
6-6 Oracle9i Reports Developer: Build Reports
Modifying a Template
.....................................................................................................................................................
Modifying a Template
Introduction
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-7
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Include
objects
such as:
• Images
• Text
• Page
Numbers
• Date
Instructor Note
Demonstration:
1 In the Template Editor, change to the margin region and insert an image into the
template margin.
2 Add a report title.
3 Insert a date.
Note: If you create a report using a template, rwblue, and then modify rwblue, the
report does not automatically inherit the changes unless you reapply the template
through the Report Wizard. When you apply a template to a report, the objects and
defintions of the template are physically copied into the report module defintion.
......................................................................................................................................................
6-8 Oracle9i Reports Developer: Build Reports
Modifying a Template
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-9
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Instructor Note
Demonstration:
Using the same template:
1 In the Default section, change the solid color fill on the field labels on the
template.
2 For Group Left only, change the font style to italic for the master fields (section
level 1).
3 Save the template.
4 In the Report Wizard, create a simple report that provides a break:
SELECT JOB_ID, LAST_NAME, SALARY FROM EMPLOYEES.
5 Select Group Above, group by JOB_ID, and apply your new template. Show how
to browse the directory for the template file.
6 Reenter the Wizard and change the style to Group Left. Show the different color
labels.
7 If you have time, apply this new template to an existing report. Only some changes
occur.
......................................................................................................................................................
6-10 Oracle9i Reports Developer: Build Reports
Modifying a Template
.....................................................................................................................................................
Reapplying a Template
If you reenter the Report Wizard and reapply the template in the Template tab, Reports
Builder reapplies the template background and margin objects to your report.
The report retains any live changes you made to the body, such as modifying the font
or color of text or fields.
Technical Note
You can also create Web layout templates. For more information, refer to the Oracle9i
Reports Technical Note How to Create a Web Layout Template on the Oracle
Technology Network (http://otn.oracle.com).
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-11
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Instructor Note
Adding Web links to a template definition for report HTML output does exist in
Oracle9i Reports. However, publishing paper reports on the Web in HTML conflicts
with the one of the key features and messages of this release: publishing true Web
reports using JSP technology. Emphasize this rather than the ability to push paper
reports onto the Web.
If asked, you can demonstrate Web links:
• Use l6weblink.rdf. Run the paper layout to show the output.
• Open the Property Inspector for the report and show the Before Report Type and
Before Report Value properties. These values add an HTML header document to
the report. The header document contains two links.
• The HTML output has already been generated for you. Start your browser and
open l6weblink.htm. Test the Web links.
......................................................................................................................................................
6-12 Oracle9i Reports Developer: Build Reports
Adding Web Links to a Template for Report HTML Output
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-13
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Reports.Tabular_Template_File =
(rwbeige, Reports.Tabular_Template_Desc =
rwblue, ("Beige",
mytemp, "Blue",
rwgray, "My Template Description",
rwgreen, "Gray",
rwpeach, "Green",
"Peach",
Instructor Note
Demonstration:
Open the cagprefs.ora file and show the entries that define different template
files and the descriptions that appear in the predefined list.
Modify one or more entries to include your modified template file.
If your setup allows you to modify the installation directories, copy your template to
the template directory.
......................................................................................................................................................
6-14 Oracle9i Reports Developer: Build Reports
Predefining Your Own Templates
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-15
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Instructor Note
Demonstration:
Show the .bmp files in the template directory.
The .bmp files in the installed templates show data from the simple Oracle
demonstration tables EMP and DEPT in the SCOTT/TIGER schema.
......................................................................................................................................................
6-16 Oracle9i Reports Developer: Build Reports
Predefining Your Own Templates
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-17
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Summary
......................................................................................................................................................
6-18 Oracle9i Reports Developer: Build Reports
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-19
Lesson 6: Managing Report Templates
.....................................................................................................................................................
Practice 6 Overview
......................................................................................................................................................
6-20 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 6
.....................................................................................................................................................
Introduction
In this practice session, you open an existing template, which is one of the standard
templates shipped with the Oracle9i Reports Developer 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.
Instructor Note
The practice does not include modifying the preferences file to register a predefined
template. You can suggest that students do so, if you have time and if your class setup
allows students to modify the preference file and to write to the
<ORACLE_HOME>\reports\templates directory.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-21
Lesson 6: Managing Report Templates
.....................................................................................................................................................
......................................................................................................................................................
6-22 Oracle9i Reports Developer: Build Reports
Practice Session: Lesson 6
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 6-23
Lesson 6: Managing Report Templates
.....................................................................................................................................................
......................................................................................................................................................
6-24 Oracle9i Reports Developer: Build Reports
7
................................
Objectives
Instructor Note
Topic Timing
Lecture 45 minutes
Practice 30 minutes
Total 75 minutes
......................................................................................................................................................
7-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
Oracle9i 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), Oracle9i Reports takes advantage of JavaServer Page (JSP) technology to
deliver high quality HTML pages for Web publishing.
In this lesson, you will be 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.
Objectives
After completing this lesson, you should be able to do the following:
• Describe JavaServer Page technology and list some of its advantages
• List the options for building a Web report
• Create a Web report using the Report Wizard
• Examine the source code for your Web report using the Web Source view of the
Report Editor
• Preview a report on the Web
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-3
Lesson 7: Creating a Web Report
.....................................................................................................................................................
JSP Advantages
......................................................................................................................................................
7-4 Oracle9i Reports Developer: Build Reports
JavaServer Page (JSP) Technology
.....................................................................................................................................................
Technical Note
For more information about JSP technology, see the JavaSoft Web site at http://
www.javasoft.com/products/jsp/.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-5
Lesson 7: Creating a Web Report
.....................................................................................................................................................
<HTML>
<HEAD><TITLE>Simple JSP Example</TITLE></HEAD>
<BODY>
Welcome to my page!!
Current time is :
<%= new java.util.Date() %>
</BODY>
</HTML>
......................................................................................................................................................
7-6 Oracle9i Reports Developer: Build Reports
JavaServer Page (JSP) Technology
.....................................................................................................................................................
JSP Example
Before you learn about Reports JSPs, let’s look at a very basic JSP example.
This is the source code for a JSP that prints out a greeting and the current date:
<HTML>
<HEAD><TITLE>Simple JSP Example</TITLE></HEAD>
<BODY>
Welcome to my page!!
Current time is:
<%=new java.util.Date()%>
</BODY>
</HTML>
• The first five lines of code are standard HTML code, defining the title and start of
the body of the page.
• The line that follows prints the date and time using a Java expression between the
<%= and %> tags. This expression creates a new instance of the java.util.Date type,
which is set to the current time when the object executes.
• The object is then translated into a string and returned to the browser.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-7
Lesson 7: Creating a Web Report
.....................................................................................................................................................
Two Options:
• Open an existing HTML page in Reports Builder
• Use one of the predefined HTML templates shipped
with Oracle9i Reports Developer
......................................................................................................................................................
7-8 Oracle9i Reports Developer: Build Reports
Creating a Web Report Using the Report Wizard
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-9
Lesson 7: Creating a Web Report
.....................................................................................................................................................
Reports JSP
Custom Tag
Library
Start of report
HTML template
information
Data model
information
End of report
Instructor Note
Demonstration: Show the standard and custom JSP tags that Reports Builder provides
for each report module.
• Create a new report
• Select Build a new report manually
• Invoke the Web Source view of the Report Editor
Point out the structure of a Reports JSP. Indicate the place holders in the JSP that will
be populated by the Report Wizard. Differentiate between standard JSP tags and
Reports custom JSP tags.
......................................................................................................................................................
7-10 Oracle9i Reports Developer: Build Reports
Web Source View
.....................................................................................................................................................
JSP Tags
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 Oracle9i Reports to
facilitate the development of Reports JavaServer Pages. These tags provide scripting
shortcuts that hide the intricacies involved in querying data from the respective data
sources, access to the data model break group cursors, and retrieve and format data
from report columns and parameters.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-11
Lesson 7: Creating a Web Report
.....................................................................................................................................................
JSP Tags
......................................................................................................................................................
7-12 Oracle9i Reports Developer: Build Reports
Web Source View
.....................................................................................................................................................
Technical Note
For a complete list of Reports custom JSP tags, consult the online Help system.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-13
Lesson 7: Creating a Web Report
.....................................................................................................................................................
Instructor Note
Demonstration: Create a new report and select the option Create both Web and Paper
layout. The purpose of this demonstration is to show what the Report Wizard creates
in the Web source.
Use the EMPLOYEES table and select columns FIRST_NAME, LAST_NAME,
EMAIL, and HIRE_DATE.
Display the Web Source view, showing the different options for invoking the view.
In the Web Source view, point out the code that was generated by the Wizard in the
place holder areas, specifically the HTML template (rw:style) and report body
(rw:dataArea). Note that data source and layout information is hidden in the Builder;
it is delimited by the rw:objects tag. To view the code in this section, save the report
module as a .jsp, and use a text editor (WordPad) to view the .jsp file. Note all
the additional information that can be viewed and edited in a text editor.
Test your report in the browser by selecting the Run Web Layout button.
Continue with the same report. Reenter the Wizard and add the SALARY column to
the query. Display this column in the output, and include the average of SALARY.
Invoke the Web Source view and examine the data area, pointing out the additional
column in the query, as well as the report level summary.
Display the Web report in your browser.
......................................................................................................................................................
7-14 Oracle9i Reports Developer: Build Reports
Web Source View
.....................................................................................................................................................
Example
The Web Source on the previous page 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.
Technical Note
A Reports JSP contains the full definition of your report module. However, Reports
Builder hides a good deal of the code in the Web Source view. You can view the
module, <module_name>.jsp, outside the Builder using a text editor and see
much more—data source, data links, layout, and so forth.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-15
Lesson 7: Creating a Web Report
.....................................................................................................................................................
Generating Output
Instructor Note
Explain the difference between this Web output and the output that is generated when
DESFORMAT = HTML or HTMLCSS. The underlying JSP technology in Oracle9i
Reports enables you to enhance Web pages with information retrieved using Reports
Builder.
DESFORMAT specifies the format for the job output. In bit-mapped environments,
DESFORMAT specifies the printer driver to be used when DESTYPE is FILE. In
character-mode environments, it specifies the characteristics of the printer named in
DESNAME.
......................................................................................................................................................
7-16 Oracle9i Reports Developer: Build Reports
Generating Output
.....................................................................................................................................................
Generating Output
Testing a Web Report
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
Technical Note
More information on publishing Web reports is covered in the eClass Oracle9i Reports
Services: Deploy Internet Reports. Also see the manual Oracle9iAS Application
Server: Publish Reports to the Web with Oracle9iAS Reports Services.
More information on using Oracle9iAS Portal for administering and publishing
reports is covered in the eClass Oracle9i Reports: Create Reports for the Web and
Portals.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-17
Lesson 7: Creating a Web Report
.....................................................................................................................................................
Summary
......................................................................................................................................................
7-18 Oracle9i Reports Developer: Build Reports
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
Oracle9i 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-19
Lesson 7: Creating a Web Report
.....................................................................................................................................................
Practice 7 Overview
......................................................................................................................................................
7-20 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 7
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 7-21
Lesson 7: Creating a Web Report
.....................................................................................................................................................
......................................................................................................................................................
7-22 Oracle9i Reports Developer: Build Reports
8
................................
Enhancing Reports
Using the Data Model:
Queries and Groups
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Objectives
Instructor Note
Topic Timing
Lecture 40 minutes
Practice 20 minutes
Total 60 minutes
......................................................................................................................................................
8-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
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.
Objectives
After completing this lesson, you should be able to do the following:
• Describe the Data Model objects and their relationship
• Modify query properties
• Modify the report hierarchy by creating additional groups
• Change the order of data in a group
• Eliminate data from the report using a group filter
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-3
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Instructor Note
Open a report definition that contains a tabular report (l8demo1.jsp).
In the Object Navigator, show the Data Model node, including parameter nodes.
Show the Data Model and briefly describe the query, group, and columns that the
Report Wizard created.
Open a Group Left or Group Above report (example: l4above.jsp) and show the
additional groups in the Data Model editor. Explain the hierarchy.
Explain how to modify the existing query and create the extra group using the Data
Model instead of the Report Wizard. Obviously, if you can use the Report Wizard, it is
the simplest method, but sometimes, especially in more complex reports, you need to
be able to modify the Data Model. Oracle9i Reports has a Data Wizard that enables
you to modify multiple query reports more easily.
......................................................................................................................................................
8-4 Oracle9i Reports Developer: Build Reports
Describing the Report Data Model
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-5
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Instructor Note
Demonstration:
Use l8demo1.jsp.
With Data Model open, double-click Q_1 to open the SQL Query Statement dialog
box. Type E.FIRST_NAME before D.DEPARTMENT_NAME. Click OK to close the
Query dialog box and show how the FIRST_NAME column is added to the top of the
group, not in the same position as in the statement. All new columns are added as the
first column in the group.
Edit the statement again. Concatenate FIRST_NAME||’ ’||LAST_NAME and add an
alias EMPLOYEE.
Show EMPLOYEE at the top of the group. Point out the use of the meaningful column
alias. Drag this column down above JOB_ID.
Also point out that if the query contains duplicate column names, Reports Builder
appends a number to make the report column name unique. You can use column
aliases to give these columns more meaningful names.
......................................................................................................................................................
8-6 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Query
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-7
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
M
......................................................................................................................................................
8-8 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Query
.....................................................................................................................................................
Modifying Columns If you add to, rename, or delete a column or expression in the
query statement, Oracle9i Reports automatically creates, revises, or deletes the
corresponding column in the Data Model.
Using Column and Table Aliases Remember that you can use aliases against the
database columns and tables in the query. Report Builder uses your column aliases to
create the relevant report column names. Table aliases help your query access the
database and return data as quickly as possible. Aliases therefore provide:
• Fast database access and return of data
• Shorter, more meaningful names for query expressions, such as Employee and
Annual_Salary as in this example:
SELECT d.department_id, d.department_name, e.job_id,
e.first_name ||’ ‘||e.last_name Employee,
e.salary*12 Annual_Salary
FROM employees e, departments d
WHERE e.department_id = d.department_id
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-9
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
More Properties
Instructor Note
Continue demonstration:
Rename the query Q_EMP. Note that this does not rename the group.
Add a comment to the query. Show each method, either in the Comment property or
the Query statement, but recommend that the students use one or other, not both.
Run the report with no other changes. In the Paper Design view, LAST_NAME
appears crossed out because you altered the query and there is no longer a
LAST_NAME column. This is the original layout based on the previous Data Model,
so you must update the layout (on the next page).
......................................................................................................................................................
8-10 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Query
.....................................................................................................................................................
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.
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-11
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Applying Changes
Instructor Note
Select the Report Wizard from the menu.
Go to the Fields tab and select all fields. Click Finish. Show the Employee field in the
Paper Design view.
The Report Wizard removes all existing layout objects and re-creates the layout with
new information from the Data Model.
......................................................................................................................................................
8-12 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Query
.....................................................................................................................................................
Instructor Note
When you reenter the Report Wizard for a Web report, Oracle9i Reports deletes the
entire Web layout even though it appears that the previous selections are still in tact. If
you do reenter the Wizard to modify a Web report, you will have to navigate through
each of the tab pages and reselect the desired options on each page.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-13
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Groups
Instructor Note
Demonstration:
In the Data Model, show how to rename the group G_EMP.
Double-click the group bar to display the Property Inspector.
Also show that you can change the name in the Object Navigator.
......................................................................................................................................................
8-14 Oracle9i Reports Developer: Build Reports
Changing the Group Structure
.....................................................................................................................................................
Developer-Created Groups
Sometimes you do not want to modify existing Data Model objects in the Report
Wizard; for example, during later maintenance. In this case, you might need to create
your own groups in the Data Model to perform the following actions:
• Produce control break (nested) reports
• Produce complex matrix reports
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-15
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Group Hierarchy
Instructor Note
Demonstration:
Use [Shift]-click to select and drag DEPARTMENT_ID and DEPARTMENT_NAME
up out of G_EMP to create a new group. Rename it G_DEPT.
Select Report Wizard from the toolbar to update the layout. Select the Group Above
style. Show the Group tab. DEPARTMENT_ID and DEPARTMENT_NAME are
selected because you dragged them into the new group. You can modify the group
fields at any time by reentering the Report Wizard.
Reports Builder updates the Wizard information based on the changes you make in the
Data Model. Reports Builder also updates the Data Model with any changes that you
make in the reentrant wizards.
The default position of the objects in the Paper Design view depends on the query,
group, and column positions in the Data Model.
......................................................................................................................................................
8-16 Oracle9i Reports Developer: Build Reports
The Group Hierarchy
.....................................................................................................................................................
One-Level Limit
When you drag a column to create a new group, the new group is only one level above
or below the column’s original group in the hierarchy.
To create a group more than one level from the original group, follow these steps:
1 Move the column to the level immediately above or below the required position of
the new group.
2 Drag the column out to create the new group at the next level.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-17
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
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
Instructor Note
Demonstration:
Edit the query Q_EMP. Order by E.SALARY.
Run the report and show that the order of departments remains the same (ascending
numeric order of DEPARTMENT_ID); it is only each individual list of employees that
is sorted by salary within the department.
In the Data Model, show the two arrowheads beside DEPARTMENT_ID and
DEPARTMENT_NAME. Drag DEPARTMENT_NAME above DEPARTMENT_ID.
Do not update the layout; you still want DEPARTMENT_ID to be the first field on the
left.
Run the report. Show the different order; ascending alphabetical order of department
name. The break order for the first column takes precedence over the other columns,
from top to bottom in the group.
Open the Property Inspector for DEPARTMENT_ID (department number). Remove
the break (Break Order = None). Run the report. It sorts by DEPARTMENT_NAME
ascending.
Open the Property Inspector for DEPARTMENT_NAME and change the break to
Descending.
......................................................................................................................................................
8-18 Oracle9i Reports Developer: Build Reports
Ordering Data in a Group Hierarchy
.....................................................................................................................................................
Break Order
Break order controls the break structure and the order in which to display the column’s
values. It is denoted by a solid arrowhead to the left of the column. For column values
in user-created groups, you must use the Break Order property to specify how to order
the break column’s values. The order of precedence depends on the order of columns,
from the top down, in the group.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-19
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Query Modifications
Instructor Note
The Break Order property uses the positional column number (2) instead of the
column name to build the ORDER BY clause at run time. Reports Builder uses this
notation to allow for the use of aliases in the SELECT clause, which was invalid
syntax for an ORDER BY clause in previous database releases.
It is not recommended that students use this notation when they explicitly write their
own ORDER BY clauses in their SQL queries.
If you want to see the SQL query that Reports Builder sends to the server at run time,
create a trace file using the Program > Tracing option. Specify a filename, including
pathname if you want. Select Execution of SQL and any other options you require.
This is the only way to see the ORDER BY clause that Reports Builder builds
dynamically at run time.
......................................................................................................................................................
8-20 Oracle9i Reports Developer: Build Reports
Ordering Data in a Group Hierarchy
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-21
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Instructor Note
Demonstration: In the same report, restrict G_DEPT to the first two records.
......................................................................................................................................................
8-22 Oracle9i Reports Developer: Build Reports
Filtering Data in a Group
.....................................................................................................................................................
Identifying an Active Filter In the Data Model editor, the circle above the group
object changes to green when a filter is active.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-23
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Summary
......................................................................................................................................................
8-24 Oracle9i Reports Developer: Build Reports
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-25
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
Practice 8: Overview
......................................................................................................................................................
8-26 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 8
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 8-27
Lesson 8: Enhancing Reports Using the Data Model: Queries and Groups
.....................................................................................................................................................
......................................................................................................................................................
8-28 Oracle9i Reports Developer: Build Reports
9
................................
Objectives
Instructor Note
Topic Timing
Lecture 40 minutes
Practice 40 minutes
Total 80 minutes
......................................................................................................................................................
9-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
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 Oracle9i Reports and how to combine data from multiple sources to publish
meaningful information.
Objectives
After completing his lesson, you should be able to do the following:
• Describe the various data source types
• Create reports using pluggable data sources
• Create supplemental rows of data by adding queries
• Reuse PL/SQL code to create a REF cursor
• Link data from multiple data sources using a data link
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-3
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Instructor Note
With the implementation of PDSs, ODBC drivers are no longer supported in Oracle9i
Reports. The JDBC option can utilize the JDBC-ODBC bridge to allow access to other
data sources.
......................................................................................................................................................
9-4 Oracle9i Reports Developer: Build Reports
The Data Source Types
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-5
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Your
Text
data Express XML JDBC
files
source
Oracle9i
Reports
Client Oracle9i
Out-of-the-Box Options
......................................................................................................................................................
9-6 Oracle9i Reports Developer: Build Reports
Pluggable Data Sources
.....................................................................................................................................................
Technical Note
More information on defining pluggable data sources is covered in the course
Oracle9i Reports Developer New Features: Creating Pluggable Data Sources.
Instructor Note
Oracle9i OLAP Services as a PDS will not ship with 9.0.2 but should be available as a
download from OTN sometime after production. Express and Oracle9i OLAP
Services are two distinct options serving a similar purpose. The Express Query option
enables you to connect to an Express server, while the OLAP Services PDS allows you
to access the Oracle9i OLAP services, which are part of the Oracle9i database (version
9.2). Connectivity is provided to enable current Express users to connect to both
OLAP data sources. It is recommended that these users eventually migrate their data to
the OLAP Services in the Oracle9i database.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-7
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Instructor Note
Demonstration: Begin this demonstration after introducing the concepts on the facing
page. The scenario for this demonstration is provided for the students on the pages
following.
Create a new report using XML as the data source.
• Layout type: Create both Web and Paper Layout
• Style: Tabular
• Data source: XML Query
• Data: select Query Definition
– Data Definition: Use the Browse button to locate increase.dtd
– Data Source: Use the Browse button to locate salary.xml
• Fields: display all fields
• Select Finish
......................................................................................................................................................
9-8 Oracle9i Reports Developer: Build Reports
Using XML as a Data Source
.....................................................................................................................................................
What Is XML?
Extensible Markup Language, or XML, is an open standard for describing data and is
used for defining data elements on a Web page and business-to-business documents.
XML uses tags, similar to the tags used in HTML. However, while HTML is primarily
used for formatting and displaying text and images in a browser, XML is used for
structuring data. XML enables the exchange of data between applications in a simple,
non proprietary format.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-9
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
<TABLE>
<ROW>
<EMPID>100</EMPID>
<BONUS>2000</BONUS>
<PERINC>8</PERINC>
</ROW>
<ROW>
<EMPID>101</EMPID>
<BONUS>1000</BONUS>
<PERINC>5</PERINC>
</ROW>
.
.
.
XML Report
......................................................................................................................................................
9-10 Oracle9i Reports Developer: Build Reports
XML Example
.....................................................................................................................................................
XML Example
Introduction
The Human Resource (HR) department is preparing for quarterly bonuses. Each
manager has submitted a percent increase for the employees in his group. HR has
compiled a list of employee ID numbers, the bonus amount, and the associated
percentage. You are preparing the Employee Compensation report and eventually need
to merge the data from HR with the employee data stored in the corporate database.
The Data
In our example, the data provided by HR is stored in the file system in an XML
document. An XML data stream can also be accessed remotely through a URL. A
subset of the data stream from HR follows. In this example, the employee with ID 100
is receiving a $2000 bonus, which is 8% of his compensation.
<ROW>
<EMPID>100</EMPID>
<BONUS>2000</BONUS>
<PERINC>8</PERINC>
</ROW>
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-11
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
1
4 2
5 3
6
Instructor Note
Demonstration: Continue with the HR example. Add a SQL query to the data model.
• Select the SQL Query tool in the Data Model and click in the painter area.
• Define the query as
SELECT TO_CHAR(EMPLOYEE_ID), FIRST_NAME ||’ ‘||
LAST_NAME Employee, SALARY
FROM EMPLOYEES
In a later demonstration, you will link the data from the SQL query with the data from
the XML data source, basing the link on EMPLOYEE_ID. Because the DTD contains
only character data, you need to convert the EMPLOYEE_ID to the same data type.
Remind students that the layout must be updated when the data model changes. For
Web and paper reports, use the Report Wizard to update the layout. As an alernative
method for Web reports, use the Web Source view of the Report Editor and select
Insert > Report Block to update the Web layout.
• Reenter the Report Wizard. On the Groups and Fields tab pages, select the group
and columns, respectively, from the SQL query for display in the report.
• Run the Web layout. Point out that the data from both sources displays in the
output as two separate reports.
......................................................................................................................................................
9-12 Oracle9i Reports Developer: Build Reports
Adding New Data
.....................................................................................................................................................
Default Groups
Each query that you create in the Data Model creates at least one group. Reports
Builder creates a unique group name by appending the first column name in the group,
G_employee_id, G_department_id, and so on.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-13
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Instructor Note
Reports Builder has the ability to base a query on a REF cursor and the ability to use a
stored program unit to implement a REF cursor query.
Demonstration: Create a new report manually and save it as l9ref.jsp.
1 Create a local Package Spec named RefCurPack with the following type
definition: TYPE EmpCurType IS REF CURSOR RETURN
employees%rowtype;
If asked, explain that the package can also be part of an external PL/SQL library or
a stored program unit.
2 In the Data Model, create a ref cursor query using the PL/SQL Query tool.
3 Use the code in l9ref.txt. This creates the function.
The function associates the ref cursor variable with a query that must match the
type of the ref cursor declared in the package. There is a later demonstration that
shows how to associate the cursor variable with different queries to give you more
flexibility.
4 Explain that the group and the columns created are the same as those created from
a SQL query.
5 Use the Report Wizard to create a layout.
6 Run the Web layout. Save the report as l9ref.jsp. Close the report.
......................................................................................................................................................
9-14 Oracle9i Reports Developer: Build Reports
Using REF Cursor Queries
.....................................................................................................................................................
Reference
For further information on REF cursors, see: Reports Builder Online Help: Concepts
and Tasks > What Are... > Programmable Objects > About REF Cursor Queries.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-15
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Instructor Note
Use the HR demonstration to show how the position of the queries and groups in the
Data Model, determines the order in which unrelated records appear in the output.
......................................................................................................................................................
9-16 Oracle9i Reports Developer: Build Reports
Using REF Cursor Queries
.....................................................................................................................................................
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.
Remember to reenter the Report Wizard to update the layout after you modify the Data
Model.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-17
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Equijoin
DEPARTMENTS
Department_Id Department_Name
90 Executive
EMPLOYEES
100 Finance
Last_Name Department_Id
DeHaan 90
Department_Id =
Greenberg 100
Department_Id
Faviet 100
• Compound join:
– Multicolumn primary or foreign key
– Define multiple equijoins
• Nonequijoin:
– Primary key value between two other values
– Create two links:
......................................................................................................................................................
9-18 Oracle9i Reports Developer: Build Reports
Using Data Links to Structure Data
.....................................................................................................................................................
Defining Equijoins
Create a single link to define an equijoin.
An equijoin is a join condition where one value is equal to another.
...WHERE departments.department_id =
employees.department_id
Compound Keys
You can define multiple equijoins between the same group and query to implement a
compound primary/foreign key relationship—that is, a key that consists of more than
one column.
Defining Nonequijoins
Create two links to define a nonequijoin.
A nonequijoin is a condition where one value falls between a range of two other
values.
...WHERE employees.salary BETWEEN job_grades.lowest_sal
AND job_grades.highest_sal
In this example, you define links for two separate expressions:
employees.salary >= job_grades.lowest_sal
employees.salary <= job_grades.highest_sal
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-19
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Instructor Note
Demonstration: Continue with the HR example. Create a data link between the data
sources, based on the employee ID.
1 In the Data Model view of the Report Editor, select the Data Link tool.
2 Click on EMPLOYEE_ID in the SQL query and drag the link to EMPID in the
XML query.
To complete this report, a formula column needs to be created in the XML group to
compute the new salary for each employee. The completed report is
l9xml_HR.jsp. Show the students the PL/SQL code that populates this column and
tell them they will learn about formula columns in the next lesson. Run the completed
report.
......................................................................................................................................................
9-20 Oracle9i Reports Developer: Build Reports
Using Data Links to Structure Data
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-21
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Instructor Note
Demonstration: Use report l9reflk.rdf. The report contains all the PL/SQL
program units and the REF cursor query.
1 Explain the CurPack specification.
2 Explain the CurPack body.
3 Go to the Data Model.
4 Create a link between G_DEPT and G_LAST_NAME.
5 Open QR_1 and explain that the actual linking is done through the two parameters.
......................................................................................................................................................
9-22 Oracle9i Reports Developer: Build Reports
Using Data Links to Structure Data
.....................................................................................................................................................
Example Assume a simple example of a master query Q_DEPT and child query
Q_EMP. In Q_EMP, add the join condition:
...WHERE employees.department_id =:department_id
Note: “:department_id” is a bind reference to the primary key column in the master
query, Q_DEPT.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-23
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
• Outer joins
• Data ratio
• Multitier environment
Instructor Note
You can use l9outer.jsp to demonstrate a full outer join. The report displays
departments without employees, and there is one employee without a department. The
SQL query uses the FULL OUTER JOIN syntax available in Oracle9i.
......................................................................................................................................................
9-24 Oracle9i Reports Developer: Build Reports
Efficiency Issues: Multiple- or Single-Query Hierarchy
.....................................................................................................................................................
Outer Joins
Consider whether you want to display all master records, regardless of any existing
details (outer join), or only those master records that have related details.
You can add the outer join notation (+) to a single query, but if you require many or
complex outer joins, consider using multiple queries that fetch all records in the master
query even if there are no records in the detail query.
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 database to a minimum. Multiple queries for a hierarchical report result in far
greater network traffic in order to fetch records from each query separately.
Note: You can use SQL*Trace to analyze your report; for example, see how much
time it is taking to retrieve data from the database. You will learn more about
analyzing and tuning your report in a later lesson.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-25
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Summary
......................................................................................................................................................
9-26 Oracle9i Reports Developer: Build Reports
Summary
.....................................................................................................................................................
Summary
Pluggable Data Sources
WIth Oracle9i Reports, it is possible to publish data from any data source. Oracle9i
Reports provides the support for SQL, 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.
Data Links
Create a link between two queries, either manually or automatically. In Oracle9i
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-27
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
Practice 9 Overview
......................................................................................................................................................
9-28 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 9
.....................................................................................................................................................
Introduction
In this practice session, you include new data in a report by adding a query to an
existing single-query report using the Data Wizard. You also practice linking data
from different queries to alter the report structure. You will create a new report using
the XML pluggable data source and a SQL query.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-29
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
......................................................................................................................................................
9-30 Oracle9i Reports Developer: Build Reports
Practice Session: Lesson 9
.....................................................................................................................................................
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.
e Change the following field attributes:
Column Label Width
name Name 20
product Product 16
product_id ID 4
quantity Quantity 4
prod_total Total 9
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 9-31
Lesson 9: Enhancing Reports Using the Data Model: Data Sources
.....................................................................................................................................................
bIn 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.
......................................................................................................................................................
9-32 Oracle9i Reports Developer: Build Reports
10
................................
Enhancing Reports
Using the Data Model:
Creating Columns
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Objectives
Instructor Note
Topic Timing
Lecture 50 minutes
Practice 45 minutes
Total 95 minutes
......................................................................................................................................................
10-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
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.
Objectives
After completing his lesson, you should be able to do the following:
• Describe the different types of Data Model columns
• Display the contents of a file by using a data source column
• Identify the characteristics of the three types of user-defined columns
• Create report summaries and subtotals by using summary columns
• Derive data using a formula column
• Create and populate a placeholder column
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-3
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
......................................................................................................................................................
10-4 Oracle9i Reports Developer: Build Reports
The Data Model Column Types
.....................................................................................................................................................
Developer-Created Columns
A developer-created column can be one of three types:
• Summary column: Summarizes another column and can recalculate for each
record in a specified group
• Formula column: Uses a formula you have written in PL/SQL to calculate a value
from one or more other columns
• Placeholder column: Has its value set from another object at run time
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-5
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
1 Read-only properties
......................................................................................................................................................
10-6 Oracle9i Reports Developer: Build Reports
Maintaining Data Source Columns
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-7
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
......................................................................................................................................................
10-8 Oracle9i Reports Developer: Build Reports
Using a Data Source Column to Output Contents of a File
.....................................................................................................................................................
File Search
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-9
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Creating a Column
Summary column
• What type of value?
Choose the correct column Formula column
tool
Placeholder column
Instructor Note
Describe the three column types briefly at this stage.
The following pages contain a definition and explanation of each, followed by some
example reports that demonstrate how to use each of the column types correctly.
The first example is a simplification of the Highest Earner report from a previous
course, and uses all three types together. The other examples demonstrate the various
property settings for Summary columns.
......................................................................................................................................................
10-10 Oracle9i Reports Developer: Build Reports
Creating a Column
.....................................................................................................................................................
Creating a Column
Introduction
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-11
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Summary Column
• Specific properties:
– Function
– Source
– Reset At
– Compute At
• Data type depends on Source data type
• Page summaries: Not supported in the wizard
......................................................................................................................................................
10-12 Oracle9i Reports Developer: Build Reports
Creating Summary Columns
.....................................................................................................................................................
Summary Datatypes
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.
Page Summaries
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. Cleaar 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-13
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Displaying Subtotals
Reset At:
G_DEPARTMENT_ID Report
1 Department totals
2 Report total
Instructor Note
Demonstration: L10SUM.RDF.
......................................................................................................................................................
10-14 Oracle9i Reports Developer: Build Reports
Example Report Displaying Subtotals
.....................................................................................................................................................
Rule
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-15
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Displaying Percentages
Reset At: G_EMP G_EMP
Compute At: G_DEPT Report
......................................................................................................................................................
10-16 Oracle9i Reports Developer: Build Reports
Example Report Displaying Percentages
.....................................................................................................................................................
Resetting Percentages
The Reset At property works the same way that the Sum function does. The default,
Reset At G_EMP, results in a discrete value for each employee.
For both summaries opposite, the Reset At property is G_EMP. 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_DEPT.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-17
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Reset At
Data Model
Group REPORT G_DEPT G_EMP
......................................................................................................................................................
10-18 Oracle9i Reports Developer: Build Reports
Example Report Displaying Percentages
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-19
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Formula Column
......................................................................................................................................................
10-20 Oracle9i Reports Developer: Build Reports
Creating Formula Columns
.....................................................................................................................................................
Rule
Any columns referenced by the formula column are calculated first.
A Note on Efficiency
The code above 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. It is always advisable to perform calculations on the server instead of
on the client.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-21
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Placeholder Column
• An empty container at
design time
CP_xxx • Populated by another
object at run time
– Before Report trigger
– Formula column at report
level
– Formula column in same
group or below
CF_xxx placeholder
Instructor Note
Stress that you must code the PL/SQL (to populate the placeholder) in another object,
not the placeholder column itself.
If students ask for more details about the PL/SQL Formula property:
A placeholder column cannot populate itself; therefore, you write the formula in a
Formula column (or trigger), not in the placeholder.
The only time you need the Formula property in a placeholder is if you populate the
placeholder from a user exit that you call in the other object.
In that case, Reports Builder cannot resolve possible dependencies that might be in the
user exit, so you must call SRW.REFERENCE() in the placeholder itself to declare
explicitly any column values on which the placeholder depends. (The SRW package is
discussed later in the course.)
......................................................................................................................................................
10-22 Oracle9i Reports Developer: Build Reports
Creating Placeholder Columns
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-23
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Instructor Note
Demonstration:
Open the L10PLACE.RDF report. The report is prebuilt, because this is not an easy
demonstration to create from scratch and display neatly and quickly, especially
because the students have not seen the Paper Layout yet.
Show the report output in the Paper Design and explain the aim of the report. Point out
that this layout is not totally achievable in the Paper Design.
Then show the Data Model. Explain each of the three columns and show the properties
for each.
Remember to show the PL/SQL Formula for the formula column and explain the code.
The first block of code is a simple example. It returns only one employee. To allow for
multiple employees who earn the maximum salary, the code must test for an existing
string in the placeholder and concatenate with the current name.
......................................................................................................................................................
10-24 Oracle9i Reports Developer: Build Reports
Example Report to Populate a Placeholder
.....................................................................................................................................................
The Columns
You need to create the following columns:
• A summary to show the maximum salary for the company
• A placeholder to contain the highest earner’s name at run time
• A formula to:
– Compare each employee salary with the maximum salary
– Populate the placeholder with the employee name if salary equals maximum
salary
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-25
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Summary
......................................................................................................................................................
10-26 Oracle9i Reports Developer: Build Reports
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
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-27
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Practice 10 Overview
......................................................................................................................................................
10-28 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 10
.....................................................................................................................................................
Introduction
In your reports, you might need to include additional columns with summary
functions—or even add summaries, such as break totals and report totals. This practice
provides the opportunity for you to create summaries and additional columns with
functionality that cannot be achieved using SQL alone.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-29
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
Hint: Read through all the steps of this exercise before creating your report.
You can use Query Builder to define the initial query for this report. You can
then manually edit the query to modify the display of order_date using the
TO_CHAR function: TO_CHAR(order_date, ‘dd-Mon-yyyy’).
b Do you need a formula column to calculate the line_total?
c Create the following summaries. Can you use the Report Wizard to create the
summaries?
Column Summary
line_total sum
line_total % Total
......................................................................................................................................................
10-30 Oracle9i Reports Developer: Build Reports
Practice Session: Lesson 10
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 10-31
Lesson 10: Enhancing Reports Using the Data Model: Creating Columns
.....................................................................................................................................................
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.
c Run the paper layout to test. Scroll down to the last page to see the new
columns.
d Save the report as p10q4.rdf and close it.
......................................................................................................................................................
10-32 Oracle9i Reports Developer: Build Reports
11
................................
Objectives
Instructor Note
Topic Timing
Lecture 45 minutes
Practice 40 minutes
Total 85 minutes
......................................................................................................................................................
11-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
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.
Objectives
After completing this lesson, you should be able to do the following:
• Distinguish the different sections of a report
• Design multipanel reports
• Apply report bursting
• Describe the layout objects and their relationships
• Modify an existing report layout using the Paper Layout tools
• Separate report data using variable length lines
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-3
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Header Compensation
section Report
Page 1 of 1
Main
section
Instructor Note
The report l11layout.rdf has data in all three sections. Make sure to show this.
......................................................................................................................................................
11-4 Oracle9i Reports Developer: Build Reports
Viewing the Paper Layout
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-5
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Page 1 of 1
Main Body/
section Margin
Trailer Body/
End of report
section Margin
Instructor Note
Both the header section and main section of the report l11layout.rdf use the
body and the margin area.
......................................................................................................................................................
11-6 Oracle9i Reports Developer: Build Reports
Viewing the Paper Layout
.....................................................................................................................................................
Body
The body area of a section can contain text, graphics, data, computations, and
summaries.
Margin
Margins can contain text, graphics, page numbers, page totals, and grand totals.
When you choose the margin view, the body also remains visible, but read-only, in the
editor. The body appears within a black rectangle that defines the size of margin and
body. You cannot modify objects in the body while working in the margin view.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-7
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
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
......................................................................................................................................................
11-8 Oracle9i Reports Developer: Build Reports
Designing Multipanel Reports
.....................................................................................................................................................
Example In the diagram opposite, the layout is twice the width of the physical page.
For example, to output a logical design of 16 inches across 8-inch pages, the settings
are:
• Unit of Measurement: Inch
• Physical Page Height: 8
• Horizontal Panels per Page: 2
• Vertical Panels per Page: 1
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-9
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
......................................................................................................................................................
11-10 Oracle9i Reports Developer: Build Reports
Designing Multipanel Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-11
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
4
5
1
2
3
1 Frame 4 Boilerplate
2 Repeating frame 5 Imported boilerplate image
3 Field 6 Graph
......................................................................................................................................................
11-12 Oracle9i Reports Developer: Build Reports
Recognizing Layout Objects
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-13
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
F_xxx F_xxx
R_G_xxx
M_G_xxx
Body
Instructor Note
Make sure the students understand this important concept. Walk them through a
Tabular and Group report, highlighting the objects in the Paper Layout editor and
pointing them out in the Object Navigator as well. You can use layers.rdf to
show the different frames. This Group Above report has the Vertical and Horizontal
Gap set to 2 in order to see all the frames.
Using a different fill color for each frame helps to illustrate the layering concept.
Remind students that, as long as they create and modify reports using the Report
Wizard, they do not have to worry about the layering. The Report Wizard creates
everything correctly for them. You should also remind them that if they reenter the
Report Wizard, any modifications previously made using the Paper Design will be
lost.
If they have to modify the layout themselves, recommend that they test and save their
report frequently, in case they make a big mistake and want to return to a previous
version. Point out that the File > Revert menu option is very useful for this.
......................................................................................................................................................
11-14 Oracle9i Reports Developer: Build Reports
The Paper Layout Layers
.....................................................................................................................................................
Group Reports
Group Left and Group Above reports create two repeating frames; the detail group
frame is nested inside the master repeating frame to produce a detail tabular listing for
each master record.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-15
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
• Confine Mode
• Flex Mode
Instructor Note
The slide shows:
• The effect of Confine Mode when Flex Mode is disabled; the parent enclosing
object does not flex
• The effect of Flex Mode when Confine Mode is enabled (locked); the enclosed
object cannot move outside its parent enclosing object
Flex Mode flexes in only one direction at a time, either horizontally or vertically, but
not diagonally. To flex the layout when moving diagonally, first move or resize the
object in one direction, horizontally or vertically, and then in the other direction as a
separate movement.
......................................................................................................................................................
11-16 Oracle9i Reports Developer: Build Reports
The Paper Layout Layers
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-17
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
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
Instructor Note
Explain the 3GL way of understanding the report processing.
Also briefly explain the meaning of the arrowhead (repeating frame) and the diamond
(variable size).
This is a good time to make a remind students about the rw:foreach tag. In a Reports
JSP, it indicates a loop through the data source group object
......................................................................................................................................................
11-18 Oracle9i Reports Developer: Build Reports
The Paper Layout Layers
.....................................................................................................................................................
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 each 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;
Layout Symbols
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
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-19
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
2 7
3 8
4 9
5
......................................................................................................................................................
11-20 Oracle9i Reports Developer: Build Reports
Creating Layout Objects
.....................................................................................................................................................
Technical Note
The ability to embed an OLE2 object in a report is obsolete in Oracle9i Reports. 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-21
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Layout Tools
• Magnify
• Frame Select
• Report Block
......................................................................................................................................................
11-22 Oracle9i Reports Developer: Build Reports
The Paper Layout Tools
.....................................................................................................................................................
Pinning a Tool
If you want to create several objects of the same type, double-click the drawing tool. A
small red pin appears on the tool icon, and the tool remains active until you click the
tool again or choose a different tool.
Report Block
The Report Block tool invokes the Report Block Wizard to enable you to create
additional layouts in your report without deleting existing objects, and to let you mix
multiple report styles in the same section of a report.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-23
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Report Bursting
Header à e-mail
Body à PDF
Trailer à HTML
Report Bursting
Dept 10
West East
Dept 20
West East
;
Dept 30
West East
Dept 40
…
…
Dept 80
Instructor Note
Use l11distr.rdf to show different layouts for each report section, and to
demonstrate report bursting and distribution.
This report will be used for several demonstrations in this lesson.
......................................................................................................................................................
11-24 Oracle9i Reports Developer: Build Reports
Report Bursting
.....................................................................................................................................................
Report Bursting
Introduction
The capability of producing multiple copies of a given report or portions of it in
different output formats is referred to as report bursting.
Oracle9i 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.
With Oracle9i Reports, you are also able to burst on repeating data within a report.
This ensures that each user only receives information that is relevant and appropriate
for them. For example, suppose you have created an employee salary report. The
manager of Department 10 will receive an e-mail with the salary information for
employees in Department 10; the manager of Department 20 will only be e-mailed the
salary information for employees in Department 20, while a summary will be printed
out for the president of the company. More importantly, the report is actually run only
once, and the output is sent to the different sets of users according to the requirements.
You only have the overhead of a single data fetch and format in order to distribute the
report. This is called one-pass reporting and is a key feature in Oracle9i Reports.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-25
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Instructor Note
You can use l11distr.rdf to demonstrate bursting on a repeating group. Follow
the steps on the opposite page.
......................................................................................................................................................
11-26 Oracle9i Reports Developer: Build Reports
Report Bursting
.....................................................................................................................................................
Example
The group left report on the opposite page generates salary information for employees
for each department. In order to distribute the salary information to each respective
department manager, you have to set up the report to burst on the department ID
group.
1 Display the Paper Layout for the report. Select the outermost repeating frame,
R_G_DEPARTMENT_ID, in the Object Navigator.
2 Delete R_G_DEPARTMENT_ID in the Paper Layout.
3 In the Object Navigator, select the Main Section node and open its Property
Inspector.
4 Locate the Repeat On property, and select G_DEPARTMENT_ID from the drop-
down list.
The report is now set up to burst on each new value of G_DEPARTMENT_ID.
You will learn how to distribute the report shortly.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-27
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Instructor Note
The header and trailer sections of l11distr.rdf contain layouts. Show these to the
students using the Paper Layout and the Object Navigator.
Feel free to create an additional layout in any of the report sections to demonstrate the
Report Block tool.
......................................................................................................................................................
11-28 Oracle9i Reports Developer: Build Reports
Report Bursting
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-29
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Report Distribution
Report Distribution
Instructor Note
Using the same l11distr.rdf report, demonstrate the distribution for the sections.
Details are continued in the next Instructor Note.
......................................................................................................................................................
11-30 Oracle9i Reports Developer: Build Reports
Report Bursting
.....................................................................................................................................................
For more information on the .xml file, refer to Reports Builder Online Help.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-31
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Instructor Note
Distribution demonstration, continued. You will generate a PDF file for each
department.
1 In the Property Inspector for the main section, invoke the Distribution dialog box.
2 Enter a Distribution ID.
3 Enter a value for DESNAME that contains a parameter for department_id. For
example: rpt&<department_id>.pdf
4 Set DESFORMAT to PDF and DESTYPE to File.
If you need it, the file l11distr2.rdf contains the bursting and distribution
settings. You will need to delete the printer destination for the Trailer section before
running the report.
If you want, you can invoke the Distribution property for the Header and Trailer
sections and specify distribution settings for these as well.
Demonstrate how to trace the report distribution.
Finally, run the report by selecting File > Distribute. Show the students the output files
in your directory. View one or two of them. Using a text editor, show them the trace
file.
Note: If asked, for complex distributions an XML file is needed; for example, the user
wants to customize the subject line or body of an e-mail. For more information, see
Reports Builder Online Help and the eClass Oracle9i Reports: Publish Any Data to
Any Destination.
......................................................................................................................................................
11-32 Oracle9i Reports Developer: Build Reports
Report Bursting
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-33
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Flex Lines
Instructor Note
You can create variable lines in the Paper Design or the Paper Layout; demonstrate in
the Paper Design and show the object in the Paper Layout also.
Demonstration: l11flex.rdf, tabular report of PRODUCT_DESCRIPTIONS,
with several translated descriptions wrapping onto more than one line.
In the Paper Design, go to page 2 or 3 and locate a description that does not wrap onto
a second line. Magnify the layout. Draw a vertical line between TRANSLATED
NAME and TRANSLATED DESCRIPTION to fill the repeating frame. Show that the
fixed line does not stretch to fill the records that wrap onto two lines. Select the line,
open the Property Inspector, and set the Line Stretch with Frame property to
R_G_product_id; the line expands for each repeating frame.
Ask: What if you want the line to fill the whole group frame including the column
headings? Answer: Create the line starting at the top of the column headings and
change Line Stretch with Frame to the group frame.
Demonstrate this example: In the Paper Design, you cannot extend the line upward,
because the layout is protected, so delete and re-create the line from the top of the
column label through the repeating frame. Set Line Stretch with Frame to
M_G_product_id_GRPFR. Alternatively, change to the Paper Layout, disable Confine
Mode, and extend the line. Remember to reenable Confine Mode.
......................................................................................................................................................
11-34 Oracle9i Reports Developer: Build Reports
Creating Variable Length Lines
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-35
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Summary
......................................................................................................................................................
11-36 Oracle9i Reports Developer: Build Reports
Summary
.....................................................................................................................................................
Summary
Introduction
In this lesson, you learned to modify a paper report layout in the Paper Layout.
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
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-37
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
Practice 11 Overview
......................................................................................................................................................
11-38 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 11
.....................................................................................................................................................
Introduction
In this practice session, you use reports created in earlier practice sessions. The aim is
to familiarize you with the different layout sections and regions of a report, and to use
report bursting. You also add flexible lines to a frame.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-39
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
......................................................................................................................................................
11-40 Oracle9i Reports Developer: Build Reports
Practice Session: Lesson 11
.....................................................................................................................................................
Define the distribution for the report. Generate a PDF file for each warehouse,
c
using the warehouse name as a unique identifier for each PDF file, such as
rptBejiing.pdf.
d Activate the distribution.
e Save the report.
f Look at the output generated for several of the warehouses.
4 Open report p11q4.rdf.
a Use the Report Wizard to increase the width of PRODUCT_DESCRIPTION to
30.
b Add a flexible line vertically between the PRODUCT_NAME and
PRODUCT_DESCRIPTION fields.
c Run the Paper Layout to test.
d Save the report as p11q4.rdf.
5 Open and run report p2q10.rdf.
a Using the Paper Design view, compare the output with s11q5a.rdf. What is
different? Change the report so that it looks like s11q5a.rdf.
b Fully expand the Paper Layout node for p2q10.rdf.
c Open the Paper Layout and move the window to the right. Make sure it doesn’t
obscure the Object Navigator window.
d Move the F_EMPLOYEE field down 2 inches. It should not be enclosed by
any frame.
e Resize the R_G_EMPLOYEE frame so that it only encloses the F_SALARY
and F_JOB_ID fields.
f Resize the M_G_EMPLOYEE_GRPFR frame so that it encloses the
R_G_EMPLOYEE repeating frame.
g Move the F_DEPARTMENT_NAME and F_DEPARTMENT_ID fields to the
right.
h Create a new repeating frame in the free space. Set the Line color attribute to
No line.
i Link the repeating frame to the G_EMPLOYEE group.
j Move the F_EMPLOYEE field inside the repeating frame R_1.
k Save the report as p11q5a.rdf and run the paper layout. What happens?
l Fix the layout hierarchy error.
m Rearrange the column headers
n Run the paper layout.
o Close the report. Save as p11q5a.rdf.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 11-41
Lesson 11: Enhancing Reports Using the Paper Layout
.....................................................................................................................................................
......................................................................................................................................................
11-42 Oracle9i Reports Developer: Build Reports
12
................................
Objectives
Instructor Note
Topic Timing
Lecture 30 minutes
Practice 30 minutes
Total 60 minutes
......................................................................................................................................................
12-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
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.
Objectives
After completing this lesson, you should be able to do the following:
• Identify layout properties common to all types of objects
• Control the sizing of layout objects
• Control pagination of layout objects
• Control printing and formatting of layout objects
• Explain the use of format triggers
• Modify Web Settings properties
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-3
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
Comparing Properties
Intersection Freeze
Instructor Note
Remind students of the exploding layer view of a tabular report and a group report
covered in the previous lesson. Verify the object name before modifying the
properties.
......................................................................................................................................................
12-4 Oracle9i Reports Developer: Build Reports
Modifying Paper Layout Object Properties
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-5
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
......................................................................................................................................................
12-6 Oracle9i Reports Developer: Build Reports
Modifying Common Layout Properties
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-7
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
Sizing Objects
Layout icons
Elasticity Vertical Horizontal
fixed
expand
contract
variable
Instructor Note
There is a demonstration report to illustrate the slide on page 12-10 (Layout Object
Relationships) and page breaks. The file is l12anc1.rdf.
Use this to remind students of the differences between explicit and implicit anchors. If
you want, you can also show the anchor icons in the Object Navigator.
Continue using this file to show the effect of the pagination options: Page Break
Before and Page Break After.
Suggestion: In the preferences, go to Runtime Settings and make sure that Run Debug
is enabled, so that you see the warning message when Page Break After has no effect.
......................................................................................................................................................
12-8 Oracle9i Reports Developer: Build Reports
Sizing Objects
.....................................................................................................................................................
Sizing Objects
Introduction
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-9
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
M
Anchors
Implicit (shaded)
Explicit (solid)
Instructor Note
Enable Anchoring Information (Tools > Options > Layout tab) and explain how to
read the symbols:
• Blue = Parent object
• Red = Child object
A large blob identifies the current node. Therefore a large blue blob indicates that the
current node is the parent; a large red blob indicates that the current node is the child.
• Solid fill = Explicit anchor
• Shaded fill = Implicit anchor
......................................................................................................................................................
12-10 Oracle9i Reports Developer: Build Reports
Anchors
.....................................................................................................................................................
Anchors
Introduction
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.
Push Path
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 vertical size
• An object occurring to the right of an object that has a variable horizontal size
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-11
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
1
2
1 No relationship, no anchor
2 Explicit anchor to enforce relationship
3 Implicit anchor because object is in the push path of a frame
Instructor Note
Use the following questions to determine how well students understand anchors; for
example, What do we mean by push path?
Draw a diagram, including all or some of the suggested objects:
Draw a field (F_1) enclosed in repeating frame R_1 (down direction, fixed size),
enclosed in a frame, M_1 (draw diamonds to show variable size).
Add an object (B_1) below the repeating frame, but inside the group frame.
Add an object (B_2) to the right of the repeating frame.
Add an object (B_3) below the group frame.
To which object is the field related? (repeating frame, enclosing object)
To which object is the repeating frame related? (group frame, enclosing object)
To which object is B_1 related? (repeating frame, implicit anchor)
To which object is B_2 related? (group frame, enclosing object)
To which object is B_3 related? (group frame, implicit anchor)
Remind students that they can create an explicit anchor to override the defaults.
......................................................................................................................................................
12-12 Oracle9i Reports Developer: Build Reports
Layout Object Relationships
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-13
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
......................................................................................................................................................
12-14 Oracle9i Reports Developer: Build Reports
Layout Object Relationships
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-15
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
-1-
1
-2-
xxx
xxx
-1-
xxx -2-
2 xxx
Instructor Note
Explain Example 1: The image is to the side of the repeating frame, not in the push
path, and therefore not related. Page Break Before forces the repeating frame to the
second page, but the image remains on the first page.
Ask the students how they could make the image move to the second page in
Example 1. (Create an explicit anchor from image to repeating frame, so that the
image waits for the repeating frame to be formatted.)
In Example 2, the image is implicitly anchored because it is in the push path of the
repeating frame.
Point out that the Page Break Before happens only before the first instance of the
repeating frame, not between each instance.
If students ask how to do it, discuss the property Maximum Records per Page later in
this lesson.
......................................................................................................................................................
12-16 Oracle9i Reports Developer: Build Reports
Layout Object Relationships
.....................................................................................................................................................
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 record.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-17
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
-1-
xxx
1 xxx
-1-
xxx -2-
2 xxx
Instructor Note
Point out that:
• Page Break After is useful for forcing several child objects onto a new page.
• Page Break Before is useful for forcing one object onto a new page.
For example, if you only want the image to move to a new page, you can set Page
Break Before on the image.
......................................................................................................................................................
12-18 Oracle9i Reports Developer: Build Reports
Layout Object Relationships
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-19
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
-1-
40
xxxxxxxx
f_dept_id
xxxxxxxx
Employee
-2-
f_ename
41
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
Instructor Note
Page Protect is useful to protect a number of objects together on the same page.
Mention Keep with Anchoring Object to keep two related objects together on the same
page. This property works with implicit and explicit anchors.
......................................................................................................................................................
12-20 Oracle9i Reports Developer: Build Reports
Layout Object Relationships
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-21
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
-1-
Your Company Your Company
-2-
Your Company
-3-
Your Company
Instructor Note
The default value for Base Printing On is Enclosing Object, so if Print Object On is set
to All Pages, Summit Goods is printed for all pages of the group frame.
Mention that you do not often need to change Base Printing On to Anchoring Object.
It may be necessary in some layouts if the text is explicitly or implicitly anchored to a
parent object and you want to control the printing of the text on the same pages as its
parent object. Therefore, the combination of options depends on the layout of different
reports and objects.
Here is a suggested demonstration or group exercise to break up the long lesson and to
summarize some of the properties discussed so far. Use this to encourage discussion
among students by asking them how to achieve each step:
Use a master-detail report; for example, DEPARTMENTS/EMPLOYEES (or you
might prefer the simple example of DEPT/EMP).
Result you want to achieve: Each master is to be a title page with its details on a
subsequent page. The master information must not repeat on the detail pages.
A detailed step-by-step description is on the following page.
......................................................................................................................................................
12-22 Oracle9i Reports Developer: Build Reports
Layout Object Relationships
.....................................................................................................................................................
Which Page?
Print Object On determines on which of the parent’s logical pages the object is printed.
Print Object on Object Prints on
All Pages All logical pages of the parent
All But First Page All logical pages except the first or last page
All But Last Page
First Page/Last Page The first or last logical page only
Default The option that Reports Builder chooses; Reports Builder resets
the property, using an internal algorithm; use the default setting
if you have made a mistake and want to return to the report
default
Which Parent?
Base Printing On determines whether the parent object is to be the Enclosing Object or
the Anchoring Object.
Example
The report opposite shows a text title inside the group frame. The output for this frame
shows there are several records that span three pages.
When you create a piece of text, by default it is printed on the First Page only of its
enclosing object. In this case, the enclosing object is the group frame. You can modify
the properties to select the pages on which the text is printed.
To print the text on all pages of the group frame, set Print Object On to All Pages; set
Base Printing On to Enclosing Object (default).
Note: If the text is outside all group frames, its parent is the body page itself.
Therefore, you can use these two properties to display “Continued...” on all but the last
page, or “...continued” on all but the first page.
There are several restrictions that apply to these settings. If you receive an “invalid
setting error,” look at the explanation and restrictions in the Reports Builder Help
Topics.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-23
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
Format Triggers
Instructor Note
Explain the use of format triggers briefly to show their power. Stress that format
triggers are available on all layout objects. Remind the students that quite a lot can be
done using conditional formatting. The Coding PL/SQL Triggers lesson covers this in
more detail.
You can also use format triggers in a Web layout, specifically with the rw:field tag.
This is addressed in the Coding PL/SQL Triggers lesson as well.
......................................................................................................................................................
12-24 Oracle9i Reports Developer: Build Reports
Using Format Triggers
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-25
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
• Hyperlink
• Hyperlink
Destination
• Bookmark
• Application
Command Line
......................................................................................................................................................
12-26 Oracle9i Reports Developer: Build Reports
Layout Object Properties for Web Support
.....................................................................................................................................................
Examples
• Dynamic Hyperlink
‘Dept Details ’ || to_char(:deptno)
• Dynamic Bookmark
‘Company Car Policy, Category ’ || :level
• Application Command Line
C:\orawin90\bin\rwrun.exe report=payload_det.rdf
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-27
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
Summary
......................................................................................................................................................
12-28 Oracle9i Reports Developer: Build Reports
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
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-29
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
Practice 12 Overview
......................................................................................................................................................
12-30 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 12
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 12-31
Lesson 12: Controlling the Paper Layout: Common Properties
.....................................................................................................................................................
......................................................................................................................................................
12-32 Oracle9i Reports Developer: Build Reports
13
................................
Objectives
Instructor Note
Topic Timing
Lecture 30 minutes
Practice 30 minutes
Total 60 minutes
......................................................................................................................................................
13-2 Oracle9i Reports Developer: Build Reports
Overview
.....................................................................................................................................................
Overview
Introduction
In the previous lesson you looked at common object properties. There are however a
number of properties that are unique to specific types of layout objects.
In this lesson, you learn about specific properties for repeating frames, fields, and
boilerplate. You will also learn to reference the contents of a file at run time.
Objectives
After completing this lesson, you should be able to do the following:
• Identify properties that are specific to certain types of paper layout objects
• Explain the use of properties that are specific to certain types of paper layout
objects
• Display the contents of a file in the report layout
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-3
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
......................................................................................................................................................
13-4 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Repeating Frame
.....................................................................................................................................................
The most commonly used properties are discussed in more detail on the following
pages.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-5
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Print Direction
......................................................................................................................................................
13-6 Oracle9i Reports Developer: Build Reports
Print Direction
.....................................................................................................................................................
Print Direction
Print direction specifies the direction in which to print the repeating frame’s records,
and may be any one of the values below:
Print Direction Description
Down Prints sequential records down the page. At the end of
the page, records overflow onto the next page.
Down/Across Prints sequential records down the page. At the end of
the page, records move across to form a new column if
there is room; otherwise they overflow onto a new
page.
Across Prints sequential records across the page. When records
reach the right edge of the page, they overflow onto a
new page.
Across/Down Prints sequential records across the page. When records
reach the right edge of the page, they move down
below the previous set of records if there is room;
otherwise they overflow onto a new page.
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-7
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
1 2
-1- -1-
-2-
-3- -2-
......................................................................................................................................................
13-8 Oracle9i Reports Developer: Build Reports
Print Direction
.....................................................................................................................................................
Examples Recall the Form and Form Letter report styles. Reports Builder
automatically sets Maximum Records per Page to 1. If you require more than one
record on each page, you can modify this property.
In the Group Above report style, Reports Builder formats as many records as possible
on a page. (Maximum Records per Page is null.) Modify this property for the master
repeating frame to display one master record per page.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-9
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
1
2
Instructor Note
If you want to demonstrate this, use a mailing label layout style and give the label
repeating frame a color fill. Run the report and show how the color fills the entire
page, meaning there are no gaps. Now alter the horizontal and vertical spacing using a
different value for each and run the report again.
......................................................................................................................................................
13-10 Oracle9i Reports Developer: Build Reports
Print Direction
.....................................................................................................................................................
Horizontal Space Between Frames Define the amount of space you want between
records horizontally across the page by entering zero or any positive number for this
setting.
This setting has no effect if the repeating frame has a print direction of Down.
Vertical Space Between Frames Define the distance you want between records
vertically down the page by entering zero or any positive number for this setting.
This setting has no effect if the repeating frame has a print direction of Across.
Note: In bitmapped reports, the distance is a whole or part of the unit of measurement,
for example,.25 (of an inch).
In character mode reports, the distance is the number of blank characters (horizontal)
or lines (vertical). Therefore, you must enter a whole number, for example, 10
(characters).
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-11
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Page 1 Page 1
Page 2 Page 2
Instructor Note
If asked, the term widow record refers to a single record separated from the other
records in that group.
......................................................................................................................................................
13-12 Oracle9i Reports Developer: Build Reports
Minimum Widow Records
.....................................................................................................................................................
Example
In the diagram are two separate repeating frames printing down the page. The second
repeating frame is near the end of the page, and there is only room for two records.
If you want to force at least three records on a page, enter 3 in the Minimum Widow
Records property so that the repeating frame starts to format on the next page.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-13
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Column Mode
Page 1 Page 1
10 20 10 20 30
Page 2 Page 2
20 30 20
Instructor Note
Column Mode is only relevant to some layout styles.
It has two effects:
• Maintains same column for records spanning a page
• Allows subsequent records to start formatting before the previous record has
finished printing
......................................................................................................................................................
13-14 Oracle9i Reports Developer: Build Reports
Column Mode
.....................................................................................................................................................
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 opposite 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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-15
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Properties of a Field
Instructor Note
Remind students that you can easily create page numbers and the current date in the
Paper Design view; however, creating your own fields provides more control over the
property settings for page numbering. Open l13field.rdf.
1 Change Maximum Records per Page to 1 (master repeating frame).
2 Select Page Break Before (detail group frame).
3 Change Print Object to First Page for all objects in the master repeating frame (use
[Shift]-click + select and show how to change the property for several objects at
the same time on one Property Inspector).
Point out that alternatively you can create a frame to enclose all these objects and
set the property on the frame instead. This method is used in the Carry Over
example in the practice session at the end of this lesson.
4 If you have extra time, you may want to continue with the demonstration after
discussing the field properties and create a field for page numbering and reset for
each department (master record).
......................................................................................................................................................
13-16 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Field
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-17
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
System Variables
......................................................................................................................................................
13-18 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Field
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-19
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Page Numbering
Page 4 of 4
Example 1
Page 3 of 4
End
Page 2 of 4
Page 1 of 4
Example 2
Report
Title
Page 1 of 1
End
Page 2 of 2
Page 1 of 2
Report
Title
......................................................................................................................................................
13-20 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Field
.....................................................................................................................................................
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:
Page Numbering Property Value
Include Main Section, Trailer Section
Start At 1
Increment By 1
Reset At Report
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
Reset At R_Dept
Note: When resetting page numbers for each record in a repeating frame, make sure
that each record starts on a new page. Use the Maximum Records per Page property;
this property of the repeating frame was discussed earlier in this lesson.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-21
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
G_Region
R_Region
F_1 R_Dept
G_Dept R_Emp
G_Emp F_REPORT
......................................................................................................................................................
13-22 Oracle9i Reports Developer: Build Reports
Modifying Properties of a Field
.....................................................................................................................................................
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.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-23
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Instructor Note
The File Link tool is available in the Paper Design, as well as in the Paper Layout.
Note: The Property Inspector for the File Link object indicates ‘Link File’. This is a
bug (#2129653) in release 9.0.2 and will be fixed in release 9.0.3.
Also, Oracle Drawing Format is no longer supported.
......................................................................................................................................................
13-24 Oracle9i Reports Developer: Build Reports
Displaying File Contents with a File Link
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-25
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
1 2
Import
Link
3 4
......................................................................................................................................................
13-26 Oracle9i Reports Developer: Build Reports
Displaying File Contents with a File Link
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-27
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Q_EMP
G_EMP
PICTURE F_PICTURE
1
......................................................................................................................................................
13-28 Oracle9i Reports Developer: Build Reports
Displaying File Contents with a File Link
.....................................................................................................................................................
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-29
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Summary
......................................................................................................................................................
13-30 Oracle9i Reports Developer: Build Reports
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
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-31
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
Practice 13 Overview
......................................................................................................................................................
13-32 Oracle9i Reports Developer: Build Reports
Practice Session Overview: Lesson 13
.....................................................................................................................................................
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 file link to display a company logo by dynamically referencing a file at run
time.
......................................................................................................................................................
Oracle9i Reports Developer: Build Reports 13-33
Lesson 13: Controlling the Paper Layout: Specific Properties
.....................................................................................................................................................
......................................................................................................................................................
13-34 Oracle9i Reports Developer: Build Reports