Oracle Reports Developer 10g Build Reports
Oracle Reports Developer 10g Build Reports
Oracle Reports Developer 10g Build Reports
Reports
Volume 1 Student Guide
.......................................................................................
43212GC10
Production 1.0
April 1999
M08692
Authors
Christian Bauwens
Ursula Hovy
Technical Reviewers
Gunnar Boehrs
Jackie Bruce
Ruth Delaney
Laurent Dereac
Astrid Dietrich
Brian Fry
Mary Lee
Stella Misiulis
Paul Narth
Sergiy Pechersky
Raza Siddiqui
John Walsh
Publisher
Sherry Polm
All other products or company names are used for identification purposes only
and may be trademarks of their respective owners.
Contents
.....................................................................................................................................................
Preface
Profile xv
Related Publications xvi
Typographic Conventions xvii
Introduction
Overview I-3
Course Objectives I-5
Course Content I-7
Lesson 1: Introduction to Oracle Reports
Overview 1-3
What Is Oracle Developer? 1-5
Introducing the Oracle Developer Release 6.0 Components
Report Builder Components 1-13
Getting Started in the Oracle Reports Interface 1-17
Navigating Around the Oracle Reports Main Menu 1-19
Customizing Your Oracle Reports Session 1-21
Oracle Reports Environment Variables 1-25
Oracle Reports Help Options 1-27
Introducing the Course Application 1-29
Summary 1-31
Practice Session Overview: Lesson 1 1-33
Practice Session: Lesson 1 1-34
1-9
.....................................................................................................................................................
Oracle Developer: Build Reports
iii
Contents
.....................................................................................................................................................
3-25
.....................................................................................................................................................
iv
Oracle Developer: Build Reports
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle Developer: Build Reports
v
Contents
.....................................................................................................................................................
.....................................................................................................................................................
vi
Oracle Developer: Build Reports
Contents
.....................................................................................................................................................
13-5
14-21
.....................................................................................................................................................
Oracle Developer: Build Reports
vii
Contents
.....................................................................................................................................................
.....................................................................................................................................................
viii
Oracle Developer: Build Reports
Contents
.....................................................................................................................................................
A-2
A-3
A-8
A-9
A-14
A-15
A-18
A-19
A-24
A-25
A-30
A-31
A-34
A-35
A-37
A-38
A-44
A-45
A-51
A-52
A-57
A-58
A-61
A-62
.....................................................................................................................................................
Oracle Developer: Build Reports
ix
Contents
.....................................................................................................................................................
A-65
A-66
A-69
A-70
A-75
A-76
A-81
A-82
A-90
A-91
B-2
C-3
.....................................................................................................................................................
x
Oracle Developer: Build Reports
Contents
.....................................................................................................................................................
F-21
.....................................................................................................................................................
Oracle Developer: Build Reports
xi
Contents
.....................................................................................................................................................
.....................................................................................................................................................
xii
Oracle Developer: Build Reports
Preface
.................................
Preface
.....................................................................................................................................................
.....................................................................................................................................................
xiv
Oracle Developer: Build Reports
Profile
.....................................................................................................................................................
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 (ILT) courses:
- Introduction to Oracle: SQL & PL/SQL or Introduction to Oracle for
Experienced SQL Users
- Develop PL/SQL Program Units
Or the following computer-based training (CBT) courses from the SQL
* PL/SQL CBT Library:
- SQL and SQL*Plus: Basic SELECT Statements
- SQL and SQL*Plus: DDL and DML
- PL/SQL: Basics
- PL/SQL: Procedures, Functions sand Packages
- PL/SQL: Database Programming
Suggested
Advanced SQL and SQL*Plus (ILT)
Or SQL and SQL*Plus: Advanced SELECT Statements (CBT)
Suggested Follow-up Courses
Oracle Developer: Build Forms I
Oracle Developer: Deploy Web-Based Applications
Oracle Designer: Design and Generate Oracle Developer Applications
How This Course Is Organized
Oracle Developer: Build Reports is an instructor-led course featuring lecture and
hands-on exercises. Online demonstrations and written practice sessions reinforce
the concepts and skills introduced.
.....................................................................................................................................................
Oracle Developer: Build Reports
xv
Preface
.....................................................................................................................................................
Related Publications
Oracle Publications
Title
Oracle Developer: Guidelines for Building Applications
Release 6.0
Oracle Developer Getting Started Release 6.0
Part Number
A58766-02
A58767-02
Additional Publications
Release notes PDF format: <oracle_home>\tools\doc60\relnotes.pdf
Release notes text format: <oracle_home>\tools\doc60\relnotes.txt
System release bulletins
Installation and users guides
read.me files
International Oracle Users Group (IOUG) articles
Oracle Magazine
.....................................................................................................................................................
xvi
Oracle Developer: Build Reports
Typographic Conventions
.....................................................................................................................................................
Typographic Conventions
Typographic Conventions in Text
Convention
Bold italic
Caps and lowercase
Element
Glossary term (if
there is a glossary)
Buttons,
check boxes,
triggers,
windows
Courier new,
case sensitive
(default is
lowercase)
Code output,
directory names,
filenames,
passwords,
pathnames,
URLs,
user input,
usernames
Initial cap
Graphics labels
(unless the term is a
proper noun)
Emphasized words
and phrases,
titles of books
and courses,
variables
Italic
Quotation marks
Uppercase
Interface elements
with long names
that have only
initial caps; lesson
and chapter titles in
cross-references
SQL column
names, commands,
functions, schemas,
table names
Example
The algorithm inserts the new key.
Click the Executable button.
Select the Cant Delete Card check box.
Assign a When-Validate-Item trigger . . .
Open the Master Schedule window.
Code output: debug.seti(I,300);
Directory: bin (DOS), $FMHOME (UNIX)
Filename: Locate the init.ora file.
Password: Use tiger as your password.
Pathname: Open c:\my_docs\projects
URL: Go to http://www.oracle.com
User input: Enter 300
Username: Log on as scott
Customer address (but Oracle Payables)
.....................................................................................................................................................
Oracle Developer: Build Reports
xvii
Preface
.....................................................................................................................................................
Convention
Arrow
Brackets
Commas
Element
Menu paths
Key names
Key sequences
Plus signs
Key combinations
Example
Select File>Save.
Press [Enter].
Press and release these keys one at a time:
[Alt], [F], [D]
Press and hold these keys simultaneously:
[Ctrl]+[Alt]+[Del]
Element
Oracle Forms
triggers
Column names,
table names
Passwords
PL/SQL objects
Lowercase italic
Uppercase
Syntax variables
SQL commands
and functions
Example
When-Validate-Item
SELECT last_name
FROM s_emp;
DROP USER scott
IDENTIFIED BY tiger;
OG_ACTIVATE_LAYER
(OG_GET_LAYER (prod_pie_layer))
CREATE ROLE role
SELECT userid
FROM emp;
.....................................................................................................................................................
xviii
Oracle Developer: Build Reports
I
................................
Introduction
Introduction
......................................................................................................................................................
Objectives
At the end of this section, you should be
able to do the following:
Identify the course objectives
Identify the course content and
structure
......................................................................................................................................................
I-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
This lesson introduces you to the course: the objectives that the course intends to
meet, the topics that it covers, and how the topics are structured over the duration of
the course.
Objectives
At the end of this lesson, you should be able to do the following:
Identify the course objectives
Describe the course content and structure
......................................................................................................................................................
Oracle Developer: Build Reports
I-3
Introduction
......................................................................................................................................................
Oracle Developer
Release 6 Curriculum
ILT
CBT
Seminar
Build Forms I
Form Builder Library
Build Forms II
Build Reports
Course Objectives
At the end of this course, you should be
able to do the following:
Describe the capabilities of Oracle
Developer Reports
Develop and maintain different styles of
reports using Oracle Developer Report
Builder
Lay out and format data to suit user
reporting requirements
Incorporate text and graphics in reports
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
I-4
Oracle Developer: Build Reports
Course Objectives
......................................................................................................................................................
Course Objectives
Course Description
This course enables you to create reports in a variety of styles, customizing them to
meet specific business requirements by combining text and graphics with
quantitative data.
During the course, you develop reports in a client-server environment using the
power and flexibility of the Oracle Developer graphical user interface (GUI).
Course Objectives
By the end of this course you should be able to:
Develop and maintain different styles of reports using Oracle Developer Report
Builder
......................................................................................................................................................
Oracle Developer: Build Reports
I-5
Introduction
......................................................................................................................................................
Course Content
Day 1Basic concepts
Introducing Oracle Developer
Designing and running reports
Creating and modifying reports using
the wizard
Day 2Enhancements
Managing templates
Enhancing report structure and layout
Copyright Oracle Corporation, 1999. All rights reserved.
Course Content
Day 3More enhancements
Customizing reports with parameters
Embedding a chart
Adding PL/SQL code
Day 4Additional features
Using built-in packages
Scheduling remote reports
Building reports for different environments
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
I-6
Oracle 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 Oracle Developer
Designing and Running Reports
Report Builder Concepts
Creating Reports Using the Report Wizard
Enhancing Reports in the Live Previewer
Day 2
Managing Report Templates
Report Storage Methods
Enhancing Reports Using the Data Model: Creating Queries and Groups
Enhancing Reports Using the Data Model: Creating Columns
Enhancing Reports Using the Layout Model
Day 3
Modifying Properties
Creating and Using Report Parameters
Embedding a Chart in a Report
Enhancing Matrix Reports
Coding PL/SQL Triggers in Reports
Day 4
Using the Report Builder Built-In Package
Maximizing Performance Using the Reports Server
Building Reports for Different Environments
......................................................................................................................................................
Oracle Developer: Build Reports
I-7
Introduction
......................................................................................................................................................
......................................................................................................................................................
I-8
Oracle Developer: Build Reports
1
................................
Introduction to
Oracle Reports
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Describe common features of Oracle
Developer
Describe Oracle Developer components
Describe common builder components
Navigate around the Report builder
interface
Customize the Oracle Reports session
Describe the course application
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
1-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
This course teaches you to build effective and professional reports using Oracle
Reports. This is only one component of Oracle Developer, and it is useful for you to
understand the whole suite of components and the capabilities of Oracle Developer in
building consistent, integrated applications.
This lesson identifies the key and common features of Oracle Developer, the Oracle
Developer components, the Oracle Reports interface, and the course application model
and contents.
Objectives
At the end of this lesson, you should be able to do the following:
Describe the common features of Oracle Developer
Describe the Oracle Developer components
Describe the common builder components
Navigate around the Oracle Reports interface
Customize the Oracle Reports session by modifying builder preferences
Describe the course application
......................................................................................................................................................
Oracle Developer: Build Reports
1-3
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Oracle Designer
Oracle Developer
Oracle Discoverer
Supported
technologies
GUI
Database
Client-Server
World Wide
Web
......................................................................................................................................................
1-4
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-5
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Key Features
Comprehensive GUI support
Distributed applications
Productive and comprehensive tools
Application partitioning
Flexible source control
Extended scalability
Object orientation
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
1-6
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-7
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Translation
Builder
Form
Builder
Report
Builder
Graphics
Builder
Procedure
Builder
Query
Builder
Schema
Builder
Database Interface
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
1-8
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-9
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Translation
Builder
Form
Builder
Report
Builder
Graphics
Builder
Procedure
Builder
Query
Builder
Schema
Builder
Database Interface
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
1-10
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-11
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
......................................................................................................................................................
1-12
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-13
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
PL/SQL Development
Environment: Syntax Palette
......................................................................................................................................................
1-14
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-15
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Getting Started
Starting the builders:
Invoke individual builder icons
Invoke from Oracle 6.0 group
......................................................................................................................................................
1-16
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-17
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
......................................................................................................................................................
1-18
Oracle Developer: Build Reports
Description
Underline
Ellipsis (...)
>
Windows menu
Help
List of help facilities, such as online help text, Cue Cards, Quick Tour
Description
File
Edit
View
Navigator
Program
Tools
......................................................................................................................................................
Oracle Developer: Build Reports
1-19
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
......................................................................................................................................................
1-20
Oracle Developer: Build Reports
Preference Name
Description
General
Suppress Report
Editor on Open
Unit of Measurement
Access
Access
Wizards
Welcome Dialog
......................................................................................................................................................
Oracle Developer: Build Reports
1-21
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Modified preferences
......................................................................................................................................................
1-22
Oracle Developer: Build Reports
Preference Filename
Microsoft Windows
cauprefs.ora
Motif
prefs.ora
Note: The preferences file is an editable text file. However, where possible, you
should alter the options in the Preferences dialog box.
......................................................................................................................................................
Oracle Developer: Build Reports
1-23
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
......................................................................................................................................................
1-24
Oracle Developer: Build Reports
Description
REPORTS60_PATH
UI _ICON
A path that all builders search for icon files at run time
......................................................................................................................................................
Oracle Developer: Build Reports
1-25
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
......................................................................................................................................................
1-26
Oracle Developer: Build Reports
Description
Help Topics
Quick Tour
Cue Cards
These appear as separate windows that give simple stepby-step instructions and examples to help novice users
learn basic functionality.
Manuals
Most of the Help features are optional extras during product installation, and they
require additional resources.
......................................................................................................................................................
Oracle Developer: Build Reports
1-27
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
s_item
s_customer
s_inventory
s_product
s_image
s_emp
s_warehouse
s_dept
s_region
......................................................................................................................................................
1-28
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-29
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Summary
Oracle Developer common features
Report Builder interface
Report Builder preferences
The SUMMIT course application
......................................................................................................................................................
1-30
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
......................................................................................................................................................
Oracle Developer: Build Reports
1-31
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Practice 1 Overview
Navigating through the Oracle Reports
interface
Investigating Help topics
......................................................................................................................................................
1-32
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
1-33
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
Run-time values:
c What is the purpose of the run-time values?
d
What are the names of the three run-time values that affect the report
destination, and what are the three related report parameters?
......................................................................................................................................................
1-34
Oracle Developer: Build Reports
8 Use Help Topics to discover more about the functionality of Oracle Developer
Report Builder:
a What is MAPI?
b
Information Navigator:
Note: In the Information Navigator, choose Tools>Preferences to initialize your
Web browser. Your instructor will tell you which browser to use.
a What are the three top-level folder names for the online manuals?
b
In the Getting Started manual, what are the five topics included in
Administrative Procedures?
......................................................................................................................................................
Oracle Developer: Build Reports
1-35
Lesson
1: Introduction to Oracle Reports
......................................................................................................................................................
10 Use Quick Tour to find out how to prepare a report for the World Wide Web.
a
......................................................................................................................................................
1-36
Oracle Developer: Build Reports
2
................................
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Name the common report styles
Describe the structure of each style
Run prebuilt reports using the Run-time
executable
Distinguish between the various report
output destinations
View report output in the Previewer
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
2-2
Oracle 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 solutions, you need to
understand the potential range of report styles and gain an appreciation of the
underlying structure. This helps you to make the right decision about which style to
use for the report.
This lesson discusses examples of standard report design styles and describes how
to run existing reports to various output destinations.
Objectives
At the end of this lesson, you should be able to do the following:
Name the common report styles required in a business report
Describe the structure of common report styles
Run prebuilt reports using the Reports Runtime executable
Distinguish between the various report destinations
View report output in the Previewer
......................................................................................................................................................
Oracle Developer: Build Reports
2-3
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Designing Reports
Before you start development, consider:
Specification
Data retrieval
Structure
Common features
Style
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
2-4
Oracle Developer: Build Reports
Designing Reports
......................................................................................................................................................
Designing Reports
Introduction
Before you create a report using any report-writing software, you must first consider
the type of reports that you are being asked to produce. You will have a
specification of the required output, but you also need to know the structure that is
required and the most efficient way to retrieve data.
Also, consider whether this is a one-time requirement, or whether this specification
shares common features with other reports, especially where multiple reports are
required in the same application.
There are a few standard styles of reports that form the majority of all reporting
requirements. This section teaches you to recognize the common styles in order to
enable you to interpret your report requirements and choose the correct style when
developing report definitions.
The Common Report Styles
The majority of report requirements fall into the following categories:
Tabular
Master-detail
Master and multiple details
Matrix
......................................................................................................................................................
Oracle Developer: Build Reports
2-5
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Tabular
List of Products
Product
Number Description
Price
......................................................................................................................................................
2-6
Oracle 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 report and the group structure for
each.
Tabular Report Style
In the List of Products report displayed opposite, all fields for each product number,
product description, and price are printed with the same frequency. They each repeat
a value for every product record.
This report structure contains a single group.
In Tabular reports, the headings or labels appear once above each field.
......................................................................................................................................................
Oracle Developer: Build Reports
2-7
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Master-Detail
Outstanding Customer Items
Customer Name
Product
Number Price
Customer Name
Product
Number Price
......................................................................................................................................................
2-8
Oracle Developer: Build Reports
Design Considerations
......................................................................................................................................................
Label Placement
Master
Detail
......................................................................................................................................................
Oracle Developer: Build Reports
2-9
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Price
Date
Total Value
......................................................................................................................................................
2-10
Oracle Developer: Build Reports
Design Considerations
......................................................................................................................................................
......................................................................................................................................................
Oracle Developer: Build Reports
2-11
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Matrix
Customer Matrix
Product ID
Customer
......................................................................................................................................................
2-12
Oracle Developer: Build Reports
Design Considerations
......................................................................................................................................................
......................................................................................................................................................
Oracle Developer: Build Reports
2-13
Lesson
2: Designing and Running Reports
......................................................................................................................................................
......................................................................................................................................................
2-14
Oracle Developer: Build Reports
Number of Queries
1
1 or 2
2 or 3
1, 2 , or 3
......................................................................................................................................................
Oracle Developer: Build Reports
2-15
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Running a Report
Use the RWRUN60 executable from:
Front end menu
Menu integrated with a Forms
application
Button in a Forms application
Command line (Start>Run)
Run-time option in your Windows menu
Connect to database
Enter parameters
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
2-16
Oracle Developer: Build Reports
Running a Report
......................................................................................................................................................
Running a Report
Introduction
To run a report created with Oracle Reports, you use the executable program called
RWRUN60.
Invoking a Report
There can be many ways of invoking a report, depending on the application design.
You can call a report from:
A front-end menu
A customized menu in a Forms application
A button in a Forms application
The command line, using the Start>Run option in Windows NT
The Reports Runtime item in your Windows menu
Whichever method you use, RWRUN60 is the command that is executed behind the
scenes.
How to Run a Report from the Microsoft Windows NT Menu
1 Choose the Reports Runtime item from the Oracle Developer R6.0 menu.
2 You must connect to the database. In the File>Connect dialog box enter your
username, password, and database alias. Choose Connect.
Note: If you are connecting to your default database, you do not need to specify
the alias.
3 Choose File>Run. In the file selection dialog box search through the list of
reports, select the report you want to run, and choose OK. You may need to
change your drive or directory. If so, amend the Drives list.
The Runtime Parameter Form is displayed for some reports. This allows you to
enter different run-time values, such as the report destination.
4 Enter the parameter values required and choose Run Report. You can cancel the
report by choosing Cancel.
......................................................................................................................................................
Oracle Developer: Build Reports
2-17
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Report Destinations
Screen: format with screen fonts
Preview: format with printer fonts
File: choose file format
Mail: MAPI-compliant
Printer: output direct to printer
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
2-18
Oracle Developer: Build Reports
File
Printer
Mail
Actual Destination
Routes the output to the Previewer for interactive viewing. Useful
when viewing output on the screen only.
Routes the output to the Previewer for interactive viewing when
users require subsequent printing of the output.
However, Previewer causes the output to be formatted using a
printer font. The Previewer uses Destination Name to determine
which printers fonts to use to display the output.
Saves the output to a file named in Destination Name. The format
depends on the Destination Format; this can be a printer definition
or a browser format, such as PDF and HTML.
Routes all output directly to the printer named in
Destination Name.
Sends the output to a user of Oracle Mail, Oracle Office, Oracle
InterOffice, or any MAPI-compliant mail system. Username is
specified in Destination Name.
Note: A report can be output to multiple destinations in one single run of the report.
......................................................................................................................................................
Oracle Developer: Build Reports
2-19
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Previewing Reports
1
Help: Previewer
Next, Last
......................................................................................................................................................
2-20
Oracle Developer: Build Reports
Previewing Reports
When you specify a destination of Screen or Preview, your formatted report output
appears in the Report Previewer.
You can navigate the screen, view each page, and even split the screen and scroll
separately through each portion.
The Previewer Window
The Previewer has three components:
Component
Description
Main Menu
Title
Viewing
Region
The area where you browse through each page of your report, using buttons
to navigate, split screens, or open a new Previewer window
Description
First Page
Go to first page
Previous Page
Go to previous page
Next Page
Go to next page
Last Page
Go to last page
Page
Print Setup
Help
......................................................................................................................................................
Oracle Developer: Build Reports
2-21
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Previewing Reports
2
4
Copyright Oracle Corporation, 1999. All rights reserved.
Previewer options
2
......................................................................................................................................................
2-22
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
2-23
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Viewing Options
Screen and Preview use different fonts
for formatting
Screen: screen fonts
Preview: printer fonts
......................................................................................................................................................
2-24
Oracle Developer: Build Reports
Description
Formats the output using the screen font that you specify in the
Layout. It does not consider printer fonts.
Formats the output as if it were being sent to the printer. It uses
printer fonts to format, but uses the screen fonts to display.
Using Preview gives you a better impression of how the printed result will appear. If
users are likely to print reports after viewing in the Previewer, ensure that the
destination is always Preview.
......................................................................................................................................................
Oracle Developer: Build Reports
2-25
Lesson
2: Designing and Running Reports
......................................................................................................................................................
......................................................................................................................................................
2-26
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
2-27
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Summary
Designing reports
Design structure
Database access
Common objects and code
Executing reports
Output destinations
Screen or printer fonts
......................................................................................................................................................
2-28
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
Designing Reports
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 structure
Realize the importance of database access and report performance, and consider
this for every report you design
Consider at the very early stages of development usage of common code and
objects
Executing Reports
You have seen that there are a number of different ways to execute a report, all of
which use the RWRUN60 executable.
A report can have a run-time parameter form, allowing user input to control
report data and output.
Output can be to one of a number of different destinations, such as screen, file,
or printer.
If you choose a destination of Screen or Preview, you view the output in the
Previewer window, where you can control many options including what page to
view, magnify text, split screen, and the number of Previewer windows open.
......................................................................................................................................................
Oracle Developer: Build Reports
2-29
Lesson
2: Designing and Running Reports
......................................................................................................................................................
Practice 2 Overview
Invoking the Reports Runtime
executable
Executing existing reports
......................................................................................................................................................
2-30
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
2-31
Lesson
2: Designing and Running Reports
......................................................................................................................................................
......................................................................................................................................................
2-32
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
2-33
Lesson
2: Designing and Running Reports
......................................................................................................................................................
......................................................................................................................................................
2-34
Oracle Developer: Build Reports
3
................................
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Describe the main Report executables
Describe the main components of
Report Builder
Describe the main objects in a report
......................................................................................................................................................
Oracle Developer: Build Reports
3-2
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Overview
Introduction
This lesson describes the Report executables and gives an overview of Report Builder,
including a high-level description of its components and object hierarchy.
Objectives
At the end of this lesson, you should be able to do the following:
Describe the main Report executables
Describe the main components of Report Builder
Describe the main objects in a report
......................................................................................................................................................
3-3
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Executables
Development and run-time
Report Builder
RWBLD60
Report Runtime
RWRUN60
Report Converter
RWCON60
run report
RWISV60
run report
RWCLI60
Queue Manager
RWRQM60
......................................................................................................................................................
Oracle Developer: Build Reports
3-4
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Report Executables
Introduction
Report executable filenames are operating-system specific.
In Windows, all Reports executables follow a similar pattern: RW<?>60.EXE.
For simplicity, the 32 suffix and .exe file extension are not included in the following
table.
What Are the Main Reports Executables?
Windows
Filename
Executable
Title
Description
RWBLD60
Report Builder
RWRUN60
Report Runtime
RWCON60
Report Converter
RWMTS60
Report Server
RWCLI60
Report Client
RWRQM60
RWRBE60
Report Background
Engine
RWISV60
Interactive Server
......................................................................................................................................................
3-5
Oracle Developer: Build Reports
Report Executables
......................................................................................................................................................
......................................................................................................................................................
Oracle Developer: Build Reports
3-6
Lesson
3: Report Builder Concepts
......................................................................................................................................................
......................................................................................................................................................
3-7
Oracle Developer: Build Reports
Report Executables
......................................................................................................................................................
Modules
SELECT...
FROM...
Report
Query
Template
PL/SQL Library
......................................................................................................................................................
Oracle Developer: Build Reports
3-8
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Description
Report
A report definition
Query
An external query stored in a text file, or on the database, that you can
reference from or copy into a report definition
Template
PL/SQL
Library
......................................................................................................................................................
3-9
Oracle Developer: Build Reports
Report Editor
......................................................................................................................................................
Oracle Developer: Build Reports
3-10
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Description
Data Model
Layout Model
Displays the layout objects in a report and allows you to make many
modifications to any layout object. All layout objects have properties
that you can modify in a property palette.
The hierarchy of the layout objects is determined by the Data Model.
Description
Live Previewer
Parameter Form
Displays the layout of the parameter form that, at run time, allows
user-input of parameter values.
The Live Previewer displays the report output as it appears when printed. The other
three views contain their own specific objects.
You can create many fully functional reports simply by using the wizard and
modifying the report in the Live Previewer. However, this course also teaches you in
later lessons how to use the Data Model, Layout Model, and Parameter Form so that
you can create more complex reports if necessary.
......................................................................................................................................................
3-11
Oracle Developer: Build Reports
Report
Properties
Triggers
Layout
Model
Parameter
Form
PL/SQL
program
units
......................................................................................................................................................
Oracle Developer: Build Reports
3-12
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Object Categories
Introduction
The Report Module consists of many objects that fall into the following four
categories:
Report level
Data Model
Layout Model
Parameter Form
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
Properties
Triggers
Description
Define page dimensions and Previewer settings, for example
Allow PL/SQL to be executed at different stages of the report
execution
PL/SQL Program Units Contain functions and procedures that can be called from
report-level objects in the same report
......................................................................................................................................................
3-13
Oracle Developer: Build Reports
Object Categories
......................................................................................................................................................
Columns
Queries
Data
links
Parameters
Groups
Columns
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
Oracle Developer: Build Reports
3-14
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Data Link
Parameter
Description
Select the data for your report
Organize the data to form the required hierarchical structure
Contain individual data values; database columns exist by default
and contain data from the database columns or expressions defined
in the query; you can also create Formula, Summary, and
Placeholder column types
Join queries for complex data relationships
Provide for run-time defaults or user input; system parameters exist
by default; you can also create User Parameters
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.
......................................................................................................................................................
3-15
Oracle Developer: Build Reports
Object Categories
......................................................................................................................................................
Frames
Repeating
Fields Boilerplate
frames
OLE2
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
Oracle Developer: Build Reports
3-16
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Layout Objects
The Layout Model objects define the format of the report including the positioning
and appearance of data, text, and graphics. The main layout objects fall into the
following categories:
Object
Repeating frame
Frame
Field
Boilerplate
Description
Contains other objects and prints once for each record of the
associated group
Contains other objects and prints only once
Contains data and other variable values and their formats
Contains text or graphics that may appear anywhere in the
report
These and other layout objects are discussed later in the course.
OLE2 Support
Report Builder supports the use of OLE2. The Layout Model includes an OLE2 tool
that allows you to create an OLE2 container and define the contents.
......................................................................................................................................................
3-17
Oracle Developer: Build Reports
Object Categories
......................................................................................................................................................
Fields
Boilerplate
......................................................................................................................................................
Oracle Developer: Build Reports
3-18
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Description
Contains parameter values
Contains constant text or graphics that appear on the run-time
parameter form
Note: The Parameter Form controls the layout of the run-time parameter form. The
objects are similar to 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.
......................................................................................................................................................
3-19
Oracle Developer: Build Reports
Object Categories
......................................................................................................................................................
Object Interrelationship
1
Select
...
2
3
Each query fetches data records and structures them in the group
hierarchy.
......................................................................................................................................................
Oracle Developer: Build Reports
3-20
Lesson
3: Report Builder Concepts
......................................................................................................................................................
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.
Data Model Objects
A query fetches records from the database.
Each fetched record becomes an instance of the related group.
Each database value is fetched into the related column.
Layout Objects
A column provides the value that is displayed in one or more layout fields.
A field must display all instances of its related column value; therefore, each
record instance of a group is represented by a repeating frame that contains all
the relevant fields.
......................................................................................................................................................
3-21
Oracle Developer: Build Reports
Object Categories
......................................................................................................................................................
Summary
Executables for development and
deployment
Report Builder modules:
Report, Template, External Query,
PL/SQL Library
Report editor: switch views
Live Previewer, Data Model, Layout
Model, Parameter Form
Object categories:
Report, Data, Layout, Parameter
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
Oracle Developer: Build Reports
3-22
Lesson
3: Report Builder Concepts
......................................................................................................................................................
Summary
Oracle Developer provides a number of executables for developing and deploying
reports, including Report Builder.
The Report Builder interface allows you to develop four types of modules, including
report definitions.
Report 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 allows you to switch views, depending on the objects that you want
to modify.
Objects in a Report module fall into four categories: Report, Data Model, Layout
Model, and Parameter Form.
......................................................................................................................................................
3-23
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Practice 3 Overview
Invoking Report Builder
Opening an existing report
Switching views in the Report editor
Accessing the Help system
......................................................................................................................................................
Oracle Developer: Build Reports
3-24
Lesson
3: Report Builder Concepts
......................................................................................................................................................
......................................................................................................................................................
3-25
Oracle Developer: Build Reports
2
3
invoke Report Builder from the Project Builder launchpad toolbar. If it is still
open, go to Report Builder.
Open and run an existing report: p3q2.rdf.
In the Report editor, switch to the Data Model view.
In the Object Navigator, select Q_1.
Hint: Use the Find field at the top of the Object Navigator.
Notice the object that is selected in the Data Model view.
In the Report editor, switch to the Layout Model.
In the Object Navigator, select F_ID.
Hint: Use the Find field at the top of the Object Navigator.
Notice the object that is selected in the Layout Model view.
Fully expand the Layout Model node and select R_G_ORD_ID.
Notice the object that is selected in the Layout Model view.
In the Report editor, switch to the Parameter Form view.
In the Object Navigator, expand the Parameter Form node. Select
PF_DESTYPE. Notice the object that is selected in the Parameter Form.
Use the Find field at the top of the Object Navigator to select P_CUSTID. Is any
object selected in the Parameter Form? What is the reason?
Use Help Topics to answer the following questions:
a What is RWMTS60?
What is RWCLI60?
......................................................................................................................................................
Oracle Developer: Build Reports
3-26
4
................................
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Objectives
At the end of 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
Create other report styles available in
the wizard
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
4-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
In this lesson you learn how to create a simple tabular report and modify the report by
adding data and altering the report style. This lesson also shows you how to create
other styles of report that are available from the Report wizard.
Objectives
At the end of this lesson, you should be able to:
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 wizard
......................................................................................................................................................
Oracle Developer: Build Reports
4-3
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-4
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-5
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-6
Oracle Developer: Build Reports
Description
Type
Select the query type on which you want to base your report.
Data
Fields
Totals
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 report. A template contains
standard information such as company logo, date, and so on.
Query Types
On the second page, the Report Wizard enables you to choose whether to build a SQL
query or an Express query.
Note: Express delivers online analytical processing (OLAP) with capabilities that
include forecasting, what-if scenarios, and financial modeling. Based on a
multidimensional data model, Express is optimized for the query and analysis of
corporate data such as sales, marketing, financial, manufacturing, and human resource
data.
......................................................................................................................................................
Oracle Developer: Build Reports
4-7
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Building a Query
......................................................................................................................................................
4-8
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-9
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Column sequence
Define column
Sort
......................................................................................................................................................
4-10
Oracle Developer: Build Reports
Description
Column Sequence
Define Column
Sort
Defines the ORDER BY clause; select the columns that you want to
be sorted, and choose Ascending or Descending sorting order
WHERE and
HAVING clauses
Place the cursor in the Conditions box on the left side of the Query
Builder window. Type a condition. Use the AND, OR, and NOT
buttons to create compound conditions.
......................................................................................................................................................
Oracle Developer: Build Reports
4-11
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-12
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-13
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-14
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-15
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-16
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-17
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Zoom buttons
Magnify tool
Page buttons
......................................................................................................................................................
4-18
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-19
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
File>Save As...
xxx.rdf
yyy.rdf
......................................................................................................................................................
4-20
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-21
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-22
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-23
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Report node
......................................................................................................................................................
4-24
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-25
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Department
xxxxx
xxxxxx
xxxxxx
xxxxxxx
xxxxx
xxx
Group Above
Region
xxxxxxxx
Department xxxxx
Last Name
Title
xxxx
xxxxxxxx
xxxxxxxx
xxxx
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
4-26
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-27
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-28
Oracle Developer: Build Reports
Output
LAST_NAME
&<LAST_NAME>
LAST_NAME
Velasquez
LAST_NAME
Ngao
The optional angled brackets allow you to display two variables side by side with no
separating space.
What Is the Difference Between Mailing Labels and Form Letters?
Mailing Label
Form Letter
......................................................................................................................................................
Oracle Developer: Build Reports
4-29
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-30
Oracle Developer: Build Reports
Description
Rows
The field to be displayed vertically down the left side of the matrix; you can
choose multiple levels of rows to create a vertically nested matrix
Columns
The field values to be displayed horizontally across the top of the matrix;
you can choose multiple levels of columns to create a horizontally nested
matrix
Cell
The field value that becomes the cell, or cross-product, of the matrix
Description
Position in Output
Row
Column
Report
......................................................................................................................................................
Oracle Developer: Build Reports
4-31
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Summary
Rapidly create reports with the Report
Wizard.
Build queries using the Query Builder.
Apply templates to reports.
Modify reports by reentering the wizard.
Create new reports of different styles.
......................................................................................................................................................
4-32
Oracle 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 wizard is reenterable; it retains all your previous setting, and allows you to modify
any settings by selecting the relevant tabbed page.
......................................................................................................................................................
Oracle Developer: Build Reports
4-33
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Practice 4 Overview
Creating a Tabular report
Modifying the report, to create a Group
Above break report
Creating a Form Letter
Creating a Matrix report
Creating a Matrix with Group report
......................................................................................................................................................
4-34
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
4-35
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
Display all fields. Do not make any changes to the other wizard pages.
2 Using the reentrant Report wizard, make the following modifications; testing
your report frequently:
a Modify the query to sort the data in descending order of salary.
b Add a summary to show the total salary value.
c Reduce the width of SALARY and TOTAL to 6.
d Change the COMMISSION_PCT label to Comm and reduce the
width to 4.
e Save the report to a file named p4q2.rdf.
3 Using the reentrant wizard, modify the report to create a break report.
a Choose report style Group Above.
b Group the report by the department name.
c Choose the template called Bright 1.
d Save the report as p4q3.rdf.
......................................................................................................................................................
4-36
Oracle Developer: Build Reports
In the text area, include all four customer fields, with each field on a
new line.
e Select the template Draft and choose Finish.
f Save the report to a file named p4q4.rdf.
5 Using the reentrant wizard, modify the report to create a Form Letter style.
a In the text area, enter some free-flowing text for each order. For
example:
Order No. &<ID> was shipped to &<NAME> in &<CITY> on
&<DATE_SHIPPED>.
b The order has a total value of &<TOTAL> dollars.
c Select a different template and choose Finish.
d Save the report as p4q5.rdf.
6 Create a new report.
a Choose Matrix Report style.
b For the query, import the contents of p4q6.sql.
c Display customer names down the left side of the page.
d Display product numbers across the top of the page.
e Display the sum of total value in the cells.
f Create a summary to give the total of the sum(total_value) values.
g Reduce the widths of PRODUCT_ID to 5 and all four summaries
to 7.
h Change the PRODUCT_ID label to Product.
i Choose a template that gives Landscape output.
j Save the report to a file named p4q6.rdf.
d
Lesson
4: Creating Reports Using the Report Wizard
......................................................................................................................................................
......................................................................................................................................................
4-38
Oracle Developer: Build Reports
5
................................
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Describe the report Live Previewer
Modify the display of report data in the
Live Previewer
Modify the positioning of report data
Highlight data using conditional
formatting
Add page numbering and current date
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
5-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
In this lesson you learn to enhance your reports with the most commonly required
changes, while viewing the live run-time output in the new Live Previewer in Report
Builder.
Objectives
At the end of this lesson, you should be able to do the following:
Describe the report Live Previewer
Modify the display of report data in the Live Previewer
Modify the positioning of report data in the Live Previewer
Highlight data using conditional formatting
Add page numbering and the current date to a report.
......................................................................................................................................................
Oracle Developer: Build Reports
5-3
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
4
Copyright Oracle Corporation, 1999. All rights reserved.
Toolbar
Tool palette
Stylebar
Status bar
......................................................................................................................................................
5-4
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
5-5
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
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
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
5-6
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
5-7
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
Aligning Columns
Point and
select
Choose
end justify
......................................................................................................................................................
5-8
Oracle Developer: Build Reports
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 Choose the end justify icon on the stylebar.
Aligning Multiple Objects
You can align each object separately, so that you can center the labels if you want.
However, if you want to align the values and the labels to the right, use shift-click to
select more than one object at one time.
......................................................................................................................................................
Oracle Developer: Build Reports
5-9
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
1 2 3 4 5
Currency symbol
Percentage symbol
Thousand separator
......................................................................................................................................................
5-10
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
5-11
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
Manipulating Objects
Clear fields
Move fields
Resize fields
......................................................................................................................................................
5-12
Oracle Developer: Build Reports
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. The default is that Flex Mode is enabled, so that all report objects flex, or
adjust, to make room for your modifications.
......................................................................................................................................................
Oracle Developer: Build Reports
5-13
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
-Sales Report -
Year
1993
1993
1993
Region
Sales
Americas
200
Europe
400
Asia Pacific 770
Year
1993
1993
1993
Region
Sales
Americas
200
Europe
400
Asia Pacific 770
Year
1994
1994
Region
Americas
Europe
Year
1994
1994
Region
Americas
Europe
Sales
210
390
Sales
210
390
Year
Region
Sales
1993
1993
1993
Year
Americas
200
Europe
400
Asia
Pacific
770
Region
Sales
1994
1994
Americas
Europe
210
390
......................................................................................................................................................
5-14
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
5-15
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
......................................................................................................................................................
5-16
Oracle Developer: Build Reports
Conditional Formatting
You can highlight or suppress objects using conditional formats.
How to Create Format Exceptions
1 Select an object.
2 Display the pop-up menu and choose Conditional Formatting, or choose
Format>Conditional Formatting from the menu.
3 Create a new format exception.
4 Specify the conditions as required.
5 Set the format attributes as required.
6 Create further format exceptions as required.
7 Choose OK.
Formatting is applied in the order that the format exceptions are listed; a format
exception overrides a previous format exception if both evaluate to TRUE.
You can select a format exception in the Format Exceptions list and move it up or
down. You can also drag and drop items in the list.
......................................................................................................................................................
Oracle Developer: Build Reports
5-17
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
Before
After
......................................................................................................................................................
5-18
Oracle Developer: Build Reports
Description
Insert Page
Number
Insert Date/
Time
Use this button to add the current date and time to the margin of a report.
You can define your own date and time format masks.
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, choose Tools>Preferences>Edit Masks.
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, choose 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. Choose Help>
Find>Date Syntax, and choose Date and Time Format Mask Syntax from the list of
topics.
......................................................................................................................................................
Oracle Developer: Build Reports
5-19
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
Summary
Enhance report output using live data
Move, resize, delete objects
Edit text
Alter fonts, colors, and patterns
Apply format masks
Add page numbering and current date
......................................................................................................................................................
5-20
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
Features of the Live Previewer
The Live Previewer is a WYSIWYG editor that allows 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 page and
date buttons allow you to add page numbering and the current date, selecting
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 Live Previewer.
When you save the report, all changes become part of your report definition and
always appear at run time in the future.
......................................................................................................................................................
Oracle Developer: Build Reports
5-21
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
Practice 5 Overview
Modifying reports by applying changes in
the Live Previewer
......................................................................................................................................................
5-22
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
5-23
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
......................................................................................................................................................
5-24
Oracle Developer: Build Reports
4 Open report p4q6.rdf. Make the following changes in the Live Previewer:
a
b
c
d
e
......................................................................................................................................................
Oracle Developer: Build Reports
5-25
Lesson
5: Enhancing Reports in the Live Previewer
......................................................................................................................................................
......................................................................................................................................................
5-26
Oracle Developer: Build Reports
6
................................
Managing Report
Templates
Lesson
6: Managing Report Templates
......................................................................................................................................................
Objectives
At the end of 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 report template
Register a customized template in the
predefined template list
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
6-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
In this lesson you learn how to open and modify predefined Oracle Developer report
templates and how to register a customized template in the predefined template list.
Objectives
At the end of 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 report template
Register a customized template in the predefined template list
......................................................................................................................................................
Oracle Developer: Build Reports
6-3
Lesson
6: Managing Report Templates
......................................................................................................................................................
Installation templates in
<oracle_home>\report60\admin\template\us>
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
6-4
Oracle Developer: Build Reports
Description
Predefined
Template File
No Template
......................................................................................................................................................
Oracle Developer: Build Reports
6-5
Lesson
6: Managing Report Templates
......................................................................................................................................................
Modifying a Template
Body
Margin
......................................................................................................................................................
6-6
Oracle 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 report definition.
The Template Regions
The Template editor allows you to modify existing objects in the templates margin
and body regions. You can also customize or add other reports objects: parameters,
report-level triggers, program units, and attached PL/SQL libraries.
Region
Description
Body
Contains default section to apply changes to all report styles and override
sections to apply individual changes to different report styles
Margin
......................................................................................................................................................
Oracle Developer: Build Reports
6-7
Lesson
6: Managing Report Templates
......................................................................................................................................................
......................................................................................................................................................
6-8
Oracle Developer: Build Reports
Modifying a Template
......................................................................................................................................................
......................................................................................................................................................
Oracle Developer: Build Reports
6-9
Lesson
6: Managing Report Templates
......................................................................................................................................................
......................................................................................................................................................
6-10
Oracle Developer: Build Reports
Modifying a Template
......................................................................................................................................................
......................................................................................................................................................
Oracle Developer: Build Reports
6-11
Lesson
6: Managing Report Templates
......................................................................................................................................................
"Corporate
"Corporate 11 Landscape",
Landscape",
"My
"My Template
Template Description",
Description",
draft,
draft,
char1)
char1)
"Bright
"Bright 1",
1",
Draft,
Draft,
"Character
"Character Mode")
Mode")
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
6-12
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
6-13
Lesson
6: Managing Report Templates
......................................................................................................................................................
......................................................................................................................................................
6-14
Oracle Developer: Build Reports
Image Name
Report Style
corp1
corp1a.bmp
Group Above
corp1f.bmp
Form
corp1g.bmp
corp1l.bmp
Group Left
corp1m.bmp
Mailing Label
corp1r.bmp
Form Letter
corp1t.bmp
Tabular
corp1x.bmp
Matrix
......................................................................................................................................................
Oracle Developer: Build Reports
6-15
Lesson
6: Managing Report Templates
......................................................................................................................................................
Summary
Modify existing templates to create your
own user-defined template
......................................................................................................................................................
6-16
Oracle 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 report in the Report wizard.
The template contains default and override sections.
Default section: Modify objects to affect all styles of report 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.
......................................................................................................................................................
Oracle Developer: Build Reports
6-17
Lesson
6: Managing Report Templates
......................................................................................................................................................
Practice 6 Overview
Customizing an existing template
Applying the modified template to an
existing report
......................................................................................................................................................
6-18
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
6-19
Lesson
6: Managing Report Templates
......................................................................................................................................................
Open p4q3.rdf.
Apply summit.tdf to the report.
The report shows some changes but not all. Which template changes
have been applied, and which have not?
To apply all changes to your report you will have to create the layout
again. From the menu choose Edit>Select All to select all layout
objects. Now delete them. Invoke the Report wizard and reapply
your template.
Save the report as p6q2.rdf.
......................................................................................................................................................
6-20
Oracle Developer: Build Reports
Change the text color of the master group fields to red for the Group
Left style only.
Hint: In the Template editor, use the Report Style list to switch to a Group Left
style. This way you can select the correct group. You may also want to use the
Zoom Out tool, so that you can see the entire template layout structure, and
recognize the difference between the master group fields and the detail group
fields.
b Save your template as summit2.tdf and close it.
c Create a new report using the Report wizard.
Use the layout style Group Left.
Import the query p6q3.sql from your working directory.
Make NAME the group field.
Display all other columns.
Do not create summaries.
Change the width of SALARY to 6 and COMM to 4.
Apply the Template file summit2.tdf.
Save the report as p6q3.rdf and close it.
a
......................................................................................................................................................
Oracle Developer: Build Reports
6-21
Lesson
6: Managing Report Templates
......................................................................................................................................................
......................................................................................................................................................
6-22
Oracle Developer: Build Reports
7
................................
Lesson
7: Report Storage Methods
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Distinguish between different storage
methods of report definitions
Compare report file types and their
portability
Convert reports to different storage
types
Upgrade report and printer definition
files from Developer/2000 Release 1
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
7-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
When you save a report definition, you have the choice of storing it in the file
system or in the database. In this course we use the file system.
This lesson identifies the various methods of storing report definitions. It also
covers the different file types associated with report building, and portability issues
that apply in cross-platform deployment.
Objectives
At the end of this lesson, you should be able to do the following:
Distinguish the different storage methods of report definitions
Compare report file types and their portability
Convert reports to different storage types
Upgrade report and printer definition files from Release 1
......................................................................................................................................................
Oracle Developer: Build Reports
7-3
Lesson
7: Report Storage Methods
......................................................................................................................................................
Storage Methods
Options:
File system
Database
Considerations:
Application management
Storage restrictions
Description
.rdf
.rep
.rex
......................................................................................................................................................
7-4
Oracle Developer: Build Reports
Creation
File>Save
File>Save as
File>Administration
>Convert
Format
Binary executable,
modifiable in Report
Builder
Features
Full report
definition,
and executable in
one file
Reduced size of
executable,
prevents user
modification
For a full list of supported files, in addition to report files, see the online Help:
Contents>Report Builder Reference>Storage>Supported Files
......................................................................................................................................................
Oracle Developer: Build Reports
7-5
Lesson
7: Report Storage Methods
......................................................................................................................................................
Database Storage
File
or
database?
Save
Report
Builder
Database
Full exportable
definition
Report on reports
Product tables
Central repository
......................................................................................................................................................
7-6
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
7-7
Lesson
7: Report Storage Methods
......................................................................................................................................................
Documenting Reports
Run Report Builder utility
File>Administration>Report on Reports
Document multiple reports using wildcards:
% and _
Modify installation reports
<oracle_home>\report60\srwdoclb.rdf>
<oracle_home>\report60\srwdocpb.rdf>
......................................................................................................................................................
7-8
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
7-9
Lesson
7: Report Storage Methods
......................................................................................................................................................
File Portability
Portable as text
.rex
Portable as binary
.rd
f
Sometimes portable as
binary (if no PL/SQL)
.rep
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
7-10
Oracle Developer: Build Reports
File Portability
......................................................................................................................................................
File Portability
Introduction
You may need to move report definition files from one machine to another, either
during development or when installing the production application.
Portability
Each file created has different characteristics that determine how portable it is across
platforms. The table below lists the portable files, with any limitations they may have:
File Type
Portability
.rex
(text)
100% portable
.rdf
(binary + text)
.rep
(binary)
Although .rep files are considered portable when they do not contain PL/SQL, it is
rare to have a report that does not contain any PL/SQL code. Oracle recommends
that you always consider using either .rdf or .rex files when porting, and
recompile .rep files for each operating system.
......................................................................................................................................................
Oracle Developer: Build Reports
7-11
Lesson
7: Report Storage Methods
......................................................................................................................................................
......................................................................................................................................................
7-12
Oracle Developer: Build Reports
File Portability
......................................................................................................................................................
......................................................................................................................................................
Oracle Developer: Build Reports
7-13
Lesson
7: Report Storage Methods
......................................................................................................................................................
.rdf
.rep
.rex
......................................................................................................................................................
7-14
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
7-15
Lesson
7: Report Storage Methods
......................................................................................................................................................
incompatibilities
Use wizard for major modification
Use layout model for individual changes
Move printer definitions to
<oracle_home>\report60\printers>
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
7-16
Oracle Developer: Build Reports
PL/SQL
Release 1
PL/SQL 1
Release 2
PL/SQL 2.3
Release 6
PL/SQL 8
......................................................................................................................................................
Oracle Developer: Build Reports
7-17
Lesson
7: Report Storage Methods
......................................................................................................................................................
Summary
Storage methods: file or database
Report on reports documentation utility
File portability
Conversion between storage types
Upgrading report and printer definitions
from previous releases
......................................................................................................................................................
7-18
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
In this lesson you learned the difference between saving a report definition to a file,
including the three different report file types, and saving in the database.
One reason for saving in the database is to use the Report on Reports utility to
document your report definition.
Most Oracle Report Builder files are portable, some as text, others as binary.
Use the Reports Convert utility to convert between the different report storage
types.
Upgrading from Release 1 does not require a special utility. Open a Release 1 report
in Report Builder. If the report definition contains PL/SQL, the code is
automatically upgraded to PL/SQL 8.
......................................................................................................................................................
Oracle Developer: Build Reports
7-19
Lesson
7: Report Storage Methods
......................................................................................................................................................
Practice 7 Overview
Using the Help system to find
information on storage types and
executables
Converting a report using the Convert
utility
Documenting a report using the Report
on Reports utility (optional)
......................................................................................................................................................
7-20
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
7-21
Lesson
7: Report Storage Methods
......................................................................................................................................................
Can you compile more than one report with this utility?
2 Use the Convert utility in Report Builder to convert a report from .rdf to .rep.
......................................................................................................................................................
7-22
Oracle Developer: Build Reports
8
................................
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Objectives
At the end of this lesson, you should be able to
do the following:
Describe Data Model objects.
Modify report hierarchy.
Change the order of data in a group.
Eliminate data from a report.
Create supplemental rows of data, by adding
queries.
Link data from different queries.
Reuse PL/SQL code to create a Ref cursor
Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
8-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
You have learned to create simple, single-query reports using the Report Wizard. For
many reports, one query is sufficient. However, sometimes reports require multiple
queries and a more complex structure than the Report Wizard provides.
In this lesson you learn the Data Model structure and objects, and how to enhance
reports by creating additional groups and queries to achieve more complex report
structures.
Objectives
At the end of this lesson, you should be able to:
Describe the Data Model objects and their relationship
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
Create supplemental rows of data by adding queries
Link data from different queries by creating a data link
......................................................................................................................................................
Oracle Developer: Build Reports
8-3
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-4
Oracle Developer: Build Reports
Group
Column
Link
Parameter
Description
You can create a report with one or more queries. The Report Wizard
creates a single-query report. Use the query tool or the Data Wizard
to create additional queries.
Each group is owned by a query. By default, Reports creates one
group for each query.
Columns are owned by the group to which they belong. By default,
the group contains one column for each select expression in the
query.
Links join a parent group to a child group. You can create links to
form a relationship between groups from different queries. Links are
never created by default.
Parameters are owned by the report. You can create parameters that
allow users to enter value restrictions at run time. Reports also
provides a number of system parameters by default.
......................................................................................................................................................
Oracle Developer: Build Reports
8-5
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-6
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-7
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
More Properties
Aid maintenance and testing
Rename queries in complex reports
Add comments to describe queries
-- comment for single lines
/*comment*/ for multiple lines
......................................................................................................................................................
8-8
Oracle Developer: Build Reports
Renaming Queries
Oracle recommends that you rename queries in a complex report, to make the Data
Model easy to understand.
Renaming a query does not automatically rename the group below it.
Commenting Your Queries
Use the Comment property to enter meaningful text that describes the query.
You can also insert comment lines directly in the SQL Query Statement area, using the
Oracle standard comment delimiters:
--comment for a single line
/*comment*/ for multiple lines
Note: For ease of maintenance, do not enter comments in different places for the same
query.
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 database.
......................................................................................................................................................
Oracle Developer: Build Reports
8-9
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-10
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-11
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Groups
Groups determine hierarchy and frequency
Wizard creates default groups
Default naming conventions
You can change query name
You can change group name
......................................................................................................................................................
8-12
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-13
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Group Hierarchy
2
Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
8-14
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-15
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
1
2
3
Break group controls primary sort; uses Set Break Order and
Break Order properties
......................................................................................................................................................
8-16
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-17
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Query Modifications
In a break report, data order is determined
by:
Break order columns in the break groups
Columns that you specify in the ORDER
BY clause
SELECT
SELECT d.id,
d.id, d.name,
d.name, e.last_name...
e.last_name...
FROM
s_emp
FROM
s_emp e,
e, s_dept
s_dept dd
WHERE
WHERE e.dept_id
e.dept_id == d.id
d.id
ORDER
BY
2,
e.salary
ORDER BY 2, e.salary
Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
8-18
Oracle Developer: Build Reports
If you create a break group containing D.ID and D.NAME, but with D.NAME as the
only break column, then at run time your query becomes:
SELECT d.id, d.name, e.last_name, e.salary
FROM s_emp e, s_dept d
WHERE e.dept_id = d.id
ORDER BY 2, e.salary
......................................................................................................................................................
Oracle Developer: Build Reports
8-19
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-20
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-21
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-22
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-23
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-24
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-25
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-26
Oracle Developer: Build Reports
......................................................................................................................................................
Note: The package can be either a local program unit, part of a PL/SQL library, or
a stored program unit.
2 In the Data Model editor, select the Ref Cursor Query tool and click in the Data
Model painter area.
3 In the PL/SQL Editor, enter the PL/SQL function that opens a cursor and returns
a cursor variable of the ref cursor type you defined in the package.
FUNCTION QR_1RefCurDS return RefCurPack.EmpCurType is
V_EmpCur RefCurPack.EmpCurType;
BEGIN
OPEN EmpCur FOR SELECT * FROM s_emp;
RETURN V_EmpCur;
END;
Reference
For further information on ref cursors see:
Online Help: Help Topics>PL/SQL Reference>PL/SQL Language
Elements PL/SQL Users Guide and Reference
......................................................................................................................................................
Oracle Developer: Build Reports
8-27
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Oracle8 Objects:
Object Columns
......................................................................................................................................................
8-28
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-29
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Oracle8 Objects:
REF Columns
......................................................................................................................................................
8-30
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-31
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-32
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-33
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Name
45
Operations
Last_Name Dept_Id
34
Sales
Dumas
45
Chang
34
Patel
34
S_Emp
id = dept_id
Nonequi-join
Primary key value between two other
values
Create two links:
s_emp.salary
s_emp.salary
s_emp.salary
s_emp.salary
>=
>=
<=
<=
salgrade.losal
salgrade.losal
salgrade.hisal
salgrade.hisal
......................................................................................................................................................
8-34
Oracle Developer: Build Reports
Compound Keys
You can define multiple equi-joins between the same group and query, to implement a
compound primary/foreign key relationshipthat is, a key that consists of more than
one column.
Defining Nonequi-Joins
Create two links to define a nonequi-join.
A nonequi-join is a condition where one value falls between a range of two other
values.
...WHERE s_emp.salary BETWEEN salgrade.losal AND salgrade.hisal
......................................................................................................................................................
Oracle Developer: Build Reports
8-35
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Creating a Link
......................................................................................................................................................
8-36
Oracle Developer: Build Reports
You need to link them to display job information for each department, instead of one
separate list at the end. The link in the Data Model is from Q_EMP:ID column to
G_JOB:DEPT_ID column.
......................................................................................................................................................
Oracle Developer: Build Reports
8-37
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-38
Oracle Developer: Build Reports
Note: :id is a bind reference to the primary key column in the master query,
Q_DEPT.
Why Create a Manual Link?
Create a manual link for the following reasons:
Define a complex join condition in a query.
Implement a cartesian product, linking two tables without a join condition.
Link a query that contains objects columns or REF columns.
Link a ref cursor query, using parameters in the Ref Cursor query function.
Creating an Automatic Link
An automatic link is a link between two query objects that automatically defines a join
condition if the relevant primary/foreign key constraints exist in the database for
columns in the queries.
1 Select the Link tool.
2 Click on the parent query and drag it to the child query.
An error appears if no relevant constraints exist that match the columns in the master
and child queries. You must include the primary/foreign key columns in your queries.
......................................................................................................................................................
Oracle Developer: Build Reports
8-39
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-40
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-41
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Summary
Groups: structure data in a group
hierarchy.
Queries: write efficient SQL. Test in
SQL*Plus.
External queries: save a SQL statement
in a file and import into a report.
Data links: create a relationship
between data in different queries,
normally corresponding to primary and
foreign keys.
Efficiency: plan the queries required.
Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
8-42
Oracle 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. Use SQL*Trace for detailed analysis of
the data access.
You can restrict the rows returned by a query using the Maximum Rows property. This
is useful for testing purposes.
External Queries
Create a query in SQL*Plus and test for accuracy and efficiency. Save the final query
to a .sql file, then import the query to one or more reports.
Create external queries from the Report Builder, which allows you to use the Query
Builder and to save the query in the database instead of a file.
Groups
Organize data into sets of records, allowing you to establish hierarchical reports to any
depth and width.
Data Links
Create a data link between two queries, either manually or automatically.
Multiple-Query Reports
A report may comprise many queries running consecutively, or linked together to form
a hierarchy. Links are formed according to primary and foreign key relationships.
Efficiency
Consider outer joins, data ratios, and network traffic when designing your reports and
planning the number of queries.
......................................................................................................................................................
Oracle Developer: Build Reports
8-43
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Practice 8 Overview
Creating a second query in an existing
report
Restricting records in a query
Restricting records with a packaged
filter
Creating a data link
Practice 8 Overview
Creating a report containing a master
group with two details
Creating and referencing an external
query file
Creating a report containing a ref cursor
query
......................................................................................................................................................
8-44
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
8-45
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
customer information.
a In the Data Model create a new query. Either use the Query Builder
or import filename p8q1.sql. Change the group name to G_ORD.
QUERY : Q_ORD
SELECT customer_id, id, date_shipped, total
FROM s_ord
......................................................................................................................................................
8-46
Oracle Developer: Build Reports
Run to test.
d Save the report as p8q3.rdf.
4 Modify p8q3.rdf to show and restrict customers credit rating. You need to
modify the query properties.
a Include CREDIT_RATING in the query statement, although you
need not display it. Restrict the query statement to show those who
have a poor credit rating.
b Run to test.
c Save the report as p8q4.rdf and close it.
5 Create a new report that lists the sales representatives and the products they
have sold.
a Choose a Group Above report style.
b Import the query file p8q5_a.sql.
c Make NAME and ID the group fields. Make sure that these fields are
in one group, at Level 1, not two separate groups.
d Do not display 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 on the
fields tab.
e Change the following field attributes:
c
Column
Label
Width
name
Name
20
product
Product
10
product_id
ID
quantity
Quantity
prod_total
Total
......................................................................................................................................................
Oracle Developer: Build Reports
8-47
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
Now you need to show not only which products the sales
representatives have sold but also who are the customers they have
done business with.
Go to the Data Model and add a new query, importing the file
p8q5_b.sql. This query returns the customer names, their IDs, and
the total sales per customer for each sales representative.
i Rename the group to G_CUSTOMER.
j Link the second query to the correct group.
k Use the Report Wizard to display the new group. Do not display
SALES_REP_ID or ID.
l Change the following field attributes:
h
Column
Label
Width
customer
Customer
10
customer_id
ID
cust_total
Total
Table
s_dept
s_emp
......................................................................................................................................................
8-48
Oracle Developer: Build Reports
In the Data Model, move TITLE into a group at the top of the
hierarchy.
Hint: Move it into the department group first, then up into its own
new group.
Note: Since this is a single-query report, you can also make the group change
using the Report Wizard Group tab. However, you have learned that you can
combine many queries and groups in your own reports, and this simple exercise
helps you to practice moving columns in the data model.
d Open the Report Wizard and choose Finish to update the layout and
run the report.
e Run and test the report.
f Save the report as p8q7.rdf and close it.
8 Create a new report, using a ref cursor query.
a In the Object Navigator, create a package defining a record and a ref
cursor. The record has the following fields:
c
Name
Definition
last_name
s_emp.last_name%type
first_name
s_emp.first_name%type
salary
s_emp.salary%type
......................................................................................................................................................
Oracle Developer: Build Reports
8-49
Lesson
8: Enhancing Reports Using the Data Model: Creating Queries and Groups
......................................................................................................................................................
......................................................................................................................................................
8-50
Oracle Developer: Build Reports
9
................................
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Describe various Data Model columns
Display the contents of a file
Identify characteristics of user-defined
columns
Create report summaries and subtotals
Derive data, using a formula column
Create and populate a placeholder
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
9-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
When you define a query to extract the data from the database 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
At the end of this lesson, you should be able to do the following:
Describe the different types of Data Model columns
Display the contents of a file, using a database column
Identify the characteristics of the three types of user-defined columns
Create report summaries and subtotals, using summary columns
Derive data using a formula column
Create and populate a placeholder column
......................................................................................................................................................
Oracle Developer: Build Reports
9-3
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
5
1
2
3
4
Copyright Oracle Corporation, 1999. All rights reserved.
Database columns
Placeholder column
Summary column
Formula column
......................................................................................................................................................
9-4
Oracle Developer: Build Reports
Default Name
Summary
CS_1
Formula
CF_1
Placeholder
CP_1
......................................................................................................................................................
Oracle Developer: Build Reports
9-5
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Read-only properties
......................................................................................................................................................
9-6
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
9-7
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
......................................................................................................................................................
9-8
Oracle Developer: Build Reports
The Report wizard provides a default size for the displayed field. However, you can
resize it either in the Live Previewer or the Layout Model editor.
File Search
For portability, do not prefix the full path to the filename in the column. If you do
not prefix a path, Report Builder can use its file path search order to find the file.
Include the correct paths in the environment variable REPORTS60_PATH.
......................................................................................................................................................
Oracle Developer: Build Reports
9-9
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Creating a Column
What type of value?
Choose the correct
column tool
What frequency?
Create in a group or
at report level
C_xxx
C_xxx
C_xxx
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
9-10
Oracle 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.
How to Create a Column
1 Select the appropriate tool from the toolbar in the Data Model editor. Click
inside a group to create the column at the same frequency as other columns in
that group.
Note: To display the column once for the report, click in an open area of the
Data Model editor.
2 Double-click on the column to display its property palette.
3 Replace the default column number with a brief but descriptive name. Consider
standard naming conventions for different types of column.
4 Fill in the rest of the settings as appropriate for the type of column you require.
......................................................................................................................................................
Oracle Developer: Build Reports
9-11
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Summary Column
Specific properties:
Function
Source
Reset At
Compute At
......................................................................................................................................................
9-12
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
9-13
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Displaying Subtotals
Reset At:
G_dept
Report
2
Copyright Oracle Corporation, 1999. All rights reserved.
Department totals
Report total
......................................................................................................................................................
9-14
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
9-15
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
0
Displaying Percentages
Reset At:
G_emp
Compute At: G_dept
G_emp
Report
2
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
9-16
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
9-17
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Data Model
Group
REPORT
G_DEPT
G_EMP
REPORT
Grand Total
XXXX
XXXX
G_DEPT
Running
Total
Sub Total
XXXX
G_EMP
Running
Total
Running
Total
Record
Total
......................................................................................................................................................
9-18
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
9-19
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Formula Column
Performs a user-defined computation
Executes a PL/SQL function
Must return a value
Can be Character, Number, or Date
Returned value must match datatype
function
function CF_SALCALCFormula
CF_SALCALCFormula return
return Number
Number is
is
begin
begin
return(my_function(:salary));
return(my_function(:salary));
end;
end;
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
9-20
Oracle Developer: Build Reports
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 function
my_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 rather
than on the client, especially if the calculation requires only database values.
......................................................................................................................................................
Oracle Developer: Build Reports
9-21
Lesson
9: 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
CF_xxx
Formula column at
report level
Formula column in same
group or below
placeholder
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
9-22
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
9-23
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Populating a Placeholder
......................................................................................................................................................
9-24
Oracle Developer: Build Reports
Calculate and temporarily store the name of the employee who earns the highest
salary in the company
Display the highest earner and the maximum salary once at the beginning of the
report
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 earners name at runtime
A formula to:
- Compare each employee salary with the maximum salary
- Populate the placeholder with the employee name if salary equals maximum
salary
How to Create the Columns
1 Create a summary column CS_MAX_SALARY at report level (outside all
groups). Datatype: Number; Width: 10; Function: Maximum.
2 Create a placeholder column CP_MAX_EARNER at report level (outside all
groups). Datatype: Character; Width: 80.
3 Create a formula column CF_CALC_MAX in the G_EMP group. Datatype:
Number; Width: 10 (these are the default values).
4 Open the Program Unit editor from the PL/SQL Formula property in
CF_CALC_MAX. Create a function:
function CF_CALC_MAXFormula return Number is
begin
if :salary = :CS_MAX_SALARY then
:CP_MAX_EARNER := (:LAST_NAME|| in Department ||
:ID||--||:NAME);
end if;
return(0);
end;
......................................................................................................................................................
Oracle Developer: Build Reports
9-25
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Summary
Column types
Summary levels
Reset Atresets to zero
Compute At% of Total only
Formula columns return a value
Placeholder columns hold a value
......................................................................................................................................................
9-26
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
Column Types
A database column exists for each column or expression in the query
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 % Total
......................................................................................................................................................
Oracle Developer: Build Reports
9-27
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
Practice 9 Overview
Creating a new report with summaries
Adding summary calculations to an
existing report
Creating a report that displays the
contents of a file in a column
Creating a new report with ranking
summary columns
Adding placeholders for highest and
lowest values
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
9-28
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
9-29
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
style.
a Display the following data:
Table
Column
s_ord
id
Definition
Group
Label
Width
G_ord
Ord. No.
Order Date
No.
product_id
Product No.
price
Price
quantity_shipped
Quantity
Total
date_ordered
s_item
item_id
G_item
line_total
price*quantity_shipped
Column
Summary
line_total
Sum
line_total
% Total
......................................................................................................................................................
9-30
Oracle Developer: Build Reports
Table
Column
Label
s_product
id
ID
name
Name
short_desc
Description
filename
Picture
s_image
b
c
d
e
f
......................................................................................................................................................
Oracle Developer: Build Reports
9-31
Lesson
9: Enhancing Reports Using the Data Model: Creating Columns
......................................................................................................................................................
c
d
e
f
......................................................................................................................................................
9-32
Oracle Developer: Build Reports
10
................................
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Distinguish the report regions and
sections
Design multipanel reports
Describe the layout objects and
relationships
Modify an existing report layout
Create variable length lines
Create buttons and explicit anchors
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
10-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
You can fulfill many of your report requirements simply by making modifications in
the Live Previewer. However, for more complex reports you need to modify or insert
objects in the Layout Model editor.
The layout can be a complex area to view and modify. This lesson aims to give you an
appreciation of the layout regions, as well as the objects that you see and create using
object tools in the toolbar.
Objectives
At the end of this lesson, you should be able to do the following:
Distinguish the different regions and sections of a report
Design multipanel reports
Describe the layout objects and their relationship
Modify an existing report layout using the Layout Model tools
Separate report data using variable length lines
Add interactivity to a report using a button
Alter object positions at run time, using an explicit anchor
......................................................................................................................................................
Oracle Developer: Build Reports
10-3
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Compensation
Report
Header
Section
Page 1 of 1
Main
Section
Body/
Margin
Body/
Margin
End of report
Trailer
Section
......................................................................................................................................................
10-4
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-5
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Header
Section
Page 1 of 1
Main
Section
End of report
Trailer
Section
......................................................................................................................................................
10-6
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-7
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Main
Trailer
Logical Page 1
Panel 1
Physical Page 1
Logical Page 1
Panel 2
Physical Page 2
Logical Page 1
Panel 1
Physical Page 3
Logical Page 1
Panel 2
Physical Page 4
Logical Page 1
Panel 3
Physical Page 5
Logical Page 1
Panel 4
Physical Page 6
Logical Page 1
Panel 1
Physical Page 7
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
10-8
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-9
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Page 1-2
Page 2-1
Page 2-2
......................................................................................................................................................
10-10
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-11
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
F_xxx
F_xxx
R_G_xxx
M_G_xxx
Body
......................................................................................................................................................
10-12
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-13
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Flex Mode
......................................................................................................................................................
10-14
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-15
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Report Processing
BEGIN M_G_master...
REPEAT R_G_master
f_xxx
f_xxx
f_xxx
f_xxx
BEGIN M_G_detail...
REPEAT R_G_detail
f_xxx
END M_G_detail
END M_G_master
......................................................................................................................................................
10-16
Oracle Developer: Build Reports
Report Processing
To understand how the Layout Model maps to the output that you see in the Live
Previewer, 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.
......................................................................................................................................................
Oracle Developer: Build Reports
10-17
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
10
Copyright Oracle Corporation, 1999. All rights reserved.
Drawing objects
Text
Frame
Repeating frame
Field
Link file
Chart
Button
Anchor
10
OLE2 object
......................................................................................................................................................
10-18
Oracle Developer: Build Reports
Default
Name
Chart
D_
Boilerplate
B_
Link File
B_
OLE2
B_
Button
U_
Anchor
None
Description
......................................................................................................................................................
Oracle Developer: Build Reports
10-19
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Layout Tools
Pin a tool: double-click
Shift for constrained objects
Magnify
Frame Select
Additional Default Layout
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
10-20
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-21
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
......................................................................................................................................................
10-22
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-23
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Flex Lines
Flex lines adjust
to fit variable
frames and
repeating frames
......................................................................................................................................................
10-24
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-25
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Creating a Button
Buttons
Provide run-time user interaction for
Previewer reports only
Do not appear in printed output
Can exist in any layout region
Perform one of three actions:
Display multimedia information
Access a URL
Drilldown to a detail report
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
10-26
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-27
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
......................................................................................................................................................
10-28
Oracle Developer: Build Reports
Explicit
......................................................................................................................................................
Oracle Developer: Build Reports
10-29
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Removing Spacing
Layout
F_LAST_NAME
Output
F_JOB
SCHWARTZ
Store Clerk
......................................................................................................................................................
10-30
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-31
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Summary
Modifying the Layout Model
Report regions
Multipanel reports
Layout objects and tools
Additional layouts
Example reports
Variable length lines
Display a video clip from a button
Suppress space with an anchor
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
10-32
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
Introduction
In this lesson you learned to modify a report layout in the Layout Model editor.
Modifying the Layout Model
There are two report regions, Margin and Body, and three sections, the Header,
Main, and Trailer sections.
You can create multipanel reports by modifying the logical panel properties of
the report.
You can use the tool palette to create standard drawing objects and report
objects. The tool palette also provides some useful editing tools, such as the
Frame Select tool.
You can create many additional layouts in the same report using the Additional
Default Layout tool.
Example Reports
This lesson discussed solutions to the following report requirements:
Create variable length lines
Display a multimedia file from a button
Suppress conditional space with an explicit anchor
......................................................................................................................................................
Oracle Developer: Build Reports
10-33
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
Practice 10 Overview
Adding header and trailer pages
Adding a button to display a multimedia
column
Adding a repeating frame to the header
page
Adding flexible lines
Anchoring a boilerplate object to an
outer frame
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
10-34
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
10-35
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
......................................................................................................................................................
10-36
Oracle Developer: Build Reports
Modify the report to list all orders and order dates contained in the
report in the body region of the header section.
b Save the report as p10q3.rdf and close it.
4 Open report p5q3.rdf.
a Use the Report wizard to give last_name and first_name a width of 6.
(You can also do it directly in the Layout Model or from the Live
Previewer.)
b Add flexible lines vertically between the fields.
c Run and test the report.
d Save the report as p10q4.rdf.
a
......................................................................................................................................................
Oracle Developer: Build Reports
10-37
Lesson
10: Enhancing Reports Using the Layout Model
......................................................................................................................................................
......................................................................................................................................................
10-38
Oracle Developer: Build Reports
11
................................
Modifying Properties
Lesson
11: Modifying Properties
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Create a link file
Modify common layout properties
Modify specific layout properties
......................................................................................................................................................
11-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
All Report 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 how to reference the contents of a file at run time how to and
control the placement and pagination of this and other objects in the report output by
modifying the object properties.
Objectives
At the end of this lesson, you should be able to do the following:
Display the contents of a file in the report layout
Modify layout properties common to all types of object
Modify layout properties specific to one type of object
......................................................................................................................................................
Oracle Developer: Build Reports
11-3
Lesson
11: Modifying Properties
......................................................................................................................................................
abc
Comparing Properties
Intersection
Freeze
......................................................................................................................................................
11-4
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-5
Lesson
11: Modifying Properties
......................................................................................................................................................
......................................................................................................................................................
11-6
Oracle Developer: Build Reports
Description
The type of file contents; contents can be Text, Image, CGM,
Oracle Drawing Format, or Image URL
The name of the file that you want to link to the report
You can see the full list and descriptions of valid image formats under
File>Import>Image.
In character-mode reports, Text is the only valid format.
How to Create a Link File Object
1 In the Layout Model toolbar, choose the Link File tool. Drag an area in the
layout to create a link file object of the required size.
2 In the property palette, change the name of the object.
3 Enter the name of the link file that you want to include in the output, and the
format of the file.
......................................................................................................................................................
Oracle Developer: Build Reports
11-7
Lesson
11: Modifying Properties
......................................................................................................................................................
2
Import
Link
......................................................................................................................................................
11-8
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-9
Lesson
11: Modifying Properties
......................................................................................................................................................
PICTURE
2
Copyright Oracle Corporation, 1999. All rights reserved.
Link File exists as a layout object only. The same picture repeats
for each record.
......................................................................................................................................................
11-10
Oracle Developer: Build Reports
A File Column
Is a database column.
Represents a different value for each record
Can display different file contents for each
record
Exists in the Data Model and is the source of a
layout field
Is a layout boilerplate object that displays the Sources a layout field that does not display
file contents in the Layout editor
the file contents in the Layout editor
during development
during development; you see the field name
only
......................................................................................................................................................
Oracle Developer: Build Reports
11-11
Lesson
11: Modifying Properties
......................................................................................................................................................
......................................................................................................................................................
11-12
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-13
Lesson
11: Modifying Properties
......................................................................................................................................................
Sizing Objects
Elasticity
Layout icons
Vertical Horizontal
fixed
expand
contract
variable
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
11-14
Oracle Developer: Build Reports
Sizing Objects
......................................................................................................................................................
Sizing Objects
Introduction
You can create objects of any size in the Layout Model. The elasticity properties allow
you to specify whether the object can change size at run time.
The Four Types of Object Elasticity
Elasticity
Fixed
Expand
Contract
Variable
Horizontal Elasticity
Fixed
Fixed
Fixed
n/a
n/a
Vertical Elasticity
Expand
Expand
Expand
n/a
n/a
......................................................................................................................................................
Oracle Developer: Build Reports
11-15
Lesson
11: Modifying Properties
......................................................................................................................................................
2
3
No relationship, no anchor
......................................................................................................................................................
11-16
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-17
Lesson
11: Modifying Properties
......................................................................................................................................................
......................................................................................................................................................
11-18
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-19
Lesson
11: Modifying Properties
......................................................................................................................................................
1
-2-
xxx
xxx
-1-
xxx
xxx
-2-
......................................................................................................................................................
11-20
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-21
Lesson
11: Modifying Properties
......................................................................................................................................................
xxx
xxx
xxx
xxx
-1-
-1-2-
Image and rectangle are not related to repeating frame; Page Break
After has no effect
Image and rectangle are in the push path of and are implicitly
related to the repeating frame
......................................................................................................................................................
11-22
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-23
Lesson
11: Modifying Properties
......................................................................................................................................................
f_dept_id
Employee
f_ename
40
xxxxxxxx
xxxxxxxx
-2-
41
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
......................................................................................................................................................
11-24
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-25
Lesson
11: Modifying Properties
......................................................................................................................................................
Summit Goods
Summit Goods
-2-
Summit Goods
-3-
Summit Goods
......................................................................................................................................................
11-26
Oracle Developer: Build Reports
Object prints on
All logical pages of the parent
All logical pages except the first or last page
The first or last logical page only
The option that Report Builder chooses; Report 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 choose 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 Report Builder Help
Topics.
......................................................................................................................................................
Oracle Developer: Build Reports
11-27
Lesson
11: Modifying Properties
......................................................................................................................................................
Properties of a Field
Fields define formatting attributes and
logic
Wizard creates a field for each column
You create additional fields in Layout
editor
Source: Column, Parameter, or
System Variable
Format Mask: Standard Oracle format
symbols
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
11-28
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-29
Lesson
11: Modifying Properties
......................................................................................................................................................
System Variables
......................................................................................................................................................
11-30
Oracle Developer: Build Reports
Description
The operating system date, at run time, after the
Runtime Parameter Form has been displayed
The current page number, based on the
output numbered by logical page
The current panel number in the current logical page
The current page number based on the
output numbered by physical page
The total number of logical pages in the
current report run
The total number of panels in a logical page
The total number of pages based on the output
numbered by physical page
......................................................................................................................................................
Oracle Developer: Build Reports
11-31
Lesson
11: Modifying Properties
......................................................................................................................................................
Page Numbering
Page 4 of 4
Page 3 of 4
End
Page 2 of 4
Page 1 of 4
Example 1
Report
Title
Example 2
Page 1 of 1
End
Page 2 of 2
Page 1 of 2
Report
Title
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
11-32
Oracle Developer: Build Reports
Page Numbering
When a fields source 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
Include
Start At
Increment By
Reset At
Value
Main Section, Trailer Section
1
1
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
Include
Start At
Increment By
Reset At
Value
Main Section
1
1
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 is discussed later in this lesson.
......................................................................................................................................................
Oracle Developer: Build Reports
11-33
Lesson
11: Modifying Properties
......................................................................................................................................................
G_Dept
R_Dept
R_Emp
G_Emp
F_REPORT
......................................................................................................................................................
11-34
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-35
Lesson
11: Modifying Properties
......................................................................................................................................................
......................................................................................................................................................
11-36
Oracle Developer: Build Reports
Print Direction
Indicates
Name of the Data Model group that provides
the source data for this repeating frame; you
must source every repeating frame to a valid
group
Direction in which records are printed: either
Down or Across, Across/Down, or Down/
Across
Maximum number of records that can be
displayed on a single page
Minimum number of records from a group
that can be displayed at the bottom of a page
Whether to maintain the column for each
record across multiple pages
Spacing between each record, horizontally
and/or vertically
The most commonly used properties are discussed in more detail on the following
pages.
......................................................................................................................................................
Oracle Developer: Build Reports
11-37
Lesson
11: Modifying Properties
......................................................................................................................................................
.
2
-1-
-1-2-3-
-2-
......................................................................................................................................................
11-38
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-39
Lesson
11: Modifying Properties
......................................................................................................................................................
1
2
......................................................................................................................................................
11-40
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-41
Lesson
11: Modifying Properties
......................................................................................................................................................
Summary
Report objects have many properties
Modify only if necessary
Common properties for most layout
objects
Specific properties for some objects
Examples:
Link file
Pagination
Record spacing
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
11-42
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
Report objects provide many properties that you can modify in the property palette to
alter the appearance and position of objects in your report output.
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 properties and gave examples of some
common uses, such as:
Forcing pagination by setting Page Break Before or Page Break After
Controling spacing between records
......................................................................................................................................................
Oracle Developer: Build Reports
11-43
Lesson
11: Modifying Properties
......................................................................................................................................................
Practice 11 Overview
Modifying the printing of a mailing label
report
Controlling the number of records on a
page
Adding a link file to a report
Ensuring all details of a master print on
the same page
......................................................................................................................................................
11-44
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
11-45
Lesson
11: Modifying Properties
......................................................................................................................................................
Modify the layout so that the mailing labels are 2 inches wide and 1
inch high. Use the Arrange option on the menu. Ensure that the
company names are printed in alphabetical order across the page.
b Give each label a solid fill.
c Make the boilerplate object 1.8 inches wide and center it horizontally
and vertically in the repeating frame.
d Add spacing between the labels: .25 inch between each column of
labels across the page; .5 inch between each row of labels down the
page.
e Save the report as p11q1.rdf.
2 Continue with report p11q1.rdf.
a Modify the report so that only six labels are printed on each page.
b Save the report as p11q2.rdf and close it.
3 Open p9q1.rdf .
a On the operating system, copy the file summitlo.tif to a file
logo.tif.
b Delete the logo in the margin area and create a link file in its place to
display the contents of logo.tif.
c Run the report.
d On the operating system, copy any other .tif file to logo.tif.
e Rerun your report.
f Save the report as p11q3.rdf.
4 Continue with report p11q3.rdf.
a Ensure that all items of one order are printed on the same page.
b Save the report as p11q4.rdf and close it.
a
......................................................................................................................................................
11-46
Oracle Developer: Build Reports
12
................................
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Create and reference a parameter
Create a list of values for parameter
input
Use and modify a system parameter
Build a parameter form layout
Customize a parameter form layout
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
12-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
Parameters allow you to develop dynamic report documents that produce variable
report output depending on the parameter value that you enter at run time. This
lesson shows how to create and reference user and system parameters and how to
customize a parameter form to display parameters at run time.
Objectives
At the end of this lesson, you should be able to do the following:
Control report output by creating and referencing a parameter
Control parameter input using a list of values
Manipulate reports at run time using system parameters
Provide for user input of parameters by building a parameter form
Customize a parameter form layout
......................................................................................................................................................
Oracle Developer: Build Reports
12-3
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
User Parameters
......................................................................................................................................................
12-4
Oracle Developer: Build Reports
Description
Specify whether parameter value is character, number, or date;
default is Number when created in the Object Navigator.
Specify maximum allowable width of parameter value; maximum is
64KB.
Allow users to enter a numeric or date value using a specific format.
Specify the value to use. You can override this value at run time from
the command line or parameter form.
Validate the parameter value. Enter a PL/SQL function.
Create a list of values from which users select a valid value at run time
......................................................................................................................................................
Oracle Developer: Build Reports
12-5
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
Referencing Parameters in a
Report Query
Bind reference replaces a value
:parameter_name
Parameter object may be created by
default
Lexical reference replaces a clause
¶meter_name
Parameter object may be created by
default
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
12-6
Oracle Developer: Build Reports
Lexical
......................................................................................................................................................
Oracle Developer: Build Reports
12-7
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
......................................................................................................................................................
12-8
Oracle Developer: Build Reports
This statement allows you to enter a specific customer number at run time. For
example, if you enter 102, the WHERE clause uses the value 102 to restrict data
fetched and to fetch the one customer that has ID 102.
Example
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
ORDER BY DECODE(:SORT, 1, NAME, 2, STATE, COUNTRY)
Replace a column name in the SELECT clause, although you can reference a
value, such as the contents of a parameter:
SELECT LAST_NAME, SALARY * :P_RATE
FROM S_EMP
......................................................................................................................................................
Oracle Developer: Build Reports
12-9
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
&P_SALESREP REP
......................................................................................................................................................
12-10
Oracle Developer: Build Reports
To specify a WHERE clause, ORDER BY clause, or both at run time (as two
separate parameters):
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
&P_WHERE_CLAUSE
&P_ORD_CLAUSE
To specify a WHERE clause, ORDER BY clause, or both at run time (as one
parameter):
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
&P_WHERE_ORD_CLAUSE
To specify two column names and the table names at run time:
SELECT &P_CUSTNAME CUST, &P_SALESREP REP
FROM &P_TABLE
Note: When you use lexical references in the SELECT list, you must, at run time,
specify the same number of items of the correct datatype, as defined in the Data
Model.
......................................................................................................................................................
Oracle Developer: Build Reports
12-11
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
......................................................................................................................................................
12-12
Oracle Developer: Build Reports
Remember to define an initial value for lexical parameters that affect the validity of
the statement, and to validate those that you allow a user to enter at run time.
Note: Always use column aliases when substituting column names with lexical
references.
......................................................................................................................................................
Oracle Developer: Build Reports
12-13
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
1
2
3
4
5
......................................................................................................................................................
12-14
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
12-15
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
3
4
2
5
Choose SELECT
Statement.
2
......................................................................................................................................................
12-16
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
12-17
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
System Parameters
......................................................................................................................................................
12-18
Oracle Developer: Build Reports
COPIES
CURRENCY
DECIMAL
DESFORMAT
DESNAME
DESTYPE
Use to specify
Whether report is to run in background
(in Microsoft Windows, setting this
parameter to Yes invokes the Background
Engine RWRBE60 if not already running)
Number of copies if destype=printer
Symbol for currency indicator
Symbol for decimal indicator
Output device definition, ignored if
type=screen/preview
Destination name, such as filename,
printer name, mail userid; ignored if
type=screen/preview
Destination type for output
Values
Yes, No
Default
No
Any integer
1
Max 4 characters
Any single char
Examples: dflt,
dflt
pslan80,
pdf,HTML
<report>.lis
......................................................................................................................................................
Oracle Developer: Build Reports
12-19
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
1000
6000
5000
Run-time:
FF1000
FF6000
FF5000
RWRUN60 report=fred.rep...currency=FF
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
12-20
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
12-21
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
++ Report
Report properties:
properties:
Width
Width
Height
Height
Number
Number of
of Pages
Pages
Copyright Oracle Corporation, 1999. All rights reserved.
......................................................................................................................................................
12-22
Oracle Developer: Build Reports
Use to
Define the width of the parameter form that
the user sees at run time.
Define the height of the parameter form that
the user sees at run time.
Define the number of physical pages that
make up the parameter form.
......................................................................................................................................................
Oracle Developer: Build Reports
12-23
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
2(A2A2#;A6;2'
2A2#;A6;2'
......................................................................................................................................................
12-24
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
12-25
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
Summary
Parameter types
User parameters: bind/lexical, LOVs
System parameters
......................................................................................................................................................
12-26
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
Parameter types:
- User Parameters:
References: bind or lexical
List of values: dynamic (bind only) or static
- System Parameters
Modifying parameter values at run time:
- Pass the parameter on the R30RUN command line
- Allow users to change values in the run-time parameter form
Creating a run-time parameter form:
- Build a parameter form with the Parameter Form Builder
- Customize the parameter form layout in the Report editor
......................................................................................................................................................
Oracle Developer: Build Reports
12-27
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
Practice 12 Overview
Modifying an existing report to use a
bind parameter
Adding a dynamic list of values
Adding a lexical parameter
Adding a static list of values
Creating a customized parameter form
......................................................................................................................................................
12-28
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
12-29
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
Column
Label
Width
name
30
address
30
city
30
......................................................................................................................................................
12-30
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
12-31
Lesson
12: Creating and Using Report Parameters
......................................................................................................................................................
......................................................................................................................................................
12-32
Oracle Developer: Build Reports
13
................................
Embedding a Chart in a
Report
Lesson
13: Embedding a Chart in a Report
......................................................................................................................................................
Objectives
At the end of this lesson, you should be
able to do the following:
Create and display a simple chart
Display an existing chart
Modify chart data dynamically
......................................................................................................................................................
13-2
Oracle Developer: Build Reports
Overview
......................................................................................................................................................
Overview
Introduction
In this lesson you learn to display an Oracle Developer graphical chart in a report at
run time.
Objectives
At the end of this lesson, you should be able to do the following:
Create and display a simple Graphics chart in a report using the Chart Wizard
Display an existing Graphics chart in a report
Explain how to modify data dynamically in an existing chart
......................................................................................................................................................
Oracle Developer: Build Reports
13-3
Lesson
13: Embedding a Chart in a Report
......................................................................................................................................................
Creating a Chart
......................................................................................................................................................
13-4
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
13-5
Lesson
13: Embedding a Chart in a Report
......................................................................................................................................................
......................................................................................................................................................
13-6
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
13-7
Lesson
13: Embedding a Chart in a Report
......................................................................................................................................................
1
2
D_empchart
disp1.ogd
......................................................................................................................................................
13-8
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
13-9
Lesson
13: Embedding a Chart in a Report
......................................................................................................................................................
Summary
Build new chart:
Invoke Chart wizard to build and
embed a chart
Enhance chart in Graphics Builder
......................................................................................................................................................
13-10
Oracle Developer: Build Reports
Summary
......................................................................................................................................................
Summary
Use the Chart Wizard to create and embed a simple chart in your report.
Reenter the Chart Wizard to make changes to the chart object, such as its
position in the report.
Use Developer/2000 Graphics Builder to enhance and modify the chart
definition.
Create a display object in the Layout Model to embed a chart that already exists
in an .ogd file. Enter the chart (.ogd) filename.
Pass parameters or column values from a report to a chart to restrict values or
data records if the chart contains a separate SQL query.
......................................................................................................................................................
Oracle Developer: Build Reports
13-11
Lesson
13: Embedding a Chart in a Report
......................................................................................................................................................
Practice 13 Overview
Using the Chart wizard to create a chart
Altering the chart in the Chart wizard
Creating charts that print once for each
record of a group
......................................................................................................................................................
13-12
Oracle Developer: Build Reports
......................................................................................................................................................
Oracle Developer: Build Reports
13-13
Lesson
13: Embedding a Chart in a Report
......................................................................................................................................................
Chart Type
Line
Chart Subtype
Plain
Category
NAME
Value
TOTAL
Position
Filename
p13q1.ogd
Title
Chart Type
Column
Chart Subtype
Depth
......................................................................................................................................................
13-14
Oracle Developer: Build Reports
Use the Chart Wizard to create a pie chart for the data group
G_PRODUCT.
Chart Type
Pie
Chart Subtype
Plain
Data Group
G_product
Category
PRODUCT_ID
Value
PROD_TOTAL
Chart Frequency
File Name
p13q3a.ogd
In the Layout editor move the chart beneath the product group and
resize it to the same width as the product group.
c Run and test the report.
d Close the Graphics Batch.
e Create a second chart for the customer group.
b
Chart Type
Pie
Chart Subtype
Plain
Data Group
G_customer
Category
CUSTOMER_ID
Value
CUST_TOTAL
Chart Frequency
File Name
p13q3e.ogd
In the Layout editor move the chart beneath the customer group.
Hint: Create a frame around both charts, so that they are always displayed
side by side.
g Run and test the report.
h Close the Graphics Batch.
i Save the report to p13q3.rdf and close it.
f
......................................................................................................................................................
Oracle Developer: Build Reports
13-15
Lesson
13: Embedding a Chart in a Report
......................................................................................................................................................
......................................................................................................................................................
13-16
Oracle Developer: Build Reports