D17075GC10 SG
D17075GC10 SG
D17075GC10 SG
a ble
f e r
ans
n - t r
a no
Oracle Reports Developer a s 10g:
Build Reports
h
) eฺ
o m
a ilฺc Guid
Student g m • Volume
Guide
e n t1
i t 3 1@ Stud
a v n this
m arn use
( ku se to
A R en
K UM lic
N I T
V
NA
D17075GC10
Production 1.0
June 2004
D39520
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Mark Fleming This material or any portion of it may not be copied in any form or by any means
Warren Lord without the express prior written permission of Oracle Corporation. Any other copying
is a violation of copyright law and may result in civil and/or criminal penalties.
Marcelo Manzano
If this documentation is delivered to a U.S. Government Agency not within the
a ble
Darren McBurney Department of Defense, then it is delivered with “Restricted Rights,” as defined in
f e r
Paul Narth FAR 52.227-14, Rights in Data-General, including Alternate III (June 1987).
an s
Daphne Nougier
n - t r
The information in this document is subject to change without notice. If you find any
o
an
Miyuki Ohsato problems in the documentation, please report them in writing to Education Products,
Oracle Corporation, 500 Oracle Parkway, Box SB-6, Redwood Shores, CA 94065.
Ligia Jasmin Robayo
ha s
Oracle Corporation does not warrant that this document is error-free.
Jim Safcik )
m ideฺ
o
All references to Oracle and Oracle products are trademarks or registered trademarks
c
ailฺ t Gu
Rie Saitoh of Oracle Corporation.
Navneet Singh m
g den
All other products or company names are used for identification purposes only, and
Sarah Spicer @
may be trademarks of their respective owners.
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Contents
Preface
I Introduction
Course Objectives I-2
Course Content I-3
1 Introduction to Oracle Reports Developer
Objectives 1-2
Business Intelligence 1-3
Enterprise Reporting 1-5
Web Publishing 1-9
Paper Publishing 1-10 a ble
Oracle Reports Developer 1-11 f e r
Benefits 1-12 ans
Oracle 10g Products 1-13 n - t r
o
Oracle Database 10g 1-14
Oracle Developer Suite 10g 1-15 s an
Oracle Application Server 10g 1-18 ) ha
Oracle Reports Developer 1-20
c o m ideฺ
OracleAS Reports Services 1-22
m ailฺ t Gu
g den
OracleAS Reports Services Architecture for the Web 1-23
@
t31 is Stu
Summary 1-25
n i
2 Designing and Running Reports
r n av e th
Objectives 2-2
Understanding User u m a
o us 2-3
Requirements
t
(k 2-5se
Designing Reports
R
Tabular A
M 2-7
l i c en
K U
Master-Detail 2-8
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
r n
Building a Query 4-11av e th
m a us
Query Builder Functions 4-12
u t o
(k se
Selecting Displayed Fields 4-14
R
A licen
Totals and Labels 4-15
M
U
Selecting a Report Template 4-16
K
N I T Viewing the Paper Report Output 4-17
V Saving the Report Definition 4-18
NA Reentering the Wizard 4-19
Creating a New Report 4-21
Creating Break Reports 4-22
Break Report Labels 4-23
Creating Mailing Labels and Letters 4-24
Creating a Matrix Report 4-26
Previewing a Paper Report in a Browser 4-28
Summary 4-30
Practice 4 Overview 4-31
5 Enhancing a Basic Paper Report
Objectives 5-2
What Is the Paper Design? 5-3
The Paper Design Window 5-4
Modifying a Report 5-5
Aligning Columns 5-6
Setting a Format Mask 5-7
Manipulating Objects 5-9
iv
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
vi
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
vii
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
viii
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
ix
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Glossary
xi
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Preface
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Profile
Before You Begin This Course
Before you begin this course, you should have:
• Thorough knowledge of creating SQL query statements
• Working experience of:
– Creating PL/SQL constructs, including conditional statements, procedures and
functions
– Creating PL/SQL stored (server) procedures and functions
– Using a graphical user interface (GUI)
Prerequisites
• The following instructor-led training (inClass) courses:
– Oracle Database 10g: SQL Fundamentals I
a ble
– Oracle Database 10g: PL/SQL Fundamentals
f e r
– Oracle Database 10g: Develop PL/SQL Program Units
ans
• Or the following Self-Study CD courses:
n - t r
o
Introduction to Oracle9i: SQL
– Oracle SQL: Basic SELECT Statements s an
– Oracle SQL: Data Retrieval Techniques ) ha
– Oracle SQL: DDL and DML c o m ideฺ
Oracle9i PL/SQL Fundamentals
m ailฺ t Gu
– PL/SQL: Basics @ g den
n i t31 is Stu
Oracle9i: Develop PL/SQL Program Units
r n av e th
– PL/SQL: Database Programming
u m a
t o us
– PL/SQL: Procedures, Functions and Packages
(k se
Note: Use the Oracle9i Self-Study CD courses until the equivalent Oracle Database
R
M A licen
10g courses become available.
K U
Suggested
N I T • Oracle Database 10g: SQL Fundamentals II (inClass)
N AV Suggested Follow-up Courses
• Oracle9i Reports: Create Reports for the Web and Portals (eClass)
• Oracle9i Reports: Integrate Pluggable Data Sources (eClass)
• Oracle9iAS Reports Services: Deploy Internet Reports (eClass)
Preface - 3
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Preface - 4
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Executing Reports Using Reports Services with Oracle Developer Suite 10g
Oracle Developer Suite 10g contains an embedded Oracle Container for J2EE (OC4J) and
OracleAS Reports Services. This enables developers to test the reports deployment without
installing Oracle Application Server. This environment is provided as a testing environment
only, and is not a replacement for an appropriate production environment using Oracle
Application Server.
To test your reports:
1. Create the following directories:
a. $ORACLE_HOME\reports\j2ee\reports_ids\web\test
b. $ORACLE_HOME\reports\j2ee\reports_ids\web\test\css
c. $ORACLE_HOME\reports\j2ee\reports_ids\web\test\images
2. Copy the template images and style sheets as follows:
a. Copy $ORACLE_HOME\reports\docroot\css to a ble
f e r
$ORACLE_HOME\reports\j2ee\reports_ids\web\test\css
ans
b. Copy $ORACLE_HOME\reports\docroot\images to
n - t r
o
an
$ORACLE_HOME\reports\j2ee\reports_ids\web\test\images
3. Add the $ORACLE_HOME\reports\j2ee\reports_ids\web\test directory
s
ha
to the "REPORTS_PATH" environment variable using Start > Run > regedit
)
o m ideฺ
4. Start OC4J using Start > Programs > Oracle Developer Suite – oracle_home >
c
ailฺ t Gu
Reports Developer > Start OC4J instance
m
g den
Note: Do not close the DOS window since it is being used by the running OC4J
@
instance.
n i t31 is Stu
r n av e th
5. Copy your reports to $ORACLE_HOME\reports\j2ee\reports_ids\web\test
6. Locate your computer name using Start > Settings > Control Panel > System >
u m a
o us
Network Identification Tab
t
(k se
7. Locate the Web site port number by inspecting the file $ORACLE_HOME
R
M A licen
\j2ee\DevSuite\config\default-web-site.xml (e.g. 8889)
K U
8. Test your paper reports using the reports servlet, for example,
N I T http://Computer_Name:port_number/reports/rwservlet?report=
V
NA myReport.jsp&userid=username/password@dbName&destype=cache
&desformat=PDF
9. Test your Web reports using the JSP Engine, for example,
http://Computer_Name:port_number/reports/test/
myReport.jsp?userid=username/password@dbName
Note: The first time a Web report executes using the JSP engine, the OC4J needs to
compile the JSP report and it typically takes some time. All the subsequent report
executions using the JSP engine are fast.
Preface - 5
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Resources
Oracle Publications
Oracle Developer Suite 10g (9.0.4) Release Notes for Windows and B10668-01
UNIX [Chapter 9: Oracle Reports]
Oracle Application Server Reports Services Publishing Reports to B10314-01
the Web
a ble
f e r
ans
Additional Publications
n - t r
• System release bulletins a no
• Installation and user’s guides h a s
m ) eฺ
• read.me files
l o
ฺc Guid
a i
• International Oracle User’s Group (IOUG)
g marticlesent
• Oracle Magazine
i t 3 1@ Stud
Web Sites
a v n this
• Oracle Technology rn ushttp://otn.oracle.com
aNetwork: e
m to Asked Questions (FAQ):
ku Frequently
(
• Oracle Reports
R ens e
A ic
http://otn.oracle.com/products/reports/htdocs/faq.htm
M l
U
N IT K• Oracle Reports whitepapers, presentations, and viewlets:
http://otn.oracle.com/products/reports/content.html
V
NA • Getting Started with Oracle Reports:
http://otn.oracle.com/products/reports/htdocs/getstart/
GettingStarted/index/index.html
Preface - 6
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Typographic Conventions
Typographic Conventions In Text
Bold italic Glossary terms (if there is a The algorithm inserts the new key.
glossary)
a ble
Caps and Buttons, Click the Executable button. f e r
lowercase check boxes, ans
triggers,
Select the Registration Required check
n - t r
windows
box.
a no
Assign a When-Validate-Item trigger.
h a s
Open the Master Schedule
m ) ewindow.ฺ
c o i d
Carets Menu paths m
Select aFileilฺ> Save.
t G u
@ g den
t31 isPress
Standu
Commas Key sequences vni release these keys one at a
a t h
m arn use time: [Alt], [F], [D]
( ku se to
A R en
U M l ic
N IT K
V
NA
Preface - 7
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Quotation Lesson and chapter This subject is covered in Unit II, Lesson 3, “Working with
marks titles in cross Objects.”
references, interface
elements with long Select the “Include a reusable module component” and
names that have only click Finish.
initial caps
Use the “WHERE clause of query” property.
Preface - 8
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Preface - 9
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Introduction
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Course Objectives
Course Content
Day 1:
• Introducing Oracle Reports Developer
• Designing and running reports
• Working in Oracle Reports Builder
• Creating and modifying paper reports using the
r a ble
Wizard
n s fe
• Enhancing a paper report in the Paper Designoview - t r a
n n
Day 2: s a
a
) h eฺ
• Managing templates m
i l ฺ co uid
• Creating a Web report
g ma ent G
31@ tud
• Enhancing report structure
n it is S
n v
a e th
r us© 2004, Oracle. All rights reserved.
a Copyright
u m t o
R (k se
n
MA lice
CourseUContent
I T
The
Klesson titles show the topics covered in this course and the usual sequence of lessons.
VN However, the daily schedule is an estimate, and may vary for each individual class.
NA Day 1
• Course Introduction
• Introduction to Oracle Reports Developer
• Designing and Running Reports
• Working in Oracle Reports Developer
• Creating a Paper Report
• Enhancing a Basic Paper Report
Day 2
• Managing Report Templates
• Creating a Web Report
• Enhancing Reports Using the Data Model: Queries and Groups
• Enhancing Reports Using the Data Model: Data Sources
• Enhancing Reports Using the Data Model: Creating Columns
Course Content
Day 3:
• Using the paper layout
• Modifying properties
• Using Web reporting
• Extending functionality using XML
a ble
f e r
Day 4:
ans
n - t r
• Customizing reports with parameters
a no
• Embedding graphs a s
• Enhancing matrix reports m ) h eฺ
i l ฺ co uid
a
• Adding PL/SQL code gm
@ tude nt G
3 1
it is S
v n
a e th
r n
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
n
MA l(continued)
CourseUContent ice
I T K
Day 3
VN
NA •
•
Enhancing Reports Using the Paper Layout
Controlling the Paper Layout: Common Properties
• Controlling the Paper Layout: Specific Properties
• Web Reporting
• Extending Functionality Using XML
Day 4
• Creating and Using Reports Parameters
• Embedding a Graph in a Report
• Enhancing Matrix Reports
• Coding PL/SQL Triggers
Course Content
Day 5:
• Extending functionality using the SRW package
• Using OracleAS Reports Services
• Efficiency and performance guidelines
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
n
MA l(continued)
CourseUContent ice
I T K
VN 5
Day
NA Extending Functionality Using the SRW Package
Maximizing Performance Using OracleAS Reports Services
Building Reports: Efficiency Guidelines
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Business Intelligence
Discoverer Server Reports Server
XML
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M
What IsUBusiness l icIntelligence?
I T K
Reporting is the delivery of information to information consumers. These consumers must
VN
NA often further investigate that information. Historically, different tools have performed
different tasks. There is however a growing need to integrate data consolidation, data
analysis, and enterprise reporting tools. This provides a seamless environment that allows
users to move from the role of pure information consumer to information investigator.
The combination of providing information and enabling additional investigation of that
information is commonly referred to as business intelligence (BI).
Oracle offers an integrated business intelligence solution that provides the user with a
complete picture across the entire organization. The Oracle BI solution is designed to
easily and quickly put data into the database, find information from the database, share
this information, and exploit BI to learn more about a business and its customers.
Enterprise Reporting
a ble
Any Web f e r
Client Application
Data Server
ans
Server n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Enterprise
U MReporting
l ic
I T K
For as long as there has been electronic data storage, there has been reporting. In the
VN
NA mainframe computing era a “one-report-fits-all” metaphor was used. Reports were
expensive to develop and were typically generated in overnight batch jobs. With the
advent of the personal computer and its rich graphical user interface and fourth generation
languages, reports were easier to produce. Report developers could now write reports
tailored to the needs of particular information consumers. Most companies however
shifted from a “one-fits-all” model to a paradigm of “one-report-fits-one”. Reports were
stored on an individual PC, or at best shared across small work groups. Enterprise
reporting grew out of a business need for better, faster, and more flexible delivery of
individually tailored information to a very large number of users. No environment is
better suited to fulfill this than the Internet.
Enterprise Reporting
Reporting
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Web Publishing
GIF89a
a ble
f e r
t rns
hyperlinks
a
on -
s a n JavaScript
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Web Publishing
U and Paper Publishing
K
T many people turn to the Web first to find information. However, publishing
IToday,
V N
NA enterprise data using a browser has not lowered the demand for high fidelity paper
publishing. HTML pages that look great in a browser often do not look professional when
printed from the browser. There are few tools today that recognize this and help
developers publish data with high fidelity to both the Web and paper.
Web Publishing
A Web page is very fluid. A Web page does not have the limitation of page size; a page
can contain as much or as little data as you wish. If there is more content than will fit in
the browser window, scroll bars are displayed to allow users to navigate through the
content. Web specific features, such as bookmarks and hyperlinks, can also aid the user in
navigation.
A Web page comes alive with rich images, color, JavaScript, and animation. Users can
interactively drill down to see details or related data. Style sheets are used to universally
control appearance.
Paper Publishing
8.5”
GIF89a
a ble
hyperlinks f e r
ans
11” n - t r
o
s an
ha
JavaScript
)
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A land
Web Publishing i c enPaper Publishing (continued)
K U
T
IPaper Publishing
VN
NA A paper report has characteristics that include rigid geometry restrictions, headers and
footers repeated on each page, and higher resolution allowing more details to be presented
to the end user at once, giving the end user the option of printing the output and the ability
to “study” the data.
Oracle Reports has historically done a very good job of publishing high fidelity paper
reports. The tools understands the concept of a paper page. It manages geometry and
includes features to control behavior when a page break occurs.
Effective Publishing
The key to effective publishing is understanding the medium, utilizing the functionality
the medium provides, and generating visually attractive content for that medium. For the
Web, this means the ability to incorporate Java, JavaScript, and animated Graphic
Interchange Formats (GIFs). For paper, it requires the understanding of paper layouts and
complicated geometry management.
Recognizing the differences between Web publishing and paper publishing, Oracle
Reports Developer provides a declarative environment with the power to generate high
quality output for the Web and e-business requirements, as well as high fidelity paper
reports.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
JDBC f e r
ans
OLAP n - t r
a no
XML h a s
m ) eฺ
o
TEXT
a ilฺc Guid
g m ent
<Your Data Source>
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
OracleU M Developer
Reports l ic
I T K
Oracle Reports Developer provides an enterprise-wide publishing solution that delivers
VN
NA high fidelity, dynamic Web pages to corporate (intranet) and Internet users without
compromising scalability and performance. Using Oracle Reports, you can publish
information from any data source, in any format (PDF, HTML, printed, XML, etc.), to
any destination (Web, Portal, e-mail, file, etc.) in a scalable, efficient manner.
The goal of Oracle Reports is to be the universal publishing solution of choice for any
publishing need within an organization.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Benefits
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
BenefitsU M l ic
I T•K
Oracle Reports enables you to publish data from any source in any format with high
V N fidelity.
NA In addition to SQL, PL/SQL, and Express, you can publish data from Java Database
Connectivity (JDBC) sources, XML, text files, or your own data sources that you have
defined. Report output can go anywhere you wish: the Web, e-mail, the printer,
wireless devices, and so forth.
• Develop your report once, deploy it anywhere.
- Output formats include HTML, HTMLCSS, XML, PDF, Postscript, RTF,
delimited, character, etc.
- The Web layout is optimized for HTML.
- The paper layout is designed for PDF and Postscript.
- Share a single data model among all output formats.
- Customize the appearance and content of your output at runtime by applying XML
customization files.
• Oracle Reports uses a standards-based, modular architecture.
- Use the Reports Java APIs to define your own plug-ins for data sources, output
destinations, security infrastructure, cache management, engines, and so on.
- Take advantage of the industry standards used in Oracle Reports: JavaServer
Pages (JSPs), servlets, JavaBeans, CORBA, and IIOP information protocol.
- Flexible design fits any middle-tier configuration.
Unauthorized reproduction Oracle Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
Documents
f e r
ans
n - t r
a no
h a s
Multimedia ) eฺ
o m
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
OracleU M
Database l c
i10g
I T K
The Oracle Database manages all of your structured and unstructured data, including
VN
NA Word documents, Excel spreadsheets, XML, images, and more. It provides a scalable,
secure, and reliable architecture.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Application Development
a ble
f e r
an s
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
OracleU M
Developer l icSuite 10g
I T K
The Oracle Developer Suite offers a complete set of integrated development tools,
VN
NA empowering you to easily and quickly create Internet applications for personalized Web
portals and hosted software services. Oracle Developer Suite 10g combines leading Oracle
application development and business intelligence tools into a single integrated product.
Built on Internet standards such as Java and XML, Oracle Developer Suite provides a
complete development environment.
The components of Oracle Developer Suite 10g include Oracle Designer, Oracle Forms
Developer, Oracle JDeveloper, Oracle Software Configuration Manager, Oracle
Discoverer, Oracle Reports Developer, Oracle Warehouse Builder, and Oracle Business
Intelligence Beans.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Business Intelligence
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
OracleU M
Developer l icSuite 10g (continued)
I T K
For business intelligence, Oracle Developer Suite provides the capabilities for:
VN
NA • Extract, Transform, and Load: Oracle Warehouse Builder provides an easy to use,
graphical environment for rapidly designing, deploying, and managing business
intelligence systems. It also provides an extensible framework for integrating a diverse
set of data sources with BI tools.
• End User Query and Analysis: With Oracle Discoverer, you can create, modify, and
execute ad hoc queries and reports. More casual users can view and navigate through
predefined reports and graphs. Discoverer provides a business view to hide the
complexity of the underlying data structure. It enables you to focus on solving
business problems and brings insight to your data.
• Enterprise Reporting: Oracle Reports Developer enables you to access any data,
publish it in any format, and send it to any destination.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle DB
Browser Non-Oracle
a ble
e r
Wireless
a sf
Packaged
n
Apps
n-tr
no
s a
h
) eฺ a
Web
c o m i d
B2B Apps
Services
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
n
OracleU MA liceServer 10g
Application
I T K
Oracle Application Server 10g is a comprehensive and integrated application server that
VN
NA runs any Web site, portal, or Internet application. Oracle Application Server consists of a
set of services and utilities that can be used to implement applications in a distributed
environment for scalability and reliability. These are:
• Communication Services: These services handle incoming requests received by
Oracle Application Server. Some of these requests are processed by the Oracle HTTP
Server and some requests are routed to other areas of Oracle Application Server for
processing.
• Presentation Services: The presentation services of Oracle Application Server
generally output some kind of graphical representation, often in the form of HTML.
Oracle Application Server supports a variety of ways to generate presentation
presentations that can be delivered to the client ranging from low level programming
using Perl scripts and Java servlets, to high level frameworks using Oracle portal
services.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• User-friendly wizards
• Pluggable data sources
• Customizable report templates
• WYSIWYG live editor for paper reports
• Dynamic Web publishing using JSP/HTML
a ble
f e r
• Run-time customization
ans
n - t r
• Dynamic SQL execution
a no
• Portal integration a s
• Event-based reporting m ) h eฺ
co id
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
n
MA Reports
What IsUOracle l ice Developer?
I T K
Oracle Reports Developer is a component of the Oracle Developer Suite. Oracle Reports
VN
NA Developer is a collection of programs that allows you to centralize report processing and
better manage reporting efforts. Reports Builder is one of the program components
included with Oracle Reports Developer. Features include:
• Wizards that guide you through the report design process
• The ability to access data from any data source
• A query builder with a graphical representation of the SQL statement to obtain report
data
• Default report templates and layout styles that can be customized if needed
• A live editor that allows you to modify paper report layouts in WYSIWYG (“what you
see is what you get”) mode
• The ability to add dynamic report output to an HTML page by embedding custom
JavaServer Page (JSP) tags within an HTML document
• An integrated chart builder to graphically represent report data
• The ability to generate code to customize how reports will run
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Flexible reporting
• Reduced overhead
• Fast distribution
• Real time publishing
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
OracleASU MReportsl icServices
I T K
OracleAS Reports Services, a component of Oracle Application Server, provides the
VN
NA deployment environment for Oracle Reports Developer applications. OracleAS Reports
Services executes, distributes, and publishes your reports for enterprise wide reporting.
Using OracleAS Reports Services to deploy your reports results in gains of flexibility,
time savings, and processing capacity.
Users can schedule, batch, queue, view, and reuse reports according to their needs. This
flexibility improves the delivery of mission critical information and enhances workflow.
An advanced reports cache prevents needless rerunning of common reports and reduced
overhead on resources.
OracleAS Reports Services integrates into standard Web environments with JavaServer
Pages (JSPs), Java servlets, and Common Gateway Interface (CGI, maintained only for
backward compatibility) and provides powerful distribution and publishing capabilities
that broaden access and improve the usefulness of information. Users can distribute a
report using the Web, a printer, and e-mail, or split a report into multiple sections and
send each section to a different destination.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
HTTP
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 1-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
a ble
f e r
ans
n - t r
Web or Charts a no
Paper Drillh as
down
) eฺ
o m
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M User
Understanding
U l ic Requirements
I T K
In the first stage of the development, you determine what the user needs and expects.
VN
NA While it may be tempting to skip this stage and start building right away, it is not a good
idea to do so. Without a clear understanding of the users and their reporting needs, it is
virtually impossible to create effective enterprise reports.
To define user requirements:
• Gather relevant policies, business rules, and existing documentation
• Observe users and their daily job activities
• Interview a wide variety of users
Designing Reports
Specification
Data retrieval
Common features
Structure a ble
f e r
ans
n - t r
Style a no
h a s
m ) eฺ
o uid
a ilฺc GPublishing
g m ent Medium
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Designing
U MReports l ic
I T K
Before you create a report using any report-writing software, you must first consider the
VN
NA type of report that you are being asked to produce. You will have a specification of the
needs, required output, and the expected publishing medium, but you also need to know
the underlying structure that supports the requirement and the most efficient way to
retrieve data.
Also, consider whether this is a one-time requirement, or whether this specification shares
common features with other reports, especially where multiple reports are required in the
same application.
There are a few standard styles of reports that form the majority of all reporting
requirements. This section teaches you to recognize the common styles in order to enable
you to interpret your report requirements and choose the correct style when developing
report definitions.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Tabular
List of Products
Product
Number Description Price
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Tabular U M Style
Report l ic
I T K
You define the report structure by identifying the number of times each piece of data is
VN
NA 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.
In the List of Products report displayed above, 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.
Master-Detail
Outstanding Customer Items
Customer Name
Product
Number Price
a ble
f e r
ans
n - t r
Customer Name
a no
Product h a s
Number Price m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Report
Master-Detail
U l ic Style
I T K
The Outstanding Customer Items report displays one customer name, followed by several
VN
NA records containing the products and prices of items ordered but not yet received. This
structure is repeated for every customer who has unfulfilled orders. The customer name
does not repeat for every outstanding product; the frequency is different.
This report structure contains two groups.
Each list of products is directly related to the preceding customer name, which means that
there is a master-detail hierarchy. Customer information is in one group, called the
master, and the product information is in a second group, called the detail.
In this Master-Detail report, the headings or labels appear as follows:
Customer
Matrix
Customer Matrix
Product ID
Customer
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Matrix U M Style
Report l ic
I T K
The Customer Matrix report displays a group of master customer records down the page, a
VN
NA group of master product records across the page, and a group of detail summary
calculations.
The detail group is related to both of the master groups.
In this report structure, the master groups are on the same level, with the detail group
below.
This is an example of a simple matrix. Later you will see that matrix reports can have
multiple levels of nesting.
The matrix style is the only style in which a detail group is related to two different master
groups at the same level.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Retrieving
U l ic Data
Mand Sharing
I T K
One of the primary considerations of any report is to ensure that it runs efficiently. The
VN
NA following points provide guidance for future reference.
SQL and Database Access
In Oracle Reports, data for your report can come from any data source. This section
provides considerations for data stored in relational databases.
For data that is retrieved from a database, you use SQL SELECT statements. Aim to keep
database access to a minimum. The fewer queries your report contains, the faster it
retrieves data.
With hierarchical reports that contain more than one group, you can either use one query
and create additional groups, or use many queries and manually link the groups. The one-
query approach is usually preferable.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Running a Report
• Your browser
• OracleAS Portal application
• Command line (Start > Run)
• OracleAS Reports Queue Manager
• Java application
a ble
f e r
• Database trigger
ans
n - t r
• Menu integrated with a Forms application
a no
• Button in a Forms application as ) h eฺ
m
co uid
i l ฺ
g ma ent G
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Running U M l
a Report ic
I T K
There are many ways of running a report, depending on the application design. You can
VN
NA call a report from:
• A Web browser
• An OracleAS Portal application
• The command line, using the Start > Run option in Windows
• The OracleAS Reports Queue Manager
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Previewing Reports
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Previewing
U M Reports l ic
I T K
In Reports Builder, there are a number of ways in which you can preview your report.
VN
NA Run Web Layout
Reports Builder provides the option of previewing your Web report in a browser. Select
Program > Run Web Layout from the menu, or click the Run Web Layout iconic button
on the horizontal toolbar.
Run Paper Layout
To preview your paper report, select Program > Run Paper Layout from the menu, or click
the Run Paper Layout iconic button on the horizontal toolbar. Your output displays in the
Report Editor, which you will learn more about later in this course.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Print Preview
1
2
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
1 M
Print, en and Mail options
APageliSetup,
c
U
K Page options: First, Previous, Next, Last
N I2T
N AV 3 Go to specific page number
Previewing Reports (continued)
Print Preview
Select File > Print Preview to display your formatted paper report. Your output displays
in the Previewer window.
You can navigate through the Previewer using the scrollbars and the iconic buttons in the
toolbar at the top of the Previewer window. The toolbar includes buttons to perform the
following actions:
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Print Preview
1 2 3
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu 4
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1 K UNew Previewer, Close Previewer options
N I T
2 Zoom in, zoom out tools
V
NA 3 Drag this rectangle to split Previewer horizontally
4 Drag this rectangle to split Previewer vertically
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• RDF
• REP
• JSP
• HTML
• XML
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Supported
U M File Types
l ic
I T K
As you will learn in later lessons, report definitions created with Oracle Reports can be
VN
NA saved in a variety of formats and then deployed with Oracle Application Server.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 2 Overview
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
PracticeU Session Overview: Lesson 2
K
T practice session contains:
IThis
V N
NA • Previewing a report in a browser
• Executing a number of different reports. For each report, answer some questions
This practice session consists of a combination of practical and paper-based questions.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 2-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Developer
Reports Builder Reports Runtime Reports Converter
rwbuilder rwrun rwconverter
Reports Services
a ble
f e r
s
Reports Server Reports Client Queue Manager tran
rwserver rwclient rwrqm o n -
n a
a s
m ) h eฺ
Reports Servlet Reports
i l ฺ co CGIuid
rwservlet
g ma erwcgi n tG
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Reports U M l
Developer ic Executables
I T K
Reports Developer executable filenames are lower case.
VN
NA In Windows, all Oracle Reports executables follow a similar pattern: rw<>.exe.
In UNIX, the executables follow a pattern of rw<>.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Invoking U Reportslic
M Builder
K
IInT this lesson, you invoke Reports Builder, the rwbuilder executable, and look at the
N
V definitions of some reports to describe the components and objects in the builder.
NA When you invoke Reports Builder, the initial Welcome dialog box contains a check box
“Display at startup” that you can clear if you want to suppress this dialog box.
If you clear this option, and then later want to see the Welcome dialog box, you must
change the relevant option in the Preferences dialog box.
To display the Welcome dialog box:
1. Select Edit > Preferences.
2. Select the Wizards tab.
3. Select the Welcome Dialog check box.
a ble
f e r
Report Template PL/SQL Library ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ReportsU Builder lic
M
I T
The
KReports Builder interface enables you to create a number of different types of
VN modules, and it provides a Report Editor in which you can view the structure and objects
NA in a report module.
The Reports Builder module types are:
Module Type Description
Report A report definition
Template A skeleton definition containing common style and standards; can
include graphics; provides a standard format to enable quick and easy
development of professional standard look-and-feel reports
PL/SQL A stand-alone library containing PL/SQL program units—procedures,
Library functions, packages—that can be called from multiple reports
Paper
a ble
f e r
ans
n - t r
a no
Web a s
h
) eฺ
o m
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ReportU Data ic
M andlLayout
I T K
A report definition defines two main parts of a report and brings them together in the
VN
NA output.
• Data: Data structure and data to be displayed
• Layout: Formatting information about how the data appears in the output
Each report module can have a data model, a paper layout, and a Web layout. The data
model, as well as program units, can be shared by the paper and Web layouts.
A report can consist of:
• A data model and a paper layout.
• A data model and a Web layout.
• A data model, a paper layout, and a Web layout.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
ReportsU Builder Components
K
T Navigator
IObject
V N
NA The Object Navigator is a hierarchical browsing and editing interface that enables you to
locate and manipulate application objects quickly and easily. Features include:
• A hierarchy represented by indentation and expandable nodes (Top-level nodes show
module types, database objects, and built-in packages.)
• A find field and icons, enabling forward and backward searches for any level of node
or for an individual item in a node
• Icons in the horizontal toolbar replicating common File menu functions
Report Editor
The Report Editor contains different views to help you handle the data objects and layout
objects for Web and paper reports. These views will be introduced later in this lesson.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Navigating
U M Aroundl ic the Oracle Reports Main Menu
I T K
The main menu contains options to enable you to create, modify, and manage your
VN
NA Reports Builder modules.
The following table describes some common features in GUI menus.
Feature Description
Underline Shortcut key: [Alt]+letter
Ellipsis (...) Additional input, usually by dialog box
> Menu option has a submenu
Windows menu List of open windows; choose any window to make it active
Help List of Help facilities, such as online Help text and Quick Tour
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Wizards
• Report Wizard
• Data Wizard
• Graph Wizard
• Report Block Wizard
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Wizards U M l
in Reports ic Builder
I T K
Wizards provide an easy step-by-step interface for commonly performed tasks. The
VN
NA wizards in Reports Builder are:
• Report Wizard: The Report Wizard guides you through the steps to create a basic
paper report. Each page of the wizard asks you for information to help you create your
initial report.
• Data Wizard: This wizard helps you quickly define or modify a query for a
multiquery data models.
• Graph Wizard: You can add a variety of charts and graphs, including true 3-
dimensional graphs, to a report using the Graph Wizard. Charting is implemented in
Reports Builder with the Oracle BI graph bean.
• Report Block Wizard: This wizard enables you to quickly create a JSP report by
embedding report data into a Web page using Reports custom JSP tags.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Report Editor
• Data Model
• Web Source
• Paper Layout
• Paper Design
• Paper Parameter Form
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
The Report
U M Editorlic
I T K
The Report Editor contains views to handle the data objects and layout objects separately:
VN
NA View Description
Data Displays a structural representation of the data in a report. The
Model objects do not appear in the report output, but the structure
determines the layout style, and the data objects provide the values that
appear in the layout objects.
Web Displays the HTML / JSP source for a report. You can use this view to add
Source dynamic content to a Web page using the Report Block Wizard and the
Graph Wizard. You can also edit the Web source directly in this view.
Paper Displays the layout objects in a paper report and allows you to make many
Layout modifications to any layout object. All layout objects have properties that
you can modify using the Property Inspector.
The hierarchy of the layout objects is determined by the Data Model.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
View Description
Paper Displays output for paper reports and allows you to make many
Design commonly required, simple modifications to the layout, such as
spacing, formatting fields, color, and editing text, without having to open
the Paper Layout view.
Paper Displays the layout of the Paper Parameter Form that, at run time, allows
Parameter user input of parameter values.
Form
You can create many fully functional paper reports simply by using the Wizard and
modifying the report in the Paper Design view. However, this course also teaches you in
later lessons how to use the Data Model, Paper Layout, and Paper Parameter Form so that le
you can create more complex paper reports. You will also learn how to use the Web era
b
f
ans
Source view to add dynamic content to HTML pages to create reports for Web publishing.
- tr
no n
Technical Note a
Oracle Reports is integrated with Oracle JDeveloper to enablehJavaa s developers to leverage
the powerful publishing capabilities of Oracle Reports o
)
m their
within ฺ
eJava applications. You
l ฺ c u i d
m ai Destination
can create a new JSP-based Web report or a Pluggable
t G from within Oracle
JDeveloper. You can also debug a Reports JSP
@ n
g fromdewithin JDeveloper. For more
1
it3 Network
information, see the Oracle Technology
n this Stu(http://otn.oracle.com).
a v
m arn use
( ku se to
A R en
K UM lic
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
PL/SQL U M l ic Environment
Development
I T K
The PL/SQL development environment is the integrated functionality of Procedure
VN
NA Builder with Reports Builder. It provides:
• Development of server-side database triggers and stored procedures, functions, and
packages
• Development of libraries to hold PL/SQL program units
• Statement-level debugging of PL/SQL at run time
The Syntax Palette is a programming tool that enables you to display and copy the
constructs of PL/SQL language elements and built-in packages into the PL/SQL editor.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Object Navigator
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ObjectU M
Categoriesl ic
I T K
The Report Module consists of many objects that fall into the following four categories:
VN
NA •
•
Report level
Data Model
• Paper Layout
• Paper Parameter Form
The hierarchy of object categories can be viewed in the Object Navigator.
This section gives an overview of the objects in each category.
Note: All the objects mentioned in this section are discussed in greater detail in later
lessons.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Report-Level Objects
• Properties
• Triggers
• PL/SQL Program Units
• Attached Libraries
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
ObjectU Categories
en
MA lic(continued)
I T K
Report-Level Objects
VN
NA The report objects define the measurements, dimensions, triggers, and PL/SQL program
units of a report. The report object itself consists of the following:
Object Description
Properties Define page dimensions and Previewer settings, for example
Triggers Allow PL/SQL to be executed at different stages of the report
execution
PL/SQL Program Contain functions and procedures that can be called from
Units report-level objects in the same report
Attached Libraries External PL/SQL library file that contains sets of PL/SQL
program units that are independent of a report definition
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Parameters
• Queries
• Groups
• Columns
• Data Links
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ObjectU M
Categories l ic(continued)
I T KModel Objects
Data
VN The Data Model objects for a report define the data used in the report and the data
NA structure. Data Model objects appear in the Data Model view of the Report Editor and the
Object Navigator. Data Model objects can be of the following types:
Object Description
Parameters Provide for run-time defaults or user input; system parameters exist by
default; you can also create user parameters
Queries Select the data for your report
Groups Organize the data to form the required hierarchical structure
Columns 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
Data Links Join queries for complex data relationships
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 parameters in the
Object Navigator and modify them in the Property Inspector.
Unauthorized reproductionOracle Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Frames
• Repeating frames
• Fields
• Boilerplate
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ObjectU M
Categoriesl ic(continued)
I T K Layout Objects
Paper
VN The Paper Layout objects define the format of the report including the positioning and
NA appearance of data, text, and graphics. The main layout objects fall into the following
categories:
Object Description
Repeating frame Contains other objects and prints once for each record of the
associated group
Frame Contains other objects and prints only once
Field Contains data and other variable values and their formats
Boilerplate Contains text or graphics that may appear anywhere in the report
These and other layout objects are discussed later in the course.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Fields
• Boilerplate
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
ObjectU Categories
en
MA lic(continued)
I T K
Paper Parameter Form Objects
VN
NA The Paper Parameter Form objects define the appearance of the run-time parameter form.
You create and modify run-time paper parameter form objects.
Object Description
Field Contains parameter values
Boilerplate Contains constant text or graphics that appear on the run-
time paper parameter form
Note: The Paper Parameter Form controls the layout of the run-time paper parameter
form. The objects are similar to paper layout objects. The source of a parameter field
comes from a parameter that is a Data Model object. Parameters appear in the Object
Navigator, not in the Data Model view.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Object Interrelationship
1
Select
...
2
3
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1T K
U Each query fetches data records and structures them in the group hierarchy.
N I
V 2 Each group is the source of a repeating frame.
NA 3 Each column is a source of a field.
Object Interrelationship
Now that you know the different categories of objects, it is also important to understand
the relationship between these objects. The diagram above shows the relationships
between some of the most common objects, explained in terms of a simple tabular report.
Data Model Objects
• A query fetches records from the data source.
• Each fetched record becomes an instance of the related group.
• Each data source value is fetched into the related column.
Paper Layout Objects
• A column provides the value that is displayed in one or more layout fields.
• A field must display all instances of its related column value; therefore, each record
instance of a group is represented by a repeating frame.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Customizing
U M Your l icOracle Reports Session
I T K
Reports Builder Preferences allow you to customize some aspects of your Reports Builder
VN
NA session.
To access the Reports Preferences dialog box, select Edit > Preferences from the menu.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Saving Preferences
1 2
a ble
f e r
ans
n - t r
n o
3
sa
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
n
SavingU MA lice
Preferences
I T K are four tab pages in the Reports Preferences dialog box. Press the Help key ([F1]
There
VN in Windows) in the Preferences dialog box to see a description of each preference.
NA As well as session preferences, Reports Builder preferences enable you to set run-time
options when running your report within the builder.
The following table describes a few example preferences. Others are introduced when
applicable throughout the course.
Tab Preference Name Description
General Suppress Report Do not display the Report Editor when opening a
Editor on Open report. This saves you time when opening several
reports to make changes in the Object Navigator.
Unit of Set the unit of measurement that you want to use for
Measurement new reports that you create. Altering this setting
does not affect existing report definitions.
Wizards Welcome Dialog Check box to suppress or display the first Welcome
dialog box. There are several similar check boxes.
• REPORTS_PATH
• REPORTS_TMP
• REPORTS_RESOURCE
• ORACLE_PATH
• REPORTS_CLASSPATH
a ble
f e r
Windows: Modify in Registry
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
OracleU Reports ic
M Environment
l Variables
K
T Reports Developer uses many environment variables. All necessary environment
IOracle
V N
NA variables used to run reports are initialized for you by the installer. You can modify these
variables in your own environment and for different applications.
Setting Pathnames
Oracle Reports uses some environment variables to search for files at run time. This
enables you to build applications that are portable across platforms and directory
structures by avoiding hard-coded paths in file references in a report.
Variable Description
REPORTS_PATH A path that Reports searches for files at run time
REPORTS_TMP A path that will be used to create temporary files
REPORTS_RESOURCE A path that contains the location of the Reports
resource files, such as icon files
REPORTS_CLASSPATH A path that Reports searches to locate Java objects
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
A licen
MOnline
Using U the Help System
K
T table describes the Help menu options in Reports Builder.
IThe
V N
NA Help Menu Option Description
Help Topics This is the contents page for comprehensive online Help;
includes Index and Find tabs.
The Help key ([F1] for Windows) displays context-sensitive
online Help at any place in the builder.
Getting Started This option will navigate you to the Oracle Reports home page on
the Oracle Technology Network (http://
otn.oracle.com/products/reports/content.html).
From here you can access Getting Started with Oracle Reports, a
self-paced tutorial on this release.
About Reports Appears as two panels:
Builder The upper panel shows a server-side connection when you are
connected to a database server. If there is no connection, this panel
is blank.
The lower panel shows client-side components and their
version numbers.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Technical Note
In Oracle Reports Builder Developer 10g, the ‘Quick Tour’ option in the Help menu that
was available in earlier releases such as Oracle Reports Builder 9.0.2.0.1, has been
changed to ‘Getting Started’.
The Oracle Reports online Help system is also accessible through the Oracle Technology
Network (http://otn.oracle.com).
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 3 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-29 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 3-30 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
• Data Model
• Web Source
• Paper Layout
• Paper Parameter Form
• Program Units
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ReportU M Components
Module l ic
I T K
Each report definition consists of a data model, Web source, paper layout, program units,
VN
NA and paper parameter form, regardless of the storage format for the report. The same data
model and program unit objects can be shared by a paper based layout and a Web based
layout. In essence, you only have to define the actual report once because the same data
model and business logic used for paper publishing can also be used for Web publishing.
You will develop Web reports later in the course.
This lesson focuses on defining a simple data model and creating a paper layout.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Invoking
U Reportslic
M Builder and the Report Wizard
K
T you invoke Reports Builder, the Welcome dialog box gives you the option of using
IWhen
V N
NA the Wizard to build a new report. The Report Wizard provides an easy step-by-step
interface to create a new report.
The Report Wizard opens with a Welcome page. To suppress this page, clear the “Display
at startup” check box. You can reinstate this page in the same way as the Welcome dialog
box in Reports Builder; select the Wizard tab in the Preferences dialog box and then select
Report Wizard Welcome Page.
Each page of the Report Wizard asks you for information to help you create your initial
report. Step through the wizard pages, selecting Next and Back, until you are satisfied
with the initial information that you have entered. On the last page, select Finish.
Wizard Pages
• Report Style
• Data Source
Type
• Data Source ble
Definition f e r a
ans
• Fields n - t r
• Totals a no
h a s
• Labels m ) eฺ
o
• Template a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
CreatingU Ma Tabularl icReport Using the Wizard
I T K
You can use the Report Wizard to build eight styles of reports. In this section, you step
VN
NA through the wizard pages to create a tabular report.
Report Layout
On the first page you specify the type of layout you want the Wizard to generate. Your
options are:
• Web and Paper Layout
• Web Layout only
• Paper Layout only
In this lesson, you will create a paper report. You can select either Create both Web and
Paper Layout or Create Paper Layout only and then click Next.
Wizard Pages
• Report Style
• Data Source
Type
• Data Source ble
Definition f e r a
ans
• Fields n - t r
o
• Totals s an
• Labels ) ha
c o m ideฺ
• Template
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Creating
U a Tabular Report Using the Wizard (continued)
K
T Styles
IReport
V N
NA The second page of the Report Wizard shows the various styles of reports. Select Tabular
and then click Next.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
SelectingU Mthe Datal icSource Type
I T K
Next, you define the data source type for your report. Through the implementation of the
VN
NA Pluggable Data Source (PDS) feature in Oracle Reports, the data for your report can come
from any source you choose. Reports Builder provides interface definitions that act as a
translator between Reports Builder and a PDS by redefining Reports Builder's requests in
terms your data source uses.
Oracle Express Server, OLAP, JDBC, Text and XML pluggable data sources are shipped
with Oracle Reports. You can also define your own data source.
This lesson will use the default data source, SQL query.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using Query
U M Builderl ic
I T K
Building your query with the Query Builder GUI saves you time and increases the ease of
VN
NA use for developers not familiar with building SQL statements or with the application
tables.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Building a Query
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
BuildingU a Query
T K
ITo build a query using Query Builder:
VN
NA 1. Select Query Builder from the Query page in the Report Wizard.
2. Enter your username, password, and alias in the Connect dialog box that appears if
you have not already connected to the database.
3. Select the data tables to build the query.
4. Click Include. The tables appear in the selection area.
5. Click Close to close the Select Data Tables window.
6. In each table, double-click the column names that you want in the query, or use the
check boxes. To select all columns, double-click the Table title bar.
7. Click OK.
Query Builder copies the query syntax into the Report Wizard. You can modify the query
by reentering Query Builder or by modifying the SQL query statement text.
Note: If you prefer to write your own SQL statement, enter the syntax directly in the SQL
query statement area of the Query page. Alternatively, you can import the contents of a
file by clicking Import SQL Query.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
1 2 3 4
a ble
f e r
ans
n - t r
6 o
s an
) ha
5
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1 K
U Column sequence
N I T
V 2 Define column
NA 3 Sort
4 Logical operators for conditions
5 Conditions box for WHERE and HAVING clauses
6 Object type (T=Table, V= View, S=Synonym, A=Alias)
Query Builder Functions
This course does not teach the detailed functionality of Query Builder. You can find
comprehensive help in the Reports Builder online Help.
You can use Query Builder to build almost any query that you can write as a SQL
SELECT statement.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Function Description
Column sequence Defines the sequence of column names in the SELECT clause
Define column Defines a new, derived, or calculated column to be included in the
SELECT clause; use this definition to calculate and retrieve
derived values from the server
Sort Defines the ORDER BY clause; select the columns that you want le
to be sorted, and choose ascending or descending sorting order erab
WHERE and Place the cursor in the Conditions box on the left side of rthe
a n sf
Query
HAVING clauses Builder window. Type a condition. Use the AND, OR, n t NOT
-and
o
buttons to create compound conditions.
s an
h a
) eฺ
o m
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arn use
( ku se to
A R en
K UM lic
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Selecting U MDisplayed
l ic Fields
I T K
In the Field page, select each field from the Available Fields list and click >. The selected
VN
NA fields move to the Displayed Fields list.
To display all fields, click >>.
You can alter the sequence of displayed fields by dragging one field above or below
another in the list. The sequence of fields in this list determines how the fields appear in
the report output. In a tabular report, the fields appear in sequence from left to right across
the page.
Fields that remain in the Available Fields list are available for you to reference in your
report definition as hidden fields or in PL/SQL trigger code.
In the report output, the user sees only those fields that you transfer to the Displayed
Fields list.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Totals U M Labelslic
and
I T K
In the next two pages of the Report Wizard, you can create totals based on any of the
VN
NA displayed fields and modify the labels and width of the displayed fields.
Totals: Standard SQL aggregate functions are provided for creating totals in your report.
If you choose a total, the Wizard creates the total at each level of the report; that is, at
report level and also at each break level, if your report contains break (master/detail)
groups.
You can clear some of these totals later (by reentering the Wizard) if, for example, you
want a report-level total only.
Labels: The field label is displayed on one or more lines in the report output. In a tabular
report, the labels appear above the field values.
• If the initial label is wider than the field, Reports Builder allows enough space for the
label, or displays it on multiple lines.
• If you increase the number of characters in the label text in the reentrant Wizard, the
label can appear truncated in the report output.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
SelectingU Report Template
a
K
T a template from the list of predefined template names.
ISelect
V N
NA In a template, the fonts, styles, and colors are already selected for designated objects.
A variety of templates are available with the standard Reports installation.
To select a predefined template:
1. Select the Predefined Template option button, if it is not already selected.
2. Select a template from the Template list.
3. Click Finish.
Note: How to modify and use your own user-defined templates is covered later in the
course.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1 K U Magnify tool
N I T2 Page buttons
V
NA
Viewing the Paper Report Output
When you finish creating your report in the Report Wizard, the output appears in the Paper
Design view of the Report Editor.
Magnifying the Output
The Paper Design view contains a Magnify tool in the vertical toolbar. This provides a
view of the area of layout you want to see.
• To increase the view size, select the Magnify tool and click in the layout area.
• To reduce the view size, select the Magnify tool, hold down the Shift key, and click in
the layout area.
You can also use the View menu to magnify or reduce the size of the output. Select View >
Zoom to see your options.
Viewing Different Pages
The Paper Design toolbar contains four buttons, and the specific page option, with which
you can scroll through the pages of your report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
File > Save As...
n - t r
a no
h a s
m ) eฺ
o
xxx.rdf
a ilฺc Guid yyy.rdf
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Report
SavingUthe l icDefinition
I T K
Remember to save the report frequently by selecting Save in the toolbar, or by using the
VN
NA File > Save menu option.
The recommended format for storing paper reports is with an .rdf extension.
If you want to make a copy of the report definition in a different filename, use the menu
option File > Save As.
There is no toolbar button for the Save As option.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Creating U M l ic Styles
Other Report
I T K
In this section, you discover the other report styles available in the Wizard and the pages
VN
NA that the Wizard displays. There are two methods of creating additional report definitions
with the Report Wizard:
• Modifying an existing report definition by reentering the Report Wizard
• Creating a new report definition by restarting the step-by-step Wizard
Modifying a Report by Reentering the Wizard
The reentrant Report Wizard preserves your current settings and query. You can make
changes to these or other settings and click Finish when you are ready to reapply all the
wizard settings to your report.
To reenter the Wizard in an existing report definition, follow one of these steps:
1. Select Tools > Report Wizard.
2. In the Object Navigator, select Report Wizard from the right-mouse-button menu.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
2 1
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1 K UReports node
N I2T Create object button
V
NA Creating a New Report
To create a new report with the Wizard when you are already in Reports Builder:
1. Select the Reports node in the Object Navigator.
2. Select the green plus sign in the vertical toolbar.
3. Select the Use the Report Wizard check box.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Group Left
a ble
Group Above f e r
ans
n - t r
o
an
Location Id xxxx
Department Name xxxxxx ha s
Last Name Job Idom
) e ฺ
c i d
xxxx m ailฺ t Gu
xxxxx
xxxxxxx @ gxxxxden
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M
Break Report
A Labelsl i c en
K U
T
IIn a Group Left report, all the labels appear above the fields.
VN
NA In a Group Above report, labels for the bottom detail groups appear above the fields, as in
a tabular report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Wizard pages:
• Style
• Data
• Text
• Template
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Creating
U M c
MailingliLabels and Letters
K
T you choose the Mailing Label or Form Letter report style, the Wizard displays only
IWhen
V N
NA four tab pages: Style, Data, and Template pages as before, and the Text page.
To create text:
1. Select a field from the Available Field list.
2. Click > to display in the text area.
3. Type new lines and punctuation as required, or use the punctuation buttons supplied:
New Line, Space, Dash, Comma, and Period.
4. Select additional fields from the Available Fields list.
The selected field name appears in the text area, enclosed in optional angled brackets (<>)
and prefixed by an ampersand (&). This indicates that the field name is a variable. Each
variable is replaced by a specific value at run time.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
The optional angled brackets allow you to display two variables side by side with no era
ble
f
separating space.
-ans
tr
no n
What Is the Difference Between Mailing Labels and Form Letters?
a
h a s
Mailing Label Form Letter m ) eฺ
o
Multiple records on one page One record on a ilฺcpageGuid
each
g m ent
i t 3 1@ Stud
a v n this
m arn use
( ku se to
A R en
U M l ic
I T K
V N
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
an s
n - t r
a no
h a s
m ) eฺ
ฺc o id
• Use File > Generate to Filemail t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Previewing
U a Paper Report in a Web Browser
K
T you will learn in a later lesson, Oracle Reports enables you to easily create Web
IAs
V N
NA reports. However, you can deploy your paper reports on the Web with Oracle Reports. If
you know that your paper report will be deployed on the Web, you can preview your
report in your Web browser. You need to generate HTML or PDF output of your report in
order to display it in your browser.
Using Bookmarks
If you have used a break style for your paper report, you have the option of creating an
outline for navigation, or bookmark, within your paginated HTML or PDF report, using
the break column.
1. Select Insert > Bookmark.
Note: This menu option is enabled for the Paper Design and Paper Layout views
only.
2. Select a column from the Available Columns list.
3. Click > to display in the Bookmark area.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Previewing
U a Paper Report in a Web Browser (continued)
K
T preview your paper report output in a Web browser:
ITo
V N
NA 1. Select or open the report.
2. Select File > Generate to File to specify the output format:
Use Paginated HTML for HTML output.
Use Paginated HTMLCSS for HTML Style Sheets.
Use PDF for PDF output.
3. In the Save dialog box, you can modify the name and location of your HTML or
PDF file.
4. Open your browser.
5. If you are using Internet Explorer, select File > Open and specify the location and
name of your file. If you are using Netscape Navigator, select File > Open Page and
specify the location and name of your file.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-29 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Practice 4 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-31 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-32 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-33 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 4-34 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
4
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U
1T KToolbar
N I
V 2 Stylebar
NA
3 Tool palette
4 Status bar
Modifying a Report
Common modifications:
• Align columns
• Set format masks
• Manipulate objects
• Edit text
a ble
f e r
• Modify visual attributes
ans
n - t r
• Highlight data using conditional formats o
• Insert page numbers and current date as an
m ) h eฺ
i l ฺ co uid
g ma ent G
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ModifyingU Ma Report l ic in the Paper Design View
I T K
In this section, you learn about some of the most commonly required changes that you
VN
NA need to make to reports after creating the initial definition with the wizard:
• Aligning columns
• Setting format masks
• Manipulating objects
• Editing text
• Modifying visual attributes
• Highlighting data using conditional formatting
• Inserting page numbering
• Inserting current date and time
Aligning Columns
a ble
f e r
ans
n - t r
a no
h a s
Point and
m ) eฺ
Select
o id
select
a ilฺc“Align G uRight”
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Aligning U M
Columns l ic
I T K
In the sample report output, in the left panel, the salary values are aligned to the left. You
VN
NA often need to align numbers to the right.
1. Select the column that you want to align.
2. Select the “align right” icon on the stylebar.
You can align each object separately, so that you can center the labels if you want.
However, if you want to align the values and the labels to the right, use [Shift]-click to
select more than one object at a time.
a ble
f e r
ans
n - t r
1 2 3 4 o5
a n
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
UM lic
1 K Currency symbol
V N 2T Percentage symbol
I
NA 3 Thousand separator
4 Add decimal places
5 Remove decimal places
Manipulating Objects
• Clear fields
• Move fields
• Resize fields
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
lฺc Guid
Flex Mode adjusts layoutgduring a i
m enchanges. t
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Objects
Manipulating
U l ic
I T K
You can alter the position of objects, such as fields and labels, by selecting the object you
VN
NA want to move and dragging it to a new position.
Alter the size of an object by selecting one of the square handles and dragging to the
required size, either smaller or larger.
Flex Mode: When you move or resize an object, the rest of the report adjusts as
necessary. This is controlled by the Flex Mode option, which is a button in the stylebar.
Flex Mode is enabled by default, so that all report objects flex, or adjust, to make room for
your modifications.
c o m ideฺ
Asia Pacific 770 1993
1993
Europe 400
Asia Pacific 770
Year
1994
Region
Americas
Sales
210
Year
m
1994ailฺ t Gu
Region
Americas
Sales
210
Year Region Sales
1994 Europe 390
@ g den
1994 Europe 390 1994 Americas 210
t31 is Stu
1994 Europe 390
n i
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Modifying
U Visual Attributes
K
T change field and boilerplate font:
ITo
V N
NA 1. Select one or more objects.
2. Use the font pop-up lists in the stylebar to change font face and size.
To edit boilerplate text:
1. Select the text you want to edit.
The text object is highlighted.
2. Click in the text to position the cursor in the text editor.
3. Edit the text as required.
4. Select any area outside the text object to accept the change.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Applying
U Conditional Formatting
K
T can highlight or suppress objects using conditional formats.
IYou
V N
NA To create format exceptions:
1. Select an object.
2. Display the pop-up menu and select Conditional Formatting, or select 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. Click OK.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Inserted easily
• Customizable extensions
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Inserting
U ic
MPage Numbers,
l Dates, and Times
K
T add page numbers and the current date to your report in the Paper Design view, select
ITo
V N
NA the appropriate items from the Insert menu.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Customizing Dates
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Customizing
U M Dates l ic
I T K
If the mask that you want does not exist, and you do not want to add it to your
VN
NA preferences, select Custom. This dialog box provides a read-only list of tokens available
for you to build your own style, if you understand the Oracle format tokens.
Note: The Date and Time Format Mask Syntax topic in the Help system fully describes
the format mask syntax.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 5 Overview
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
PracticeU M c
SessionliOverview: Lesson 5
K
T practice session involves modifying reports by applying changes in the Paper Design
IThis
V N
NA view. You reuse some of the reports that you created in the last session.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 5-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Modifying a Template
Margin Body
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Modifying
U Ma Template
l ic
I T K
A report template is not the same as a report definition. A template is divided into regions,
VN
NA which the Report Wizard references while creating the paper report definition.
The Template Editor enables you to modify existing objects in the margin and body
regions of the template. You can also customize or add other reports objects: parameters,
report-level triggers, program units, and attached PL/SQL libraries.
Region Description
Body Contains default section to apply changes to all report styles, and
override sections to apply individual changes to different report
styles
Margin Defines objects that appear in the margin of all pages
Include
objects
such as:
• Images
• Text ble
f e r a
• Page s
Numbers - t r an
n no
• Date s a
h
) eฺ a
o m
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Customizing
U c
M theliTemplate Margin
K
T can copy, create, or import various objects into the margin of the template.
IYou
N
V • Images: Insert > Image
NA • Text: Text tool in the vertical toolbar
• Page Numbers: Insert > Page Number, and the button on the horizontal toolbar
• Date: Insert > Data and Time, and the button on the horizontal toolbar
Note: The toolbar button for inserting page numbers is visible in the Template Editor
when the margin area is selected. This button, and the one to insert date and time, are
shortcuts for menu items.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Customizing
U c
M theliTemplate Body
K
IInT the template body, you can modify fonts, colors, and fills of the field, label, summary,
N
V and frame objects. You make changes directly in the Template Editor or by using the
NA Property Inspector and pop-up lists corresponding to the object selected.
If you reenter the Report Wizard and reapply the template in the Template tab, Reports
Builder reapplies the template background and margin objects to your report.
The report retains any live changes you made to the body, such as modifying the font or
color of text or fields.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Links
AddingUWeb l icto a Template for Report HTML Output
IAT K
paper report output in HTML format can include many types of Web links, such as a
VN document header or footer for placing a logo or a link at the beginning or end of a
NA document, or a page header or footer for placing a logo at the beginning or end of one
page or all pages of an HTML document.
To add a Web link to a template:
1. In the Object Navigator, open the template Property Inspector.
2. Under the Report Escapes node, set the type for the property of choice:
- Use Text if you will enter the property value.
- Use File if you will import the property value from a file.
3. Under the Report Escapes node, set the value for the property of choice:
- Enter the value.
- Use the browse button to select an HTML file to import.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
Reports.Tabular_Template_File =
f e r
(rwbeige, Reports.Tabular_Template_Desc =
ans
rwblue, n - t r
no
("Beige",
mytemp, "Blue", a
rwgray, "My Template )Description", has
rwgreen, "Gray",ฺco
m ideฺ
m ail t Gu
rwpeach,
@ g den
"Green",
n i t31 is Stu
"Peach",
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Predefining
U Your Own Templates
K
T you create your own templates, you might want to include some in the predefined
IWhen
V N
NA template list that appears when creating a report using the Wizard.
You can then select the template from the descriptive list for all similar reports that you
create, instead of searching through your file system to find the template file that you
want.
In this section, you learn how to register the template file as a predefined template by
inserting an entry in the preferences file and storing the template and (optional) image in
the correct template directory.
Reports Builder builds the list of predefined templates and their images by reading
template names from the Oracle Reports preferences file and mapping to similarly named
.bmp files.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 6-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 6-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
AddingUaM Template l ic Preview Image
I T
Each
Kpredefined template has a small image associated with it that is displayed on the
VN right side of the template page of the Report Wizard. The image is optional but is a useful
NA graphical example of how the report looks if you apply that template.
To display your own image, use the template to create a simple report and create an image
of the report output.
To create a template image:
1. Create a simple report using your new template. For example, use the tables EMP
and DEPT.
2. Create a bitmap image (screenshot) of the top left corner, including enough data to
make the style clear to the user.
Note: The bitmaps supplied are 200 x 150 pixels.
3. Name the file *.bmp and store it in the same directory as the template
<oracle_home>\reports\templates.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 6-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 6-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 6 Overview
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
PracticeU Session Overview: Lesson 6
K
T practice session contains:
IThis
V N
NA • Customizing an existing paper template
• Applying the modified template to an existing report
In this practice session, you open an existing template, which is one of the standard
templates shipped with the Oracle Reports Developer installation.
You modify objects in the margin and body sections and save the template to a new
filename. Then, you apply the modified template to an existing report and note the
differences.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 6-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 6-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 6-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M
What isUJavaServer l ic Page (JSP) Technology?
I T K
JavaServer Page technology is an extension to the Java servlet technology from Sun that
VN
NA provides a simple programming vehicle for displaying dynamic content on a Web page.
JSP is a server-side technology. A JSP is an HTML page with embedded Java source code
that is executed in the Web server or application server. The HTML provides the page
layout that is returned to the Web browser, and the Java provides the business logic.
JSP Advantages
<HTML>
<HEAD><TITLE>Simple JSP Example</TITLE></HEAD>
<BODY>
Welcome to my page!!
Current time is :
a ble
<%= new java.util.Date() %> f e r
ans
</BODY>
n - t r
</HTML> a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
SimpleUJSP M Examplel ic
I T K
Before you learn about Reports JSPs, let’s look at a very basic JSP example.
VN
NA This is the source code for a JSP that prints out a greeting and the current date:
<HTML>
<HEAD><TITLE>Simple JSP Example</TITLE></HEAD>
<BODY>
Welcome to my page!!
Current time is:
<%=new java.util.Date()%>
</BODY>
</HTML>
• The first five lines of code are standard HTML code, defining the title and start of the
body of the page.
• The line that follows prints the date and time using a Java expression between the <%=
and %> tags. This expression creates a new instance of the java.util.Date type, which
is set to the current time when the object executes.
• The object is then translated into a string and returned to the browser.
Two Options:
• Open an existing HTML page in Reports Builder
• Use one of the predefined HTML templates shipped
with Oracle Reports Developer
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
BuildingU M l ic
a Web Report
I T K
You can easily create Web reports using the declarative features in the Report Wizard.
VN
NA Oracle Reports gives you two options for building a Web report.
1. You can design a Web page using your favorite HTML authoring tool. You open
your HTML page in Reports Builder and add dynamic content to the page. The
dynamic data is “injected” into the appropriate sections of the page using JSP tags.
You can use the Report Block Wizard to do this or you can enter the code manually
using the Web Source view of the Report Editor.
2. You can use one of the predefined HTML templates that are shipped with Oracle
Reports and use the Report Wizard to define the data model and Web layout.
In this lesson, we will use a predefined HTML template and the Report Wizard to build a
Web report and save it in JSP format. In a later lesson, you will learn how to add dynamic
content to an existing Web page using the Report Block Wizard and the Web Source view
of the Report Editor.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using the
U MReportlicWizard
I T K
You have already used the Report Wizard to create paper reports. The Wizard gives you
VN
NA the option of generating a Web and/or paper layout for a single report definition. The
default option is to create both a Web and paper layout. Recall that every report definition
has a data model and a layout. The same data model can be shared by a Web layout and
paper layout.
To use the Report Wizard and a predefined HTML template, create the report definition
just as you would a paper report. Step through the pages of the Wizard and select the
report style, data source, fields to display, and so forth. From the templates page, select
one of the predefined templates. You will notice that the list of predefined templates is the
same as it is for paper reports. Oracle Reports provides corresponding HTML templates
and style sheets for your Web reports. You will learn more about HTML templates and
style sheets later in this course.
When you click Finish in the Wizard, Reports Builder generates the layout type that you
selected. If you opted for both Web and paper layout, the Paper Design view displays by
default. If you opted for Web layout only, the Web Source view of the Report Editor
displays.
Data model
information
a ble
HTML template f e r
information ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
End of report
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Web Source
U M Viewlic
I T K
The Web Source view of the Report Editor displays the source code for your Web report,
VN
NA including HTML tags and JSP tags. The view presents a Web page in which you can add
dynamic report blocks using the Report Block Wizard, and graphs using the Graph
Wizard. You will do both in a later lesson.
Every report module contains a Web Source component, whether a Web layout has been
created or not. If you open the Web Source view for a new report module for which no
data model or layout has been defined, you will see that the view is not empty. Reports
Builder provides the required JSP declarations for any report module, as well as place
holders for the content that the Report Wizard will create.
To display the Web Source view, do one of the following:
• Select View > Change View > Web Source from the menu in the Report Editor.
• Select the Web Source icon in the horizontal toolbar in the Report Editor.
• Double-click the icon next to the Web Source node in the Object Navigator.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
JSP Tags
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Example U M l ic
I T K
The Web Source in this example was generated by the Report Wizard using the following
VN
NA specifications:
• Style: Tabular
• Data source: SQL query
• Data:
SELECT FIRST_NAME, LAST_NAME, EMAIL, HIRE_DATE
FROM EMPLOYEES
• Fields: Display all fields
• Template: Blue
The code generated by Reports Builder for the data model of the report is shown in the
slide.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Example (continued)
Modifying a Web Report Using the Report Wizard
You can modify a Web report using the reentrant feature of the Report Wizard just as you
did for paper reports. The Wizard preserves your current setting and data source
definition. You can make changes to these and other settings and click Finish when you
are ready to reapply the Wizard settings to your Web report.
Saving Your Web Report Definition
The preferred format for saving a Web report is Reports JSP (*.jsp) and not HTM or
HTML. The reason for this is that certain Web servers (for example, Apache) see the
HTML extension, assume the document is static, and simply return the document to the
browser without ever executing the JSP code it contains. Furthermore, if your Web report
has a jsp extension, it is also recognizable to Java development environments, such as
Oracle JDeveloper, and you can utilize the Java debugging tools available in these r a ble
environments. n s fe
-atr
Technical Note no n
s a
A Reports JSP contains the full definition of your report module.
) h a However, Reports
Builder hides a good deal of the code in the Web Sourcem
o view. You
d e ฺcan view the module,
<module_name>.jsp, outside the Builder using c
ilฺa text G i
u and see much more—
editor
m a t
data source, data links, layout, and so forth. g
1@ Stud en
i t 3
n this
a v
m arn use
( ku se to
A R en
K UM lic
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Generating Output
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Generating
U Output
K
T preview your Web report in a browser:
ITo
V N
NA 1. Use the Run Web Layout button on the horizontal toolbar.
2. Select Program > Run Web Layout
To run a report from a browser, use a URL syntax. You can give your users the URL
syntax needed to make the report request from their browser, or you can add the URL
syntax to a Web site as a hyperlink. You will learn about URL syntax in a later lesson.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 7 Overview
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
PracticeU Session Overview: Lesson 7
K
T practice session contains:
IThis
V N
NA • Creating reports for the Web using the Report Wizard
• Examining the Web source code
• Modifying a Web report using the Report Wizard
In this practice session, you create simple reports for the Web using the Report Wizard.
You also examine the Web source code to identify specific JSP tags.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 7-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
The DataU l ic
MModel Objects
I T K
The Data Model defines the report data and its hierarchy—that is, the report structure. The
VN
NA Data Model does not define any formatting attributes for the report output. This section
introduces you to the objects in the Data Model and their appearance in the Data Model
editor.
The Data Model consists of these objects:
• Query: 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.
• Group: Each group is owned by a query. By default, Oracle Reports creates one
group for each query.
• Column: Columns are owned by the group to which they belong. By default, the
group contains one column for each select expression in the Query.
• Link: 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.
• Parameter: Parameters are owned by the report. You can create parameters that allow
users to enter value restrictions at run time. Oracle9i Reports also provides a number
of system parameters by default.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Modifying
U MProperties
l ic of a Query
I T K
You can modify a query, including the SQL statement, by changing properties in the
VN
NA query Property Inspector.
To edit the query statement, open the Property Inspector, choose the SQL Query
Statement property, and click the left button.
The SQL Query Statement dialog box appears.
You can also use the Data Wizard to make changes to the query. The Data Wizard is
covered in a later lesson.
Modifying Columns
If you add to, rename, or delete a column or expression in the query statement, Oracle
Reports automatically creates, revises, or deletes the corresponding column in the Data
Model.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
More Properties
Note: For ease of maintenance, do not enter comments in different places for the same
query.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Applying Changes
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Group Hierarchy
a ble
f e r
1 ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid 2
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
UM lic
I1T KDrag columns up or left to create a parent group.
V N 2 Drag columns down or right to create a child group.
NA
Group Hierarchy
The groups in Oracle Reports exist in a hierarchy. You can alter the group hierarchy by
creating new groups.
As you have already seen, a single query produces one default group. You can produce a
control break report structure by creating one or more additional groups above the default.
The following example of a single query, called Q_EMP, is the basis for the hierarchical
report.
SELECT e.first_name, e.last_name, e.job_id,
d.department_id, d.department_name
FROM employees e, departments d
WHERE e.department_id = d.department_id
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
2
a ble
f e r
3 ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U
1T K Break group controls primary sort; use the Break Order property
N I
V 2 Order by DEPARTMENT_NAME column: Break Order = Descending
NA 3 Child group controls final sort; uses ORDER BY clause in the query
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Query Modifications
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Filtering
U MData in laicGroup
I T K
A group filter allows you to control the processing of records in each group. This section
VN
NA briefly describes the two types of filters available and how to use a packaged filter to
restrict the number of records returned.
There are two types of group filters:
• A packaged filter allows you to restrict processing to a predetermined number of
records.
• A developer-created filter allows you to control processing dependent on conditional
PL/SQL code.
Note: Developer-created filters are covered in more detail later in the course.
In the Data Model editor, the circle above the group object changes to green when a filter
is active.
Instructor Note
Demonstration: In the same report, restrict G_DEPT to the first two records.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using a U M
Packaged l icFilter
I T K
A packaged filter allows you to specify the number of records that you wish to retrieve in
VN
NA a group. You can use this to restrict the data while developing your reports.
There are two packaged filters, First and Last.
• The First filter retrieves the first <n> records for the group.
• The Last filter retrieves the last <n> records for the group.
To apply a packaged filter:
1. Double-click the group title bar, or its icon in the Object Navigator, to display the
Property Inspector.
2. Change Filter Type to First or Last.
The Number of Records property appears.
3. Enter the number of records you require.
How is data fetched in a packaged filter?
• First filter: Oracle Reports retrieves a multiple of the array size, sufficient to satisfy
the filter, based on a parameter value at run time.
• Last filter: Oracle Reports must retrieve all records to establish which are last.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 8: Overview
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
PracticeU Session Overview: Lesson 8
K
T practice session contains:
IThis
V N
NA • Modifying report hierarchy by creating additional groups
• Restricting records in a query
• Restricting records with a packaged filter
In this practice session, you modify an existing tabular report and create a break report.
Using two different techniques, you restrict the records in a report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 8-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Text
Express JDBC OLAP SQL XML
files
a ble
f e r
ans
- t r
Oracle n no
s a
Reports h a
m ) eฺ
o
Client a ilฺc Guid Oracle10g
m
g de n t
@
n i t3 is Stu
1
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Pluggable
U Data Sources
K
IATpluggable data source, or PDS, is an Oracle Reports feature that enables data input from
V N
NA numerous sources through the implementation of design time and runtime Java
application program interfaces (APIs). Reports Builder provides interface definition,
which acts as a translator between Reports Builder and the data source by redefining the
Builder’s requests in terms of the specific data source.
The PDS feature also enables you to leverage various capabilities in Oracle Reports such
as aggregation, summarization, formatting, and scheduling not only on data that is
accessed through SQL, but on data from any data source.
Out-of-the-Box Options
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Pluggable U ic
MData Sources
l (continued)
K
IInT addition to traditional data sources such as SQL, PL/SQL, and Express, Oracle Reports
V N
NA provides you with pluggable data sources supporting:
• XML data streams, both online and from a file
• JDBC connections
• OLAP databases
• Text files
The design time API makes it possible to open the appropriate editor to modify your
query: Query Builder is the interface to edit a relational query, while a text editor or XML
editor would be used to edit an XML data source query.
You can also write your own data source mechanism. If your business works with a
specific file and/or data format that you want to make available for reporting, you can
create a PDS for this particular format and incorporate it into Reports Builder to access
your own unique data source.
More information on defining pluggable data sources is covered in the course Oracle9i
Reports: Integrate Pluggable Data Sources.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using XML
U M as a Data
l ic Source
I T K
XML enables business-to-business exchanges of data across applications and platforms.
VN
NA Extensible Markup Language, or XML, is an open standard for describing data and is used
for defining data elements on a Web page and business-to-business documents. XML uses
tags, similar to the tags used in HTML. However, while HTML is primarily used for
formatting and displaying text and images in a browser, XML is used for structuring data.
XML enables the exchange of data between applications in a simple, non proprietary
format.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Example:U MXML Data
l ic Stream
I T K
The Human Resource (HR) department is preparing for quarterly bonuses. Each manager
VN
NA has submitted a percent increase for the employees in his group. HR has compiled a list of
employee ID numbers, the bonus amount, and the associated percentage. You are
preparing the Employee Compensation report and eventually need to merge the data from
HR with the employee data stored in the corporate database.
In our example, the data provided by HR is stored in the file system in an XML document.
An XML data stream can also be accessed remotely through a URL. A subset of the data
stream from HR follows. In this example, the employee with ID 100 is receiving a $2000
bonus, which is 8% of his compensation.
<ROW>
<EMPID>100</EMPID>
<BONUS>2000</BONUS>
<PERINC>8</PERINC>
</ROW>
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
XML Report
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
The XML U Report
T K
IThe output for the report is a simple tabular report.
VN
NA Note: All the data is of type character. This is because we used a DTD to describe the
XML and DTDs do not contain data type information. A DTD treats all data as character
data. Therefore, trying to format the BONUS or PERINC columns numerically in the
Paper Design view will have no effect. To overcome this, we could use an XML schema
to define our data. An XML schema is more complex to build but it does contain
information about other data types.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
Multidimensional
ans
objects n - t r
a no
h a s
OLAP database
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using OLAP
U M as aliDatac Source
I T K
Online Analytical Processing (OLAP) queries involve inter-row calculations, time series
VN
NA analysis, and access to aggregated historical and current data.
OLAP applications span a variety of organizational functions. Finance departments use
OLAP for applications such as budgeting, activity-based costing (allocations), financial
performance analysis, and financial modeling. Sales analysis and forecasting are two of
the OLAP applications found in sales departments. Among other applications, marketing
departments use OLAP for market research analysis, sales forecasting, promotions
analysis, customer analysis, and market/customer segmentation. Typical manufacturing
OLAP applications include production planning and defect analysis.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
DefiningU OLAP Query
an
K
T define an OLAP query:
ITo
V N
NA 1. Select OLAP Query on the Data Source page of the Report Wizard.
2. On the Data page, select the Query Definition button. The Connect (OLAP Data
Source) dialog box displays. Specify information about your OLAP query:
- Connection Editor tab: Enter the connection details to your OLAP data source.
- OLAP Connection tab: Specify the user name and password for the OLAP data
source.
3. After you connect to your OLAP data source, the BI Bean Query Wizard displays,
enabling you to design the OLAP query.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Example:U ic
MOLAP lReport
I T K
The example illustrates the use of OLAP in a finance department. This report compares
VN
NA budgeted versus actual costs incurred for the period 2000 and 2001.
Note: Due to the multi-dimensional nature of OLAP data, it is best displayed in a Matrix
report.
Technical Note
For more information on how to install and configure the OLAP PDS into an existing
Oracle Reports installation, refer to the Oracle9i OLAP Data Source technical note on
Oracle Technology Network (http://otn.oracle.com). This note is available in the Oracle
Reports Plugin Exchange section of OTN.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using Text
U M as a Data
l ic Source
I T K
The information you want to publish may be in a character-delimited text file. You can
VN
NA leverage the Oracle Reports PDS architecture to connect to your data source by using a
text file as your pluggable data source. The Text PDS is installed by default with Oracle
Reports.
Example
Suppose you want to generate a report based on the product information stored in a text
file that is in CSV (comma-separated values) format.
To publish meaningful information using this text file, you perform two main activities:
• Configure Reports Builder to recognize your text file as a pluggable data source.
• Use the Report Wizard to create a paper report based on the text data source.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
SettingUUpM the Text
l ic PDS Configuration File
I T K
Before you can use a text file as your pluggable data source, you must set up the Text
VN PDS configuration file (textpds.conf) with the definition of the values in your text
NA file. The textpds.conf file is located in the ORACLE_HOME\reports\conf
directory. You edit this file and add entries that define the data elements in your data
source. You also define the properties of each column in the text file.
These entries enable Reports Builder to recognize your text file as a PDS. When you
choose Text Query as your data source in the Report Wizard, your text file displays as an
option.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Defining U a Text Query
K
T you update the textpds.conf file, launch Reports Builder.
IAfter
V N
NA Note: If Reports Builder was already open when you modified the textpds.conf file, you
should shut down Reports Builder and relaunch it.
To define a Text query:
1. Select Text Query on the Data Source page of the Report Wizard.
2. On the Data page, select the Query Definition button. The Define Text Query dialog
box displays. Specify information about your Text query:
- Format of the Text File
- Location of the Text File
Note: The Data Definition section of the Define Text Query dialog displays the format
that you added to the textpds.conf file.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M PDSlicReport
SampleUText
I T K
The Paper Design view for the Text PDS report is displayed. The report style is Group
VN
NA Above.
Technical Note
For more information on building reports using the Text pluggable data source, refer to
the Building a Report with a Text Pluggable Data Source chapter in the Oracle Reports
Building Reports 10g (9.0.4) manual.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
JDBC data sourceom
) eฺ
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using JDBC
U c Source
M as aliData
I T K
Java Database Connectivity (JDBC) is an application program interface (API) that
VN
NA provides a common way to maintain a connection to a database and lets you access
virtually any tabular data source from the Java programming language. It provides cross-
DBMS connectivity to a wide range of relational databases and other tabular data
sources, such as spreadsheets or flat files. With a JDBC technology-enabled driver, you
can easily connect all corporate data, even in a heterogeneous environment. The JDBC
PDS is an implementation of the Oracle Reports PDS API that allows you to access JDBC
data sources.
The JDBC PDS is a plug-in data source that is installed by default with Oracle Reports to
allow access to all the JDBC supported data sources. The JDBC PDS supports all types of
JDBC drivers.
The JDBC PDS enables you to access any JDBC sources, such as:
• An RDBMS like Oracle, DB2, Sybase, or SQL Server
• A non-relational data source such as Microsoft Excel
• Any ODBC data source through the JDBC-ODBC bridge
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M
JDBC Configuration
U l ic File
I T
The
Kjdbcpds.conf file is the configuration file for the JDBC Query of Oracle Reports
VN and is located under ORACLE_HOME\reports\conf. In this file, you specify
NA information about the different JDBC drivers that you want to use.
This file is pre-configured for the Merant DataDirect drivers provided by Oracle. If you
want to include any other JDBC drivers, you must add or modify relevant entries in the
jdbcpds.conf file.
The jdbcpds.conf file contains two sections:
• The Internal DTD section describes the XML format and driver configuration
information. You should not modify this section.
• The XML section provides details about the driver, such as driver name, connect
string format, and driver class. You can modify or add your driver information in this
section.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Technical Note
Oracle provides a set of Merant DataDirect drivers that can be downloaded from the
Oracle Technology Network (http://otn.oracle.com). The driver configuration
file, jdbcpds.conf, contains relevant entries for the Merant DataDirect drivers.
However, you need to install the appropriate .jar files and specify them in Oracle
Reports specific classpath entries in order to make them available to Reports Builder and
OracleAS Reports Services.
For more information on configuring and using a JDBC pluggable data source with
OracleAS Reports Services, refer to the technical note Configuring and Using the JDBC
PDS on Oracle Technology Network (http://otn.oracle.com). See also the
Oracle Application Server Reports Services: Publishing Reports to the Web manual.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Defining U M c
a JDBCliQuery
I T K
After configuring the relevant JDBC drivers, you can define and run a JDBC query using
VN
NA either SQL or a stored procedure.
To define a JDBC query:
1. Select JDBC Query on the Data Source page of the Report Wizard.
2. On the Data page, select the Query Definition button. The JDBC Query dialog box
displays. Specify information about your JDBC query:
a. SQL statement: For example, SELECT * FROM DEPARTMENTS;
b. Stored procedure: For example, TestProc(40)
Note: The stored procedure call should contain the complete call syntax of
your database’s stored procedure.
c. Sign-on Parameter: Specifies the connection information for a database. You
can select a value from the drop down list. The default sign-on parameter value
is p_jdbcpds. Enter a new sign-on name and click Connect to specify a new
database connection.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Defining
U M c (continued)
a JDBCliQuery
I T K d. Connect button: Displays the Connect dialog.
VN e. Enter the connection information such as user name, password, and database
NA name
f. Select the driver type from the Driver Type drop-down list.
g. Click the Connect button to connect to the database using the new sign-on
details.
h. Click the OK button in the JDBC Query dialog to execute the JDBC query.
i. Complete the remaining steps in the wizard to define the layout and to run the
report based on your JDBC query.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
1 le
r a b
5 2 s f e
- t r an
3 o n
6
s an
4 ) ha
7 o m ideฺ
c
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U Query
1 KSQL 5 Express Server Query
N I T
V 2 XML Query 6 JDBC Query
NA 3 Text Query 7 Ref Cursor Query
4 OLAP Query
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
AddingUNew
en
MADatalic(continued)
I T K
To create a new query using the Data Wizard:
VN
NA 1. In the Data Model view of the Report Editor, right mouse click and select Data
Wizard from the pop-up menu.
2. Name the query as required.
3. Select the Query type.
4. Enter the query as you would using the Report Wizard. For SQL queries, you can
create the query in one of three ways:
- Enter the syntax of a valid SELECT statement.
- Select Query Builder and build the query.
- Select Import Query and select a .sql file.
5. Create additional groups as required.
6. Create totals as required.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using REF
U M Cursor l icQueries
I T K
A REF cursor query uses PL/SQL to fetch data. Each REF cursor query is associated with
VN
NA a PL/SQL function that returns a REF cursor. The function must ensure that the REF
cursor is opened and associated with a SELECT statement that has a SELECT list that
matches the type of the REF cursor.
To create a REF Cursor Query:
1. Create a package that defines a REF cursor type.
PACKAGE RefCurPack IS
TYPE EmpCurType IS REF CURSOR RETURN employees%ROWTYPE;
END;
Note: The package can be a local program unit, part of a PL/SQL library, or a stored
program unit.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-29 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Viewing U M l
Output fromic Multiple Query Reports
I T K
When you reenter the Report Wizard and update the paper layout based on multiple
VN
NA queries in the Data Model, the order in which unrelated groups of records appear in the
output depends on the position of queries and groups in the Data Model.
It is the position of the group that determines the processing, not the query.
This is also the case for Web reports. You update the data model using the Data Wizard,
and then update the layout using the Web Source view. Unrelated groups of records are
processed in the order in which they appear in the Web Source.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-30 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-31 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Equijoin
DEPARTMENTS
Department_Id Department_Name
90 Executive
EMPLOYEES
a ble
100 Finance f e r
Last_Name Department_Id ans
n - t r
DeHaan 90 a no
h a s
Department_Id = m ) eฺ
Greenberg
l ฺ c o u100
id
Department_Id a i G
g m ent
3 1 @ Faviet t u d 100
v n it is S
r n a e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Using Data
U Links
K
IATdata link defines a relationship between a group and a query, or between two data
V N
NA sources in the data model. In Oracle Reports, you can combine data from one or more data
sources in the same report.
For SQL-based data sources, the data link defines a parent/child relationship by way of a
primary key and foreign key or a common data value . The parent/child relationship causes
the child query to be executed for each instance (record) of the parent group, retrieving
only rows that match the conditions specified in the link.
For non SQL-based data sources, a data link defines a relationship between two data
sources that share a common data element.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-32 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Compound join:
– Multicolumn primary or foreign key
– Define multiple equijoins
• Nonequijoin:
– Primary key value between two other values le
r a b
– Create two links:
s f e
- t r an
o n
an
employees.salary >= job_grades.lowest_sal
s
) ha
employees.salary <= job_grades.highest_sal
m ideฺ
c o
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
Using Data M en
ALinkslic(continued)
K U
T
NIAunderlying
data link often corresponds to a primary/foreign key relationship between the
V database tables. The common SQL term for this is a join.
NA
Create a single link to define an equijoin. An equijoin is a join condition where one value
is equal to another.
...WHERE departments.department_id =
employees.department_id
You can define multiple equijoins between the same group and query to implement a
compound primary/foreign key relationship—that is, a key that consists of more than one
column.
Create two links to define a nonequijoin. A nonequijoin is a condition where one value
falls between a range of two other values.
...WHERE employees.salary BETWEEN job_grades.lowest_sal
AND job_grades.highest_sal
In this example, you define links for two separate expressions:
employees.salary >= job_grades.lowest_sal
employees.salary <= job_grades.highest_sal
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-33 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
CreatingU M l ic
a Column-to-Column Link
K
T you have learned, Oracle Reports permits multiple queries in a single report and each
IAs
V N
NA query can be based on a different data source. You can create a data link to merge
compatible data between any of the data sources. The links do not have to be between data
sources of the same type, but the data elements that define the link must be of the same
datatype.
To create a column-to-column link:
1. In the Data Model editor, select the Link tool.
2. For SQL-based data sources, click the parent/primary key column of the parent
group and drag a link to the child/foreign key column of the child query.
Note: Always create a link from the parent query to the child query.
For non SQL-based data sources, click the column in one data source and drag a link
to the same column in the other data source.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-34 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-35 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-36 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-37 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Outer joins
• Data ratio
• Multitier environment
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Efficiency
U MIssues:licMultiple- or Single-Query Hierarchy
I T K
You can create the department/employee group hierarchy with two queries instead of one.
VN
NA If you link these two queries, the data structure is the same as the single-query example;
that is, a two-level, master-detail hierarchy.
Because you can build a similar report structure using a single-query or a multiple-query
data model, your choice depends partly on your report requirements—that is, whether you
require an outer join report, and on the ratio of master to detail records in your data tables.
Outer Joins
Consider whether you want to display all master records, regardless of any existing details
(outer join), or only those master records that have related details.
You can add the outer join notation (+) to a single query, but if you require many or
complex outer joins, consider using multiple queries that fetch all records in the master
query even if there are no records in the detail query.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-38 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-39 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Practice 9 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-41 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-42 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-43 and/or its affiliates.
2010, Oracle
SQL Star International Limited
b. In the Data Model, create a REF Cursor Query. The function opens the cursor
for the following SELECT statement:
SELECT last_name, first_name, salary
FROM employees
Note: The code is provided for you in the p9q5b.txt file.
c. Open the Report Wizard to create the layout for the tabular report. Select all the
fields and choose a template. Click Finish to run the paper layout.
d. Save the report as p9q5.jsp and close it.
If you still have any objects open in the Object Navigator, close them all.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 9-44 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
1 le
r a b
s f e
- t r an
o n
2
s an
) ha
3 c o m ideฺ
m ailฺ t Gu
4 @ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U source columns
1 KData
N2I T Summary column
V
NA 3 Formula column
4 Placeholder column
5 Summary column at report level
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Read-only
properties
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Maintaining
U c
M DataliSource Columns
T K
IBecause
N Reports Builder creates data source columns from the contents of the query
V
NA statement, there are some restrictions on how you can modify these columns.
To display a column’s Property Inspector, as for other report objects, you can use one of
several methods:
• Double-click the Column icon in the Object Navigator.
• Double-click the column in the Data Model.
• Select the column and use the right-mouse-button menu.
• Select the column and use the Tools menu.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Producing
U ic
MFile Content
l Output
K
T can include in your report the contents of a file for which the filename varies for each
IYou
V N
NA record retrieved. The file can contain an image—for example, the picture of each
employee or of each product, as shown above.
A file column is a data source column that contains the name of an operating system file
or a URL. The file can be text, image, or multimedia.
The Read from File property does not exist in the Property Inspector unless the column is
of the Database - Scalar type and has a data type of Character.
Reports Builder provides a list of values for the file type: Text, Image, CGM, and Image
URL.
Note: Text is the only valid format in character mode reports. Video and sound formats
are no longer supported in Oracle Reports. Refer to the Oracle Reports Statement of
Direction on the Oracle Technology Network (http://otn.oracle.com) for more
information.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Creating a Column
Summary column
• What type of value?
Choose the correct column Formula column
tool
Placeholder column
a ble
f e r
ans
• What frequency? C_xxx n - t r
C_xxx
a no
Create in a group or s
h
) eฺ a
at report level o m
a i lฺc Guid
m ent
C_xxx
g
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
CreatingU M
a Column l ic
I T K
There are two important questions to ask yourself before you create a column:
VN
NA • 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.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Specific properties:
– Function
– Source
– Reset At
– Compute At le
r a b
• Data type depends on Source data type s f e
• Page summaries: Not supported in the wizard - t r an
o n
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
CreatingU Summary Columns
K
IATsummary column performs a computation on another column’s data.
V N
NA The following properties apply specifically to summary columns:
• Function: The calculation to be performed on the values of the column specified in
Source.
• Source: The name of the column whose values are to be summarized. Source is a list
of values containing those columns that are valid for the specified Function.
• Reset At: Τhe group at which the summary column value resets to zero.
• Compute At: The group for which a % of Total summary column is computed.
Compute At is used only for columns with a function of % of Total.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Displaying Subtotals
Reset At:
G_DEPARTMENT Report
a ble
f e r
1
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
2 @ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U
1 KDepartment totals
N2I T Report total
V
NA
Displaying Subtotals
The control break report output shows two summary columns created by the Report
Wizard. One summary shows the total salary for each department, and the other shows the
total salary for the whole report.
The wizard creates these summaries at one or more levels above the salary source column.
The Reset At property defines the group at which a summary resets to zero to enable you
to calculate a number of subtotals.
The wizard chooses a default reset value for these summaries.
• The department total in G_DEPARTMENT is reset at G_DEPARTMENT—that is,
values start from zero for each new department record.
• The report total at report level is reset at Report.
To create an accumulating total for the department total, change the Reset At property to
Report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Displaying Percentages
Reset At: G_EMPLOYEE G_EMPLOYEE
Compute At: G_DEPARTMENT Report
a ble
f e r
ans
n - t r
2 o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U
1T KDepartment percent of total
N I
V 2 Employee percent of total
NA
Displaying Percentages
The control break report shows the following two percent of totals created by the Report
Wizard:
• Employee’s salary as an individual percentage of the department total
Notice that this is a column in the G_EMPLOYEE group. This is the only summary
function for which the wizard creates a column in the same group as its source.
• Department total as a percentage of the report total
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Reset At
Data Model
Group REPORT G_DEPARTMENT G_EMPLOYEE
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• An empty container at
design time
CP_xxx • Populated by another
object at run time
– Before Report trigger
– Formula column at report
r a ble
level
n s fe
– Formula column in same
- t r a
group or below non
CF_xxx a
as
placeholder
) h eฺ
m
co uid
i l ฺ
g ma ent G
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
CreatingU M l ic Column
a Placeholder
I T K
A placeholder column is an empty container at design time. The placeholder can hold a
VN
NA value at run time that has been calculated and placed into it by PL/SQL code from another
object.
You can set the value of a placeholder column in the following places:
• A Before Report trigger
• A report-level formula column (if the placeholder column is at report level)
• A formula column in the placeholder group or a group below it
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Populating
U ic
M a Placeholder
l Column
K
T sample report shown is a report of all employees. The aim of the report is to:
IThe
V N
NA • 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
For this report, you need to create the following columns:
• A summary to show the maximum salary for the company
• A placeholder to contain the highest earner’s name at run time
• A formula to:
- Compare each employee salary with the maximum salary
- Populate the placeholder with the employee name if salary equals maximum salary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Populating a Placeholder Column (continued)
To create the columns:
1. Create a summary column CS_MAX_SALARY at report level (outside all groups).
Data type: Number; Width: 10; Function: Maximum; Source: Salary; Reset At:
Report
2. Create a placeholder column CP_MAX_EARNER at report level (outside all
groups). Data type: Character; Width: 80
3. Create a formula column CF_CALC_MAX in the G_EMP group. Data type:
Number; Width: 10 (these are the default values)
4. Open the Program Unit editor from the PL/SQL Formula property in
CF_CALC_MAX. Create a function:
function CF_CALC_MAXFormula return Number is
begin
if :salary = :CS_MAX_SALARY then
r a ble
:CP_MAX_EARNER := (:LAST_NAME||’ in sfe
n
Department ’||:DEPARTMENT_ID||’--’ -tra
||:DEPARTMENT_NAME); a non
a s
end if;
m ) h eฺ
return(0);
i l ฺ co uid
end; a m ent G
g
i t 3 1@ Stud
a v n this
m arn use
( ku se to
A R en
K UM lic
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 10 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Hint: Manually edit the query created by Query Builder to modify the display
of order_date using the TO_CHAR function and specify an alias:
TO_CHAR(order_date, ‘dd-Mon-yyyy’)Order_Date
b. Modify the query to include line_total as a calculation of
unit_price*quantity.
c. Group the data on Order_ID and Order_Date and display all the fields. r a ble
s e
fthe
d. Create the following summaries. Can you use the Report Wizard to create
t r a n
summaries? on -
a n
Column Summary a s
line_total sum m ) h eฺ
i l ฺ co uid
line_total % Total
g ma ent G
e. Specify the following labels
i t 3 1and S tud
@ widths.
a v n this
Column
order_id um
arn Labelu seNo.
Ord.
Width
4
( k t o
A R ense Order Date
order_date 10
li c
M line_item_id No. 2
IT KU product_id Product No. 5
V N
NA unit_price
quantity
Price
Quantity
4
4
line_total Total 4
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 10-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Enhancing Reports
Using the Paper Layout
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Header Compensation
section Report
Page 1 of 1
Main a ble
section f e r
ans
n - t r
a no
h a s
m ) eฺ
o uofidreport
Trailer
sectionma
ilฺc End G
g e n t
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Viewing U M
the Paper l icLayout
I T K
The Report Editor Paper Layout view enables you to define and modify the layout objects
VN
NA for a paper report. Layout objects define the report’s appearance and are displayed in the
Paper Layout view.
The Paper Layout Sections
The Paper Layout editor allows you to modify the report layout in three sections: header,
main, and trailer. Each section has its own body and margin area. Report sectioning
allows you to define multiple layouts for the same data model, producing output in a
number of styles. For example, a single report can include an executive summary in the
header section, and a detailed breakdown in the main section.
When you enter the Paper Layout editor, you see the body region of the main section of
your report. To change the section, choose the Main Section, Header Section, or Trailer
Section tool, or choose View > Layout Section > Header, Main, or Trailer.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Page 1 of 1
Main Body/
a ble
section Margin f e r
ans
n - t r
a no
Trailer h a s Body/
End of report ) ฺ
section
l ฺ c om uide Margin
m ai t G
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Viewing U Section Areas
the
K
T Paper Layout editor allows you to modify the body and margin report areas in one of
IThe
V N
NA three sections at any time. This enables you to separate the formatting of margins from the
body of your report pages in any section. Each physical page consists of a body and
margin area.
• Body: The body area of a section can contain text, graphics, data, computations, and
summaries.
• Margin: The margin area can contain text, graphics, page numbers, page totals, and
grand totals.
When you choose the margin view, the body also remains visible, but read-only, in the
editor. The body appears within a black rectangle that defines the size of margin and
body. You cannot modify objects in the body while working in the margin view.
To adjust the size of the margin, choose the margin view, select the black margin
rectangle, click on a select handle, and drag to resize.
Modify margins in your template definition to apply the same dimensions to many
reports, or to apply the same dimensions to several sections of the same report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Logical Page 1
Panel 1
Physical Page 1
Header Logical Page 1
Panel 2
Physical Page 2
Logical Page 1
Panel 1
Logical Page 1
Panel 2 a ble
f e r
Main Physical Page 3 Physical Page 4
ans
Logical Page 1 Logical Page 1
n - t r
Panel 3
Physical Page 5
Panel 4
Physical Page 6 a no
h a s
Logical Page 1 m ) eฺ
l o
ฺc Guid
Trailer Panel 1
a i
Physical Page 7
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Designing
U MMultipanel
l ic Reports
I T K
Reports Builder enables you to design large, or multipanel, report layouts by maintaining
VN
NA two different definitions of a page.
• A physical page represents the actual paper page size.
• A logical page represents a conceptual page on which you can design the layout of
your report.
Reports Builder enables you to design multipanel reports where the logical design of the
report output is wider than the physical (printer) page. A report might need a layout width
of 16 inches that can be printed on two physical printer pages, each 8 inches wide, and
then placed alongside each other.
The unit of measurement is a property of the report object itself.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
4
5
1
2 a ble
f e r
3 s
- t r an
n
no
s a
) h a 6
om uide ฺ
l ฺ c
m ai t G
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1
K UFrame
N I T
2 Repeating frame
N AV 3 Field
4 Boilerplate
5 Imported boilerplate image
6 Graph
Different Objects in the Paper Layout
The Report Editor Paper Layout view supports a large number of different objects. The
Paper Layout objects and their properties are represented symbolically to distinguish their
types and relationships.
• Frame: This object encloses other layout objects and controls formatting, frequency,
and positioning of several objects simultaneously. Created by default or by the
developer
• Repeating Frame: This object displays rows of data that are retrieved for a group.
Created by default or by the developer
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
F_xxx F_xxx
R_G_xxx
a ble
M_G_xxx
f e r
ans
Body n - t r
a no
h a s
Layers of a tabular report m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
The PaperU MLayoutlicLayers
I T K
All layout objects exist in a hierarchy. Each object is contained inside and on a layer
VN
NA above another object. The hierarchy is very important in the processing of report objects.
If you destroy the correct layering, you receive error or warning messages, and the report
might not run.
The bottom layer of a paper report is effectively the page itself.
Tabular Report
To explain the concept of layers, the exploded diagram shows the objects in a simple
tabular report. From bottom up, the layers are:
• Body
• M_G_xxx: Group frame encloses other objects and controls the format, frequency,
and position of several objects simultaneously
• R_G_xxx: Repeating frame is displayed for each row of data that is retrieved for a
group
• F_xxx: Fields define the appearance of columns; can contain character, number, and
date for each column in the data source
In addition, the tabular style creates a boilerplate text object, B_xxx, for each field label;
these objects occur outside the repeating frame, not once for each record.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Confine Mode
• Flex Mode
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
AvoidingU c
MLayoutliErrors
I T K
To avoid common hierarchy errors in your report layout, always work in the Paper Layout
VN
NA using the Confine and Flex modes.
• Confine Mode
- Work with Confine Mode enabled (on) to avoid accidentally moving one object
outside or below its correct enclosing object.
- Work with Confine Mode disabled (off) when you want to move one object
outside its enclosing object.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Report Processing
BEGIN M_G_master…
REPEAT R_G_master
f_xxx f_xxx
BEGIN M_G_detail
REPEAT R_G_detail
BEGIN R_G_detail
end R_G_detail;
END M_G_detail;
END R_G_master;
END M_G_master;
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Magnify a ble
f e r
ans
n - t r
• Frame Select
a no
h a s
m ) eฺ
• Report Block o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
The PaperU MLayoutlicTools
I T K
In addition to the object tools in the tool palette, the Paper Layout provides some specific
VN
NA tools to help you modify layout objects.
• Pinning a tool: If you want to create several objects of the same type, double-click
the drawing tool. A small red pin appears on the tool icon, and the tool remains active
until you click the tool again or choose a different tool.
• Drawing constrained objects: To create a constrained object, such as a perfect circle
or square, hold down the constrain [Shift] key when drawing the object.
To resize an object to scale, hold down the constrain key when resizing the object.
• Magnifying the layout: Select the magnify tool when you want to focus on one part
of a large report. The Magnify tool centers the layout area on the point that you choose
and enlarges objects to twice their size.
Hold down the constrain key when using the magnify tool to reduce objects by half.
There are also zoom in and zoom out buttons in the toolbar.
• Selecting all objects in a frame: Choose the Frame Select tool and then click a frame
or repeating frame in the layout. This selects the frame and all objects inside it.
• Report Block: The Report Block tool invokes the Report Block Wizard to enable you
to create additional layouts in your report without deleting existing objects, and to let
you mix multiple report styles in the same section of a report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Report Bursting
Trailer Æ HTML
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ReportU M
Bursting l ic
I T K
The capability of producing multiple copies of a given report or portions of it in different
VN
NA output formats is referred to as report bursting.
Oracle Reports enables you to deliver a single report to multiple destinations
simultaneously. Each of the three report sections may have a completely different
structure, page layout, page size, destination, and output format, yet be based on the same
data. At run time, each section may be selectively turned on or off to produce multiple
reports in a single run. You can also specify the desired destination at either the report or
section levels. In this way, a single report execution can produce multiple copies of the
output (or portions thereof) in different physical formats, whether it is to a printer, e-mail,
the file system, or the Web. A remote office, for example, may require nothing but an
executive summary sent by way of e-mail, while the local office may prefer a complete
physical printout, and an overseas office may want nothing but detailed output available
on the Web.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Report Bursting
Dept 10
West East
Dept 20
West East
ble
; f e r a
Dept 30 ans
West East
n - t r
a no
h a s
Dept 40 m ) eฺ
…… ailฺc t Guid o
g m en
Dept 3 @ tud
180
n i t i s S
v h
a rna use t
( kumseCopyright
to © 2004, Oracle. All rights reserved.
A R en
ReportU M
Bursting l ic
(continued)
I T K
With Oracle Reports, you are also able to burst on repeating data within a report. This
VN
NA ensures that each user only receives information that is relevant and appropriate for them.
For example, suppose you have created an employee salary report. The manager of
Department 10 will receive an e-mail with the salary information for employees in
Department 10; the manager of Department 20 will only be e-mailed the salary
information for employees in Department 20, while a summary will be printed out for the
president of the company. More importantly, the report is actually run only once, and the
output is sent to the different sets of users according to the requirements. You only have
the overhead of a single data fetch and format in order to distribute the report. This is
called one-pass reporting and is a key feature in Oracle Reports.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
BurstingU a Repeating Group
on
K
T set up a report to burst on a repeating group:
ITo
V N
NA 1. Open your report in Reports Builder and display the Paper Layout.
2. In the Paper Layout, select the outermost repeating frame. Hint:
- You can locate and select the outermost repeating frame in the Object Navigator.
- The repeating frame will then be selected in the Paper Layout view.
3. Delete the repeating frame in the Paper Layout.
Note: Do not delete the repeating frame in the Object Navigator as you will also
delete all the objects within the frame.
4. In the Object Navigator, select the Main Section node and invoke its Property
Inspector.
5. Set the Repeat On property by selecting the repeating group on which the report will
be burst.
You are now able to distribute the data resulting from each section as an individual report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Bursting
U a Repeating Group (continued)
on
T K
IExample
V N
NA The group left report on the previous page generates salary information for employees for
each department. In order to distribute the salary information to each respective
department manager, you have to set up the report to burst on the department ID group.
1. Display the Paper Layout for the report. Select the outermost repeating frame,
R_G_DEPARTMENT_ID, in the Object Navigator.
2. Delete R_G_DEPARTMENT_ID in the Paper Layout.
3. In the Object Navigator, select the Main Section node and open its Property
Inspector.
4. Locate the Repeat On property, and select G_DEPARTMENT_ID from the drop-
down list.
The report is now set up to burst on each new value of G_DEPARTMENT_ID.
You will learn how to distribute the report shortly.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
CreatingU Additional Layout
an
K
T create a layout for the header and trailer section of your paper report:
ITo
V N
NA 1. In the Report Editor Paper Layout, display the layout view for the section.
Note: To create a layout in the margin area of the section, click on the Edit Margin
button in the horizontal toolbar.
2. Select Tools > Report Wizard.
3. Step through the wizard tab pages to create the default layout.
4. To add an additional layout, use the Report Block tool.
5. Make further manual modifications as required.
6. Set the properties for the section as desired.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Distributing a Report
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M a Report
Distributing
U l ic
I T K
Report distribution enables you to send all or part of a report to numerous destinations,
VN
NA each with different characteristics from a single run of the report. It is often necessary to
distribute a report to different media, such as paper, e-mail, Web formats, and delimited
output (e.g., Excel). Often, you are required to distribute different sections of a single
report in different formats to different groups of people.
You can create distribution lists for an entire report and for individual sections of the
report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Distributing a Report
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M
Distributing
Aa Report
l i c en(continued)
K U
T
ITo distribute a report:
VN 1. Define the distribution
NA Use the Distribution property for each section to invoke the Distribution dialog box
and set up the distribution list for that section.
or
On the command line, use the Destination keyword to specify the name of an XML
file that defines the distribution for the current run of the report.
2. Activate the distribution
From the menu, select File > Distribute, or on the command line, specify
Distribute=YES.
Technical Note
For more information on the Distribution XML file, refer to the chapter Creating
Advanced Distributions in the Oracle Application Server Reports Services Publishing
Reports to the Web manual.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Tracing U M Report
the l ic Distribution
I T K
You can check a report’s distribution without actually distributing the report through the
VN
NA Reports Builder Trace facility. The trace file will state which distribution lists were used
and which section was sent to which destination.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-29 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Creating U MVariablel icLength Lines
I T K
The line drawing tool enables you to draw straight vertical lines between columns of a
VN
NA report. However, these lines are a fixed length, whereas the data in your report might be
variable. Reports Builder enables you to specify that a line varies in length or width to fill
a chosen frame.
Separating Vertical Columns in a Tabular Report
In the report above, the translated description has a variable number of characters;
sometimes the characters require a single line field, sometimes more. The field expands
vertically if necessary at run time. The repeating frame also expands to contain the field.
If you draw a vertical line inside the repeating frame, the line is not long enough to span
the extra line of characters at run time.
• To make the line stretch to fit the repeating frame, open the Property Inspector for the
line object. Select Line Stretch with Frame and select the repeating frame you require,
such as the repeating frame, R_xxx.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-30 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-31 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-32 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 11 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-33 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-34 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 11-35 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Comparing Properties
Intersection Pin
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Comparing
U Properties
K
T compare the properties of two objects:
ITo
V N
NA 1. Select one or multiple objects and open the Property Inspector.
Note: Selecting multiple objects results in an intersection of properties.
2. Select the Pin tool to “freeze” the Property Inspector.
3. Select the second object and open the Property Inspector.
4. Reposition the Property Inspectors to view them side by side.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Sizing Objects
Layout icons
Elasticity Vertical Horizontal
fixed
expand ble
f e r a
ans
n - t r
contract a no
h a s
m ) eฺ
o
variable a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Sizing U M
Objects l ic
I T K
You can create objects of any size in the Paper Layout. The elasticity properties enable
VN
NA you to specify whether the object can change size at run time.
The four types of object elasticity and the output object size are:
• Fixed: identical to the layout object size
• Expand: can be larger than the layout object, but not smaller
• Contract: can be smaller than the layout object, but not larger
• Variable: can be larger or smaller than the layout object
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Anchors
a ble
f e r
ans
• Explicit anchors override implicit anchors n - t r
no
• All anchors appear in Object Navigator s a
) ha
c o m ideฺ
ailฺ t Gu
Implicit (shaded)
m
g (solid)
Explicit e n
@ d
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
AnchorsU
T K
IAnchors are used to determine the vertical and horizontal positioning of a child object
VN
NA relative to its parent. An anchor defines the relative position of a child object to the parent
object to which it is anchored. An object is called an internal child object when it is
enclosed by the parent object. An external child object is not enclosed by its parent object.
The absolute position of each layout object is, by default, related to the position of its
enclosing object at run time, unless one of the following is true:
• Reports Builder determines that the position causes a conflict with other objects, so
Reports Builder creates an implicit anchor.
• You decide to override the default position of an object, so you create an explicit
anchor.
Reports Builder creates an implicit anchor for any object that it considers to be in the push
path of another object. For example:
• An object occurring below a vertical repeating frame
• An object occurring to the right of a horizontal repeating frame
• An object occurring below an object that has a variable or expandable vertical size
• An object occurring to the right of an object that has a variable or expandable
horizontal size
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Anchors (continued)
The chart below compares implicit and explicit anchors.
Implicit Explicit
Not visible in the Paper Layout Visible in the Paper Layout
Created and maintained automatically by Created by the developer using the
Reports Builder anchor tool in the tool palette
Visible in the Object Navigator if Anchoring Information is enabled (Navigator
option)
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
1
a ble
2 f e r
ans
n - t r
o
3 s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1T K
UNo relationship, no anchor
N I
V 2 Explicit anchor to enforce relationship
NA 3 Implicit anchor because object is in the push path of a frame
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
4
1
2
3
a ble
6 f e r
ans
n - t r
5 o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
n
MA Relationships
LayoutUObject l ice (continued)
IT K
V N Layout Object Relationship
NA 1 Field Repeating frame, enclosing object
2 Repeating frame Group frame, enclosing object
3 Object 1 Repeating frame, implicit anchor
4 Object 2 Group frame, enclosing object
5 Object 3 Group frame, implicit anchor
6 Group frame
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Pagination
U c the Paper Layout
M Iconsliin
I T K
The four common properties that affect whether and where additional page breaks occur
VN
NA in your paper report are Page Break Before, Page Break After, Page Protect, and Keep
with Anchoring Object (Advanced Layout).
• Page Break Before: Force the object to be formatted on the next logical page after
the one on which it would initially print. All external child objects also print on the
new page. Unrelated objects may print on the original page.
• Page Break After: Force all external child objects to print on the next logical page.
That is, every child object that is attached by an anchor (explicit or implicit) reacts as
if it has Page Break Before set on itself.
• Page Protect: Cause the entire object and its enclosed objects to be kept together on
the same logical page. This is a useful way of keeping the entire contents of a frame or
repeating frame on the same logical page, without using anchors.
• Keep with Anchoring Object: Cause the current object and the object to which it is
anchored to be kept together on the same logical page.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
-1-
1
-2-
xxx
xxx
a ble
f e r
-1-
ans
xxx -
-2-
n t r
o
2 xxx
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1 K UImage is not related to repeating frame
I
N2 T Image is in the push path of and implicitly related to the
V
NA repeating frame
Using Page Break Before
Page Break Before delays the formatting of the current object and its anchored child
objects until the next page. Objects that are not implicitly or explicitly anchored to the
current object do not move to the next page, even if they appear below the current object
in the layout.
Note: Remember to use the Navigator options to view implicit and explicit anchor
information in the Object Navigator. This helps you to understand the relationship
between layout objects, and which objects are affected by setting a page break.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
-1-
xxx
1 xxx
a ble
f e r
-1-
ans
xxx n - t
-2- r
o
2 xxx
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1K U Image and rectangle are not related to repeating frame; Page
N I T Break After has no effect
V
NA 2 Image and rectangle are in the push path of and are implicitly
related to the repeating frame
Using Page Break After
Page Break After delays only the formatting of those objects that are anchored either
implicitly or explicitly to the current object.
Use Page Break After when you want to move multiple related objects to a new page.
This is quicker and easier to maintain than setting Page Break Before on each of the
individual child objects.
To see a warning message when Page Break After has no effect, in the Preferences dialog,
go to Runtime Settings and make sure that Run Debug is enabled
Note: Remember to use the Object Navigator to view implicit and explicit anchor
information.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
-1-
40
xxxxxxxx
f_dept_id
xxxxxxxx
Employee
-2-
f_ename
41 bl e
fe r a
xxxxxxxx
n s
xxxxxxxx -tra
on
xxxxxxxx
n
sa
axxxxxxxx
m ) h eฺ
i l ฺ co uid
g ma ent G
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using Page
U M Protect l ic
I T K
Page Protect indicates whether to keep the entire object and its internal child (enclosed)
VN
NA objects on the same logical page.
Page Protect applies only to the first logical page on which the object normally formats;
Reports Builder ignores Page Protect on subsequent pages to avoid an infinite loop.
Example: A particular instance of a master repeating frame might contain so many detail
records at run time that it is not possible to display them all on the same page. If so, you
can force a page break before the master instance begins.
• To start the master on a new page, set Page Protect to Yes on the master repeating
frame.
• If there is no suitable frame to protect several objects, create your own frame, enclose
the objects in the frame, and set Page Protect on the frame.
Hint: If you create your own frame to protect several objects, give the frame a solid fill so
that you can ensure that you place it at the correct layer of the layout. The frame must be
behind all the objects it encloses.
Remember to remove the fill when you are satisfied with the layout.
Ensure that the frame’s elasticity properties are set to Variable, Expand, or Contract,
depending on the sizing of the objects it encloses.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
-1-
Your Company Your Company
-2-
Your Company
-3-
Your Company
a ble
f e r
an s
n - t r
Print Object On = All Pages a no
has
m)
Base Printing On = Enclosing Object
c o i d e ฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Controlling
U Print Frequency
K
T related properties, Print Object On and Base Printing On, control how often to print
ITwo
V N
NA the object in relation to another object.
Which Page?
Print Object On determines on which of the parent’s logical pages the object is printed.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyrightus© e2004, Oracle. All rights reserved.
( ku se to
A R en
M Triggers
Using Format
U l ic
I T K
A format trigger is a user-written PL/SQL function that executes each time before the
VN
NA object containing the trigger is formatted.
All the main layout objects, frames, repeating frames, fields and boilerplate objects, can
contain a format trigger.
You can use a format trigger to dynamically change the formatting attributes of an object.
The PL/SQL function must return a Boolean value (TRUE or FALSE). This dictates
whether the current instance of the object is included or excluded from the report output.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Hyperlink
• Hyperlink
Destination
a b le
• Bookmark fe r
a n s
• Application
- t r
n on Line
Command
a s
h
) eฺ a
o m
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Properties
LayoutUObject l ic for Web Support
K
T paper layout objects support Web features. Use the following Web Settings properties:
IAll
V N
NA • Hyperlink: This is a URL link specification that displays a document or destination
within a document. The document or document destination can be local or remote,
dynamic or static.
• Hyperlink Destination: A unique dynamic or static object identifier that can be used
as a Web link destination.
• Bookmark: A Web link that will serve as a bookmark in a bookmark frame.
Bookmarks facilitate navigation within a report. When you click a bookmark, it
displays the associated object at the top of the window.
• Application Command Line: This adds a link to an object executing the specified
command when you click the link.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Layout Object Properties for Web Support (continued)
Examples
• Dynamic Hyperlink
‘Dept Details’ || to_char(:deptno)
• Dynamic Bookmark
‘Company Car Policy, Category ’ || :level
• Application Command Line
C:\orawin10g\bin\rwrun.exe report=payload_det.rdf
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 12 Overview
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
PracticeU Session Overview: Lesson 12
K
T practice session contains:
IThis
V N
NA • Creating a break report with continuation pages displaying limited information
• Modifying properties for object Web support
Sometimes detail records get separated from their master header. You ensure that this
does not happen.
All paper layout objects support Web features. You will create a report that takes you to a
PDF document with a simple click using a hyperlink.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 12-29 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
an s
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Modifying
U MProperties
l ic of a Repeating Frame
I T K
A repeating frame is record-related, and its properties allow you to modify specific
VN
NA attributes associated to the display of the records.
• Source: 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
• Print Direction: Direction in which records are printed: Down or Across,
Across/Down, or Down/Across
• Maximum Records per Page: Maximum number of records that can be displayed on
a single page
• Minimum Widow Records: Minimum number of records from a group that can be
displayed at the bottom of a page
• Column Mode: Whether to maintain the column for each record across multiple
pages
• Horiz. Space Between Frames, Vert. Space Between Frames: Spacing between
each record, horizontally and vertically
The most commonly used properties are discussed in more detail on the following pages.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
3
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Specifying
U ic
M Print lDirection
I T K
Print direction specifies the direction in which to print the repeating frame’s records, and
VN
NA may be any one of these values:
• Down: Prints sequential records down the page. At the end of the page, records
overflow onto the next page.
• Down/Across: Prints sequential records down the page. At the end of the page,
records move across to form a new column if there is room; otherwise they overflow
onto a new page.
• Across: Prints sequential records across the page. When records reach the right edge
of the page, they overflow onto a new page.
• Across/Down: Prints sequential records across the page. When records reach the right
edge of the page, they move down below the previous set of records if there is room;
otherwise they overflow onto a new page.
When you alter the print direction of a repeating frame, you must consider the properties
of any enclosing objects. Enclosing objects may include other repeating frames and group
frames.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
-2-
-3- -2-
a ble
f e r
an s
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyrightus© e2004, Oracle. All rights reserved.
( ku se to
A R en
Controlling
U ic
M the Number
l of Records per Page
K
T can specify the maximum number of records that you want to display on each logical
IYou
V N
NA page.
In the repeating frame Property Inspector, choose the Maximum Records per Page
property. The value you enter for this property can be any positive whole number or
blank.
If this setting is 0 (zero), Reports Builder formats as many records as possible on the
logical page.
Examples:
Recall the Form and Form Letter report styles. Reports Builder automatically sets
Maximum Records per Page to 1. If you require more than one record on each page, you
can modify this property.
In the Group Above report style, Reports Builder formats as many records as possible on a
page. (Maximum Records per Page is null.) Modify this property for the master repeating
frame to display one master record per page.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
1
2
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Spacing
Controlling
U l ic Between Records
I T
The
Kproperties Horiz. Space Between Frames and Vert. Space Between Frames control the
VN amount of space between occurrences of a repeating frame; that is, record spacing.
NA Horizontal Space Between Frames: Define the amount of space you want between
records horizontally across the page by entering zero or any positive number for this
setting.
This setting has no effect if the repeating frame has a print direction of Down.
Vertical Space Between Frames: Define the distance you want between records
vertically down the page by entering zero or any positive number for this setting.
This setting has no effect if the repeating frame has a print direction of Across.
Note: In bitmapped reports, the distance is a whole or part of the unit of measurement, for
example,.25 (of an inch).
In character mode reports, the distance is the number of blank characters (horizontal) or
lines (vertical). Therefore, you must enter a whole number, for example, 10 (characters).
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Page 1 Page 1
a ble
f e r
Page 2 Page 2
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Minimum U c
MWidowliRecords
I T K
You can specify the minimum number of records that must display on a page. The default
VN
NA is zero, which means a single record may display alone on a page.
Example
In the diagram above, there are two separate repeating frames printing down the page. The
second repeating frame is near the end of the page, and there is only room for one record.
If you want to force at least three records on a page, enter 3 in the Minimum Widow
Records property so that the repeating frame starts to format on the next page.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Column Mode
Page 1 Page 1
10 20 10 20 30
a ble
f e r
Page 2 Page 2
ans
n - t r
20 30 20 a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Column U M
Mode l ic
I T
You
Kcan set Column Mode to Yes to allow the next instance of a repeating frame to begin
VN formatting before the previous instance completes. Column Mode is used mainly for
NA master repeating frames or repeating frames that contain fields that may expand vertically
or horizontally (for example, elasticity is Variable or Expand).
Example
The example above shows the use of Column Mode for the department master repeating
frame given three records, 10, 20, and 30. The department repeating frame’s print
direction is Across, and the employee repeating frame’s print direction is Down.
Use Column Mode to start formatting department 30 on page 1, and also to align the
overflow for department 20 on page 2.
Note: Column Mode does not make sense for repeating frames that have a print direction
of Across/Down or Down/Across.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Properties of a Field
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
System Variables
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
n
MA licase the Source of a Field
SystemUVariables
I T K
The following table lists the variables and describes their display values.
VN
NA Variable Name Description
Current Date The operating system date on the mid-tier when the report
runs, after the Runtime Parameter Form has been displayed
Page Number The current page number based upon numbering the output
by logical pages
Panel Number The current panel number in the current logical page
Physical Page Number The current page number based upon numbering the output
by physical pages
Total Pages The total number of logical pages in the current report run
Total Panels The total number of panels in a logical page
Total Physical Pages The total number of pages based upon numbering the output
by physical pages
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Page Numbering
Page 4 of 4
Example 1
Page 3 of 4
End
Page 2 of 4
Page 1 of 4
Example 2
Report
Title
a ble
Page 1 of 1
End f e r
Page 2 of 2 ans
n - t r
Page 1 of 2
a no
Report h a s
Title m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M
Page Numbering
U l ic
I T K
When the source of a field is one of the system variables for page or panel numbers, you
VN
NA 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:
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
G_Region
R_Region
F_1 R_Dept
G_Dept R_Emp
a ble
f e r
ans
n - t r
a no
G_Emp h a s
F_REPORT
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Columns
Valid Source
U l ic
I T K
When creating new fields, make sure that they exist at the correct level within the report;
VN
NA otherwise frequency errors occur.
If you create a field in a repeating frame, the column you choose as the source must be in
the relevant group for the repeating frame or in an ancestor of that group.
In the diagram above, the Data Model shows a three-level hierarchy:
• G_Region is the parent of G_Dept.
• G_Dept is the parent G_Emp.
The layout shows the three nested repeating frames, R_Region, R_Dept, and R_Emp.
If you create another field in the R_Dept repeating frame, the source column must come
from either G_Dept or G_Region; a column in G_Emp would be an invalid source,
because values in the G_Emp group occur more often than R_Dept would be printed.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Displaying
U l ic
M File Contents
I T K
There is a special type of boilerplate object, called a file link, that does not have to remain
VN
NA constant for each report run.
A file link allows you to create an external boilerplate object that displays the contents of
a file.
File Link Properties
The specific properties for this type of object are:
Page Numbering Property Value
Include Main Section
Start At 1
Increment By 1
Reset At R_Dept
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
1 2
Import
Link
a ble
f e r
3 4 ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Linking U M Importing
and l ic File Contents
I T K
If the contents of a file might change, and especially if you want to use the same contents
VN
NA in many reports, use a file link so that the contents are included dynamically at run time.
If the file contents are not likely to change often, you can import the contents.
Note: An imported image is stored in the report definition file, and therefore increases the
size of the file. However, the report runs faster if the image is imported rather than linked
to a file.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Q_EMP
G_EMP
a ble
PICTURE F_PICTURE
f e r
ans
1
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid 2
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
1 K U M lic
The layout field F_Picture depends on its source column PICTURE in the Data
N I T Model. The filename, and therefore the picture, can be different for each record.
V
NA 2 File Link exists as a layout object only. The same picture repeats for each record.
Comparing a File Link and a File Column
The main difference in creating a file link and a file column is that you create a file link in
the Paper Layout, whereas you create a file column in the Data Model.
The differences between a link file and a file column are:
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Specifying
U M the Format
l ic Order
I T K
Earlier in the course, you learned that every report has three sections, Header, Main, and
VN
NA Trailer. By default, Oracle Reports formats the three sections of a report sequentially:
Header section, followed by Main section, followed by Trailer section.
Using the Format Order of Sections, a report property, you can specify the order in which
the three sections of a report are formatted. The drop-down list contains all possible
combinations of format order.
Reports Builder can format any section first to create information that is only known at
the time of formatting, such as page numbers, then use that information in the formatting
of a previous section.
For example, when you have large paper report, it is sometimes easier for your users to
navigate through the report if you include a table of contents. Using Reports Builder, you
can generate a table of contents (TOC) that displays at the beginning of your paper report.
You can set the Format Order of Sections property to Main-Header-Trailer to
format the Main section of the report first, then the Header and Trailer sections. This
enables you to generate the page numbers for the report in the Main section, then display
the page numbers in the table of contents in the Header section.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
PDF Document
U ic
M Taxonomy
l Properties
K
T documents store properties that track general information about the document, such
IPDF
V N
NA as the document’s title, author, and creation and modification dates. This information, or
metadata, is intended to assist in cataloguing and searching a PDF document.
Recall that Oracle Reports supports PDF output. Oracle Reports provides report-level
properties that enable you to specify metadata about your PDF report. The values that you
specify for these properties are inserted into the PDF output file.
The properties are known as PDF Document Taxonomy properties. They define the
classification, or taxonomy, for the document. The properties are:
• Title: specifies a title for the report, which you can use to identify the contents of a
document
• Author: specifies an author for the report, which may be an individual, company, or
department name
• Subject: specifies a subject for the report
• Keywords: specifies one or more keywords for the report that can be used to
categorize the document
Note: These properties are only valid for PDF output.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 13 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 13-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Web Reporting
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M WeblicPublishing
High Quality
U
I T K
HTML is the de facto standard for publishing information on the Web. The organization
VN
NA of content for the Web must be more visually appealing than paper, and often includes
animated GIF images, JavaScript code, and Java applets. We are concerned with
publishing information from corporate data sources and the tool we use must be capable
of combining static as well as dynamic information in a single page.
A number of Web authoring tools exist today for designing and developing high quality
Web pages. These products address static publishing, and in order to include dynamic
content, you often must resort to programming. Web designers and developers are
challenged to define and generate complex, dynamic content for an enterprise information
portal or corporate Web page.
Oracle Reports is a powerful enterprise reporting tool for building and publishing high
quality, dynamically generated Web reports. Through data-driven tables of contents,
hyperlinks, and drill-down chart hyperlinks, Oracle Reports provides users with an easy
path to the information they require.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Comparing
U M Staticlicand Dynamic Reporting
I T K
The two categories of Web reports are static reports and dynamic reports.
VN
NA Static Reports
The word static describes something that is fixed and unchanging. A static report is one
that displays the same data each time the report is invoked. The data is fetched once and
displayed on a Web page. Consider a paper report that has been pushed to the Web. If you
do not execute the paper report (RDF) again, and generate the Web output (HTML or
PDF) using the Web Wizard or File > Generate to File, the output remains the same, that
is, it is static.
Static reporting is sufficient for certain types of applications. A report that displays data
that does not change, such as historical data, does not require frequent refreshing.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
</body> f e r
ans
n - t r
Data Model JavaServer
o
n (JSP)
Web Source a Page s
h
) eฺ a
o m
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M
AddingUDynamic l c
iContent to a Web Page
K
IInT a previous lesson, you created Web reports using one of the HTML templates supplied
V N
NA by Oracle Reports and the Report Wizard. As an alternative, you can open an existing
Web page (an HTML document) in Reports Builder and embed your report data into the
page. Your HTML document can be a corporate standard or you can design your own
Web page using your favorite HTML authoring tool.
In this section, you learn how to add dynamic content to an existing Web page.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
CreatingU Ma Reportl icBlock
I T K
Now that you have defined the data for your report, you are ready to create a report block
VN
NA and add it to your Web page. The report block automatically inserts the data model,
business logic, and Web layout for the report. Each time the report is run, the report block
will dynamically pull the data defined by the data model into your Web page.
In order to insert a report block into your Web page, open the Web Source view for your
report. The report block must go between the <body> and </body> tags. These tags are
standard HTML code and delimit the start and end of the body of the Web page,
respectively.
Organizations often have a team of Web designers to create visually appealing and
effective Web pages for publishing. The designers can manually code the HTML or use
any HTML authoring tool. Web designers will typically include a placeholder in the
HTML code to indicate where you, as the reports developer, must add the report data.
This is the location in the code where you position your cursor to insert the report block.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
an s
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
InvokingU Report Block Wizard
the
K
T invoke the Report Block Wizard:
ITo
V N
NA 1.
2.
Position your cursor in the desired location in the Web source code.
Select Insert > Report Block from the menu.
3. Specify a title for your report and select a report style.
4. Select the group or groups as desired.
5. Select the fields you want to display in your report.
6. Modify the labels as necessary.
7. Select a template and click Finish.
Note: The template affects the report block only and will not alter the existing Web
page.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
<rw:report id="report">
<rw:objects id="objects">
Data Model & Business Logic (XML)
<layout> a ble
Paper Layout (XML) f e r
ans
</layout>
n - t r
</rw:objects>
a no
<HTML> h a s
m ) eฺ
Web Layout (JSP) o
Graph (XML) a ilฺc Guid
g m ent
</HTML>
</rw:report> i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Examining
U M the Webl ic Source Code
I T K
Now you will examine the code created for the report block, and learn more about the
VN
NA Reports custom JSP tags as well as some HTML tags.
The Structure of a Reports JSP
Earlier in the course, you were introduced to the structure of a Reports JSP.
The first line of the JSP is a directive that identifies the Reports custom tag library. The
page directive on the second line of code identifies the scriptlet language, the Java classes
to import, and the JSP to display any unhandled errors.
The entire report resides within the body of the rw:report tag.
The Data Model and business logic reside within the rw:objects tag and are coded in
XML. If your report definition also contains a Paper Layout, it is located within the
rw:objects tag as well. Remember that the details of the Data Model and Paper
Layout are hidden when you are viewing the Web Source in Reports Builder. Use a text
editor to view the complete code.
The Web Layout for your report is located within the HTML tag, which is the focus of
this section.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Examining
U the Web Source Code (continued)
K
T Header Tag
IThe
V N
NA The header tag is an HTML tag that contains a comment to help you locate the heading
information for your report: <!-- Header -->. Just below the header tag, you will
find <th> and <tr> tags. The code within these tags defines the column headers for
your report. For example:
<tr>
<th <rw:id id="HBEMPLOYEEID" asArray="no"/>
class="OraColumnHeader"> Employee ID</th>
This code identifies the column heading Employee ID. Note the <rw:id> tag. The
rw:id tag generates a unique Document Object Model (DOM), or HTML ID value for
row and column headers to produce HTML that provides access using assistive
technology, such as screen readers.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
rw:foreach Tag
a b le
...
e r
<rw:foreach id="R_G_EMPLOYEE_ID_1" src="G_EMPLOYEE_ID">
a n sf
<tr> n - tr
<td <rw:headers id="HFEMPLOYEEID" a no
src="HBEMPLOYEEID"/>. . . h a s
<td <rw:headers id="HFEmployee" m ) eฺ
o
src="HBEmployee"/> . . .
a ilฺc Guid
... gm
@ tude nt
3 1
it is S
v n
a e th
r n
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M
The rw:foreach
en
A licTag
K U
T
IThe rw:foreach tag loops through the specified data source group. The tag creates a
VN
NA cursor for the data source group and moves the cursor to the next instance for each
iteration. Consider this example:
<rw:foreach id="R_G_EMPLOYEE_ID_1" src="G_EMPLOYEE_ID">
R_G_EMPLOYEE_ID_1 is a unique identifier for the loop. G_EMPLOYEE_ID identifies
the group in the data model for which the loop repeats.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
rw:field Tag
a ble
f e r
... ans
n - t r
<td <rw:headers id="HFEMPLOYEEID"
a no
as
src="HBEMPLOYEEID"/> class="OraCellNumber">
)h
c o m ideฺ
<rw:field id="F_EMPLOYEE_ID" src="EMPLOYEE_ID"
ailฺ Gu</rw:field></td>
nullValue=" "> F_EMPLOYEE_ID
m ent
g
...
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Tag
The rw:field
U l ic
I T
The
Krw:field tag returns a value from a column, system parameter, or user parameter,
VN
NA and outputs the value in HTML. For example:
<rw:field id="F_EMPLOYEE_ID" src="EMPLOYEE_ID"
nullValue=" ";> F_EMPLOYEE_ID </rw:field>
F_EMPLOYEE_ID is a unique identifier for this field. This tag returns a value from the
EMPLOYEE_ID column in the data model, as identified by the source (src) attribute. If
the tag returns null, a space will result in the output, as specified by the nullValue
attribute. The   value is the code for “non-breaking space.” It is called non-breaking
so that the browser does not ignore the space, which browsers usually do otherwise.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Customizing
U Reports JSPs
K
T can customize your Reports JSPs by:
IYou
V N
NA • Modifying the classes in the style sheet file
• Using standard HTML tags and attributes
• Using Oracle Reports custom tags
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
<rw:style id="rwbeige">
<link rel="StyleSheet" type="text/css" href="rwbeige.css">
</rw:style>
…
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
<thead>
<tr>
<th <rw:id id="HBEMPLOYEEID" asArray="no"/>
class="OraColumnHeader"> Employee Id </th>
…
<th <rw:id id="HBSALARY" asArray="no"/> align="right" r a ble
bgcolor="yellow"> Salary </th> n s fe
</tr> - t r a
</thead> non a
a s
m ) h eฺ
i l ฺ co uid
g ma ent G
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Customizing
U M Reports l ic JSPs Using HTML Tags and Attributes
I T K
If you want to customize particular instances of a class in a report, you can edit the Web
VN
NA source code directly and use standard HTML tags and attributes or Reports custom tags to
obtain the desired results.
If you are familiar with standard HTML tags and attributes, you can edit your Web source
and customize your report this way.
In the slide above, the column headings in the report block use the OraColumnHeader
class. Note the reference for the Employee Id header.
The header for the Salary column is customized. The OraColumnHeader class reference
was deleted from the Web source code, and replaced with standard HTML format
attributes for alignment and background color. In this example, the Salary column header
is aligned right and the header text is displayed with a background color of yellow.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Customizing
U M Reportsl ic JSPs Using Reports Custom Tags (continued)
I T K
The slide above shows the result of using Reports custom tag attributes to modify the
VN
NA appearance of a field in a report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 14 Overview
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
PracticeU Session Overview: Lesson 14
K
T practice session contains:
IThis
V N
NA • Adding dynamic content to an existing Web page to create a Reports JSP
• Customizing a Web report using JSP tag attributes
In this practice, you will create a Web report by adding dynamic report data to an existing
HTML page. You will also customize the Web report by using JSP tag attributes.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 14-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a v n d:\rep10g\custom\emp1.xml)"
t h is
rn use
destype=file adesname=emp.pdf desformat=PDF
m o
(ku se t
server=repsrv1
R
MultipleM files i en in the order listed in the CUSTOMIZE argument. The last
A are lapplied
c
U
N I T K applied overrides any similar modifications made by a prior definition.
definition
N AV
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Run by itself
• Batch updates
a ble
f e r
ans
rwconverter source="(...)"
n - t r
o
dest=... customize=...
s an
batch=yes
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
RunningU XML Report Definitions (continued)
T K
IApplying
N an XML Definition in PL/SQL
V
NA To apply an XML report definition to an .rdf file in PL/SQL, you can use the
SRW.APPLY_DEFINITION and SRW.ADD_DEFINITION built-ins in the BeforeForm
or AfterForm trigger. When you run the report, the trigger executes and the specifed XML
file will be applied.
The following command line applies XML that is stored in the file system to a report:
SRW.APPLY_DEFINITION(‘D:\rep10g\custom\emp.xml’);
To create an XML report definition in memory, you must first add the definition to the
document buffer and then apply it. The following command line illustrates this:
SRW.ADD_DEFINITION(:xmlcol);
SRW.APPLY_DEFINITION;
Running the XML Report Definition by Itself
To run an XML report definition by itself, simply submit a job request with an XML file
specified in the MODULE (or REPORT) argument. Ensure that the file extension is
.xml. Note that you could also apply an XML customization file to this report at the
same time by using the CUSTOMIZE argument.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Running XML Reports Definitions (continued)
Performing Batch Updates
If you have a large number of files that must be updated, you can use the CUSTOMIZE
command line argument with the RWCONVERTER command. Batch modifications are
particularly useful when you must make a repetitive change to a large number of reports
(for example, changing a field's format mask). Rather than opening each report and
manually making the change in Reports Builder, you can run RWCONVERTER once and
make the same change to a large number of reports at the same time.
The following command line applies two XML report definitions to three different reports
and saves the new definitions in the file system:
rwconverter userid=scott/tiger@db1
stype=rdffile
source="(emp1.rdf,emp2.rdf,staff.rdf)" a ble
f e r
dtype=rdffile
a n s
t r
on-
dest="(emp1_new.rdf,emp2_new.rdf,staff_new.rdf)"
customize="(d:\rep10g\custom\labels.xml, s an
) ha
c o m ideฺ
d:\rep10g\custom\format_mask.xml)"
batch=yes
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• XML parser
• Tracing option
• Using Reports Builder
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Debugging
U XML Report Definitions
K
T have options when debugging XML report definitions.
IYou
V N
NA The XML Parser
The XML parser is part of Oracle's XML Development Kit (XDK), which is delivered
with the core Oracle Database release. The XML parser is a Java package that checks the
validity of XML syntax. The JAR files that contain the XML parser are automatically
configured on installation and are available to Oracle Reports.
The XML parser catches most syntax errors and displays error messages. The error
message contains the line number in the XML file where a problem was found, as well as
a brief description of the problem.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Debugging XML Report Definitions (continued)
The Trace Option
For testing purposes, you may want to activate the trace facility when you run your report.
The example below shows a command line that has three trace options.
rwrun scott/tiger@db1 report=D:\rep10g\custom\emp.xml
tracefile=emp.log tracemode=trace_replace
traceopt=trace_app
Using Reports Builder
It is sometimes useful to open an XML report definition in Reports Builder while you are
still working on it. This will allow you to quickly determine if all objects are created as
expected. For example, if you are creating summaries in an XML report definition, then
opening the definition in Reports Builder enables you to quickly determine if the
le
summaries are being placed in the appropriate group in the Data Model.
e rab
Technical Note a n sf
n - tr
For more information on the XML parser, refer to the Oracle Technology
n oNetwork
(http://otn.oracle.com).
ha sa
)
m ideฺ
c o
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 15 Overview
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
PracticeU Session Overview: Lesson 15
K
T practice session contains:
IThis
V N
NA • Running a report using an XML definition
• Applying an XML report definition to an existing .rdf file
Using XML you can build fully functional reports or partial reports that can serve as a
customization file.
You will run an XML file and apply an XML definition to an existing report.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 15- 23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
CreatingU User Parameters (continued)
K
T create a user parameter in the Object Navigator:
ITo
V N
NA 1. In the Object Navigator, click the User Parameter node, and then select the Create
tool.
Note: If this is the first parameter, you can create it by double-clicking the User
Parameter node.
2. Rename the parameter and open the Property Inspector.
3. Verify the data type and width. Enter an initial value if required.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Property Description
Datatype Specify whether parameter value is Character, Number, or
Date; default is Number when created in the Object
Navigator.
Width Specify maximum allowable width of parameter value;
maximum is 64 KB.
Input Mask Allow users to enter a numeric or date value using a specific
format.
Initial Value Specify the value to use. You can override this value at run
time from the command line or parameter form. r a ble
Validation Trigger Validate the parameter value. Enter a PL/SQL function.ans
fe
List of Values n
Create a list of values from which users select a valid
tr
- value
o
at run time. s an
Type of Pluggable Used by the PDS for acquiring single ) a information. It
hsign-on
o m sign-ond e ฺ information
Data Source c
identifies that parameter as lcontaining
i ฺ Gu i
ma
for that PDS connection.
g den t
@
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Referencing Parameters in a
Report Query
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Referencing
U Parameters in a Report Query
K
T are two ways to reference parameters in a query:
IThere
V N
NA • Use a bind reference
• Use a lexical reference
What Is a Bind Reference?
A bind reference is used to replace a single value or expression in SQL or PL/SQL.
To create a bind reference in a query, prefix the parameter name with a colon (:).
If the parameter object does not exist, Reports Builder automatically creates it for you and
displays a message. In this case, the parameter default datatype is CHARACTER, not
NUMBER.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
• Substitute a single value or expression in the select s f e r
statement tran n -
n o
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
s a
FROM CUSTOMERS a
) h eฺ
m
co uid
ORDER BY DECODE( :SORT, l ฺ
, 1, CUST_LAST_NAME,
i
2, g ma ent G
NLS_TERRITORY,
@ tud
t31 ACCOUNT_MGR_ID)
nS i is
a v t h
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using Bind
U M References
l ic
I T K
Use a bind reference anywhere in a query where you can use a single literal value, such as
VN
NA a character string, number, or date.
Examples
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
FROM CUSTOMERS
WHERE CUSTOMER_ID = :P_CUST
This statement enables 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.
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
FROM CUSTOMERS
ORDER BY DECODE(:SORT, 1, CUST_LAST_NAME,
2, NLS_TERRITORY,
ACCOUNT_MGR_ID)
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
f e r
FROM CUSTOMERS
ans
&P_WHERE_ORD_CLAUSE n - t r
a no
SELECT &P_CUSTNAME CUST, &P_ACCTMGR MGRas
FROM &P_TABLE m ) h eฺ
i l ฺ co uid
• Make sure that the number manda data t Gtypes match at
g
@ tude n
run time. 3 1
v n it is S
r n a e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Using Lexical
U References
K
T a lexical reference to replace any clause in a SELECT statement, or even to replace
IUse
V N
NA the entire statement.
Examples
The following statements use lexical references to substitute parts of the query at run
time:
• To specify a WHERE clause, ORDER BY clause, or both at run time (as two
separate parameters):
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
FROM CUSTOMERS
&P_WHERE_CLAUSE
&P_ORD_CLAUSE
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Using Lexical References (continued)
• To specify a WHERE clause, ORDER BY clause, or both at run time (as one
parameter):
SELECT CUST_LAST_NAME, ACCOUNT_MGR_ID
FROM CUSTOMERS
&P_WHERE_ORD_CLAUSE
• To specify two column names and the table names at run time:
SELECT &P_CUSTNAME CUST, &P_ACCTMGR MGR
FROM &P_TABLE
In this example, you must create the parameters first and provide each with an initial
value to ensure that the SELECT statement is syntactically correct when parsed.
Note: When you use lexical references in the SELECT list, you must, at run time, specify
the same number of items of the correct data type, as defined in the Data Model.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
2 3 a ble
f e r
ans
4 n - t r
o
5
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1K
U Choose Static Values.
N I T
V 2 Enter a value and click Add.
NA 3 Repeat for each value to build the list of values.
4 To remove a value; select a value and click Remove.
5 Select OK to accept the list and exit.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
1
3
4
a ble
f e r
2 ans
n - t r
o
5 s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
1 K U Choose SELECT Statement.
V N 2T
I Enter a valid query.
NA 3 Select or clear the Restrict List to Predetermined Values check box.
4 Hide the first column from the list.
5 Click OK to accept the query and exit.
Creating a List of Values (continued)
To create a dynamic list of values:
1. In the Parameter Property Inspector, select the List of Values property.
2. Choose SELECT Statement.
3. The SQL Query Statement field is displayed.
Enter a query to populate the list of values. You can include more than one column.
The parameter takes its value from the first column in the list and the column values
appear concatenated in the list at run time.
4. Set the Restrict List to Predetermined Values property, as required.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
an s
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Referencing
U M System l ic Parameters
I T K
Reports Builder provides system parameters to allow you to modify standard run-time
VN
NA settings for each report definition. Each parameter has a default value that you can
modify.
There are currently seven system parameters. You cannot delete them.
Technical Note
The following system parameters have been deprecated in Oracle Reports:
BACKGROUND, CURRENCY, DECIMAL and THOUSANDS.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Referencing System Parameters (continued)
The system parameters are:
Parameter Use to specify Values Default
COPIES Number of copies that Any integer 1
should be made if the report
is printed
DESFORMAT Either the output format for Examples: PDF, dflt
the report, or the printer HTML, HTMLCSS,
definition to use when RTF, XML
formatting the report when
DESTYPE=FILE and
DESNAME=filename
DESNAME Name of output device, such <reportname>.lis
as filename, printer name,
mail userid r a ble
DESTYPE Type of device that will Cache, localfile, file, Cache ns
fe
receive the report output printer, sysout, mail, - t r a
oracleportal, ftp, n on
webdav, screen, s a
preview ) h
a
o mbitmap, d e ฺ Default
MODE Whether report executes in c
Default,
ilฺ Gu i
bitmapped or character mode m aCharacter
t
ORIENTATION The print direction of@ g Default,
printer d e n portrait, Default
output 3 1
it is S t uLandscape
PRINTJOB Whethern v
print
n
a jobedialogth box Yes, No Yes
a r
is displayed at s
run time, if
um e tooruprinter
(kdestype=file
A R ens
K UM lic
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
+ Report
h a sproperties:
•m
)
Width eฺ
o uid
a ilฺc • Height
G
g m ent
i t 3 1@ Stud • Number of Pages
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
BuildingU M c
a PaperliParameter Form
K
T paper reports that you created in previous lessons ran successfully without a
IThe
V N
NA parameter form. However, when you created parameters, a default run-time parameter
form appeared to enable you to change the values at run time.
You can build your own parameter form, select the parameters that you want to display,
and then customize the appearance of the parameter form in the Report editor.
How to Build a Parameter Form
1. Select menu item Tools > Parameter Form Builder.
2. The Parameter Form Builder dialog box appears.
If desired, modify the title, hint, and status line text. These lines are displayed at the
top of the parameter form at run time.
3. Select or deselect parameters in the parameter section as necessary.
Note: Selected parameters are displayed in the dialog box as highlighted on a black
background. Deselected parameters do not appear in the parameter form.
4. Modify label text of the selected parameters, if you wish.
5. Click OK to create the parameter form.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M a Paper
Customizing
U l ic Parameter Form
I T K
You can customize the parameter form layout in a similar way to customizing the paper
VN
NA report layout. You can modify colors and fill patterns (except in fields), move or delete
existing objects, create additional objects, import file contents such as a company logo,
and so on.
Creating Parameter Fields
A parameter field is a placeholder for a parameter value on the run-time parameter form,
in the same way that a field is a placeholder for a column value in the layout.
You cannot modify the color or fill patterns of a parameter field. However, the Property
Inspector enables you to modify all parameter properties.
Reports Builder creates one field for each parameter that you select in the Parameter Form
Builder. If a parameter in your Data Model does not have an associated field, it does not
appear in the run-time parameter form because it does not have any display attributes.
You can create additional fields by using the field tool in the parameter form toolbar and
sourcing the field to an existing parameter.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
Header n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid Footer
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Parameter
U ic
MForm lHeader and Footer
K
T create an HTML parameter form header:
ITo
V N
NA 1. Open the Property Inspector of the report.
2. Set the Before Form Type property to Text if you will enter the header, or to File if
you will import the header from a file.
3. Set the Before Form Value property by clicking the ... button to either enter the
HTML code or select an HTML file to import.
To create an HTML parameter form footer:
1. Open the Property Inspector of the report.
2. Set the After Form Type property to Text if you will enter the footer, or to File if
you will import the footer from a file.
3. Set the After Form Value property by clicking the ... button to either enter the
HTML code, or select an HTML file to import.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 16 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-29 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 16-30 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
CreatingU M l ic
and Embedding a Graph in a Report
K
T in many Oracle products, Oracle Reports uses the BI Graph Bean for graph
IAs
V N
NA development. The BI Graph Bean offers 52 different types of graphs, including three
dimensional (3D) graphs. There is no separate graphics tool. Reports Builder provides an
easy-to-use Graph Wizard to enable you to easily produce a graph for your paper and Web
reports.
In Reports Builder, you can invoke the Graph Wizard from the Paper Layout view and the
Paper Design view.
From the Paper Layout view:
1. Click the Graph tool in the vertical toolbar.
2. Drag a square in the painter area where you want your graph to appear. The Graph
Wizard displays.
3. Step through the Wizard to create the desired graph and position it in your report.
Note: In the Paper Layout, the graph is represented as a bar graph even if the graph is of
another type.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
A icen
AddingUaM Graph lto a Web Report
K
T add a graph to a Web report:
ITo
V N
NA 1. Open the Web Source view.
2. Position your cursor in the section of the source code where you want to add a
graph.
3. Select Insert > Graph from the menu.
4. Step through the Wizard pages to create the desired graph.
To reenter the Graph Wizard, position your cursor anywhere within the rw:graph tag and
select Edit > Settings.
You will learn more about the rw:graph tag later in this lesson.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Selecting
U Mthe Graph
l ic Type
I T K
Select the type of graph that you require. The Wizard provides a preview of what the
VN
NA graph will look like as well as recommendations for when different types of graphs are
useful and appropriate.
Select the graph subtype that you require, using the subtype pictures as a guide. If desired,
select the 3D effect check box. Click Next to continue.
The next page of the Graph Wizard enables you to position the graph at the beginning or
end of the report output, or to display the graph once for each occurrence of a group.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Selecting
U the Graph Data
K
T the next two wizard pages, you define the data in the graph:
IOn
V N
NA 1. Select the field that you want to appear as the categories of your graph. Category
columns are used for the x-axis.
2. Select the field that you want to appear as the data values of your graph. Data values
columns are used for the y-axis and must be numeric.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M
AddingUOptions l
toicthe Graph
I T K
The remaining pages in the Graph Wizard allow you to add optional characteristics to
VN
NA your graph.
• Use the Layout page to rearrange the data in a graph. The arrangement of data
determines the way a graph is displayed. On the Layout page, you can rearrange place
holders that represent dimensions, such as Product, Time, Geography, and so on.
When these changes are applied, then actual dimension members are displayed in the
positions that you specified.
• Use the Title page to specify text and font attributes for the title, subtitle, and footnote
of a graph.
• Use the Legend page to select options for the legend of a graph. The legend area is a
place on a graph that provides a key to the information that is shown in the graph. It
contains legend markers, each corresponding to a series of data, and legend text,
which describes the data in that series. For example, you might have different cities
represented by data markers of different colors. Markers represent data on a graph. If
red markers in your graph represent New York, then there is a corresponding red
legend marker in the legend area, with legend text reading “New York.”
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
an s
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Graphs
Customizing
U l ic Using the Graph.XML File
I T K
When you use the Graph Wizard to create a graph in the report layout, it generates
VN
NA an XML file to store the attributes for the graph. This XML file is called Graph.XML. If
you want to define additional graph attributes beyond the ones exposed by the Graph
Wizard, you can edit the Graph.XML file manually, and Oracle Reports will then use
this edited Graph.XML to generate the graph in your report output.
To access Graph.XML in a paper report:
1. Invoke the Paper Layout.
2. Double click the graph object to open the Property Inspector.
3. Click the button in the Graph Settings property to view and edit the Graph.XML
file.
Note: For Web reports, Graph.XML is available directly between the
<rw:graph> and </rw:graph> tags in the Web source of the JSP.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Document
on same
machine
• Any
destination
a ble
• Any URL f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyrightus© e2004, Oracle. All rights reserved.
( ku se to
A R en
Using Graph
U l ic
M Hyperlinks
I T K
Oracle Reports supports the ability to add a hyperlink to a graph embedded in a report.
VN
NA More specifically, the hyperlink can be different for each section of the graph. For
example, a user may click on a particular slice of a pie graph, and drill down to another
report to see detailed information.
Usage Notes
• You can set another report as the graph hyperlink. This second report will run from
your first report output.
• The Additional Attributes (HTML) property for Parameter Form fields cannot be used
to add additional HTML attributes to a link defined by a graph hyperlink.
• You cannot set a graph hyperlink by using PL/SQL.
• You must set the Hyperlink Destination property for a graph hyperlink that specifies
another layout object as its destination.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Technical Note
When delimiting parameters in a URL, you can use the ampersand (&) or the plus sign
(+). The ampersand is more commonly used and recommended. The ampersand
immediately preceding EMPLOYEE_ID indicates substitution.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 17 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 17-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
4
2 le
r a b
s f e
- t r an
o n
s an
3 ) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U
1T K Cross product group
I
V N 2 Row and column groups
NA
3 Cell group
4 Cell column is the source of a cross product summary that
becomes the cell content
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
F_CITY 1
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
an s
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
BuildingU Ma Matrixlicwith Group Report
K
IATmatrix with group report consists of a break group that contains a simple matrix
V N
NA structure. For each break value, different row and column values might apply. In a single
query Data Model, each matrix contains only the applicable rows and columns for the
break value.
The Data Model for a matrix with group report is identical to the simple matrix, except for
the addition of a break group, similar to a master-detail hierarchy.
The break group exists one level above, and outside, the matrix group. The entire cross
product group repeats for each record in the break group.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Region: F_CITY
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
BuildingU Ma Nested l icMatrix
I T K
You create the nested matrix style with the Wizard by adding an extra level in the Rows
VN
NA tab. This style has some specific features. This section briefly describes the Data Model
and Paper Layout, pointing out the differences from the Matrix with Group style. It also
explains how summaries evaluate the extra group level of a nested matrix.
The Nested Matrix Data Model
The Wizard creates the same objects for then nested matrix data model as for a simple
matrix structure. In addition, it creates an additional break group for each level of nesting.
The cross product group encloses the additional break groups as well as the two original
dimension groups of the rows and columns.
If you enhance the existing Data Model to include an additional level of nesting, the
existing cross product group does not recognize any newly created group. You must create
the cross product group after you create all the groups that you want in the nested matrix.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Paper
NestedUMatrix l ic Layout
I T K
The Report Wizard creates the same paper layout objects for a Nested Matrix as for a
VN
NA simple matrix structure. It also creates the following objects:
• One repeating frame for each additional break group, nested within the same overall
matrix structure
• One matrix object for each additional break group
The exact appearance depends on whether the extra level is in the Row or in the Column
tab. The diagram above shows nested rows.
In the Object Navigator, you can see the matrix structure in the Dimension and Frequency
nodes. These nodes exist only if there is a matrix. You do not see a node for the matrix
object name, but it does have properties. You can open the Property Inspector in the Paper
Layout only.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
F_SumSALARY F_SumSALPerDEPA
f e r
ans
n - t r
o
F_Sum_CITY
s an
) ha
F_SumSALPerJOB_lฺco
m ideฺ
m ai t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
CreatingU Nested Matrix Summaries
K
T Wizard creates nested summaries in the cross product group.
IThe
V N
NA If you create or alter a nested summary, you must set the Product Order correctly. Always
test the report output very carefully to ensure that the summaries are displaying exactly
the value you expect.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Displaying Zeros
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Displaying
U M Zeroslicin Cells with No Value
I T K
The field that displays each cell of the matrix is sourced to a summary column, such as
VN
NA SumSalary.
If there is no value for a particular row/column combination, the summary column is null
and therefore the cell is displayed as a blank field.
You can very simply change the blank to zero or any default value you choose.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 18 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Property Value
Name SumMonthProduct a ble
f e r
Product Order G_MONTH G_PRODUCT_ID
ans
Function Sum n - t r
o
Source SumTOTAL_VALUE
s an
Reset At G_PRODUCT_ID ) h a
l ฺ
i You
g. Use the Paper Layout view to create theafields.
c deฺ
om ui
m n t G must expand the appropriate
repeating frame.
@ g de
h. Run the paper layout to test i 1
t3the report.
S tu
n s
av e thiDo not close it.
i. Save the report as p18q2.jsp.
r n
3. Continue with the
u m a from
report
t o usthe previous exercise.
R (k for null
a. Add zeros
s e values in the cells.
A that
b. Ensure c n
ethe report shows only three product columns on each page.
U M l i
c. Format all numeric data to be right aligned.
N IT K d. Add commas and two decimal places where appropriate.
V
NA e. Run the paper layout to test the report.
f. Save the report as p18q3.jsp and close it.
If You Have Time
4. Open the report as p18q3.jsp.
a. Make the necessary changes in the Data Model view to include the product
name.
b. In the Paper Layout view, delete the product_id field and insert a boilerplate
object to display the product name. Rotate this object by 90 degrees.
Note: You may have to expand the R_G_PRODUCT_ID frame and the
outermost frame. Watch out for frequency errors.
c. Run the paper layout. Save the report as p18q4.jsp.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 18-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Report:
– Five triggers
– Report Triggers node in Object Navigator
• Data Model:
– Formula (column) le
r a b
– Filter (group)
s f e
– Parameter validation - t r an
n no
• Layout: Format trigger on most objects a
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Types U ofMTriggersl icin Reports
I T K
You can code PL/SQL in a variety of triggers in a report to provide conditional or
VN
NA additional processing at run time. This lesson discusses examples of each type of PL/ SQL
trigger.
There are three trigger types in Oracle Reports: Report, Data Model, and Layout.
• Report:
- A set of five report-level triggers. Each trigger fires at a different stage of the
report execution.
- Access report triggers from the Report Triggers node in the Object Navigator.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Trigger Code
Boolean:
true
false
a ble
f e r
a n s
n
Character-t r
o
s an
Number
) ha Date
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
n
MA lice
TriggerUCode
I T K
When you create a trigger such as a report trigger or a PL/SQL formula, the Program Unit
VN
NA editor supplies a template for the function block, giving the basic syntax that you require.
You can change the name of the function.
The value that you return must match the return data type in the function declaration.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Before
Parameter F
Form
1 2 If readonly=yes 3
F
If > 1 page a ble
f e r
After
Before Between Aftertran
s
page1 page2
Parameter
Form
Report Pages on-
Report
n
s a
F
a
) h eฺ
F
m
co uid
i l ฺ
g ma ent G
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
UM lic
1T KIf After Parameter Form returns FALSE, the cursor returns to the run-time
I
N parameter form. If the run-time parameter form is not displayed, control returns
V
NA to the calling program.
2 If READONLY=Yes, Reports Builder implicitly sets the readonly transaction
(SET TRANSACTION READONLY) after the Before Report Trigger fires.
3 If READONLY=Yes, Reports Builder implicitly ends the
read-only transaction (COMMIT) after the final page and before the After
Report Trigger fires.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
I T K
V N
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Format triggers:
• Exist on most layout objects
• Can suppress an entire layout section (master
group frame): No records fetched
• Can suppress the display of individual records ble
(repeating frame): All records fetched f e r a
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using U M Triggers
Layout l ic
I T K
Most paper layout objects can contain a format trigger; it is one of the common properties
VN
NA of a paper layout object.
Format triggers enable you to modify the display of objects dynamically at run time or to
suppress display altogether.
The trigger must return a boolean value—true or false.
The following pages discuss some examples of format triggers.
Suppressing the Entire Paper Layout for a Query
Because Reports is driven by the layout, you can use a format trigger on a group frame to
conditionally suppress the entire layout associated with a query. In this case, the query
does not retrieve any data.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
1
No employees in
a ble
this department
f e r
ans
Dept: 40
n - t r
No employees nino
a
as
this department
) h eฺ
o m d
2 ailฺc Gui
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
1
M
UBoilerplate c Position behind column heading frame, or
litext:
I T K
N position below and create collapsible anchor to column
V
NA heading
2 Column heading frame does not display; suppressed by
format trigger
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Employee Details
Employee Details
King 17-JUN-87 24000 1
f_name f_date f_salary
Kochhar 21-SEP-89 17000
De Haan 13-JAN-93
Employee17000
Details a ble
f e r
n s
King 17-JUN-87 n-tra
Kochhar 21-SEP-89 a no
h a s
De Haanm ) 13-JAN-93
e ฺ
c o i d
m ailฺ t Gu
@ g den
n i t31 is Stu 2
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U
1T K Report for payment clerks shows all fields
N I
V 2 Report for other employees shows gap where salary is hidden
NA
Using a Format Trigger on a Field
Requirement: Dynamically Hide Fields: Given the same employee details report as
before, hide the salary field without rearranging the other fields in the repeating frame.
The report contains a gap in the layout when the salary field is not displayed.
Example: Place the format trigger on the salary field to display it only when payment
clerks run the report. The code is the same as before:
function pay_clerks_see_this return boolean is
begin
if :user_type = 'PAY_CLERK' then
return(true);
else
return(false);
end if;
end;
In this example, you do not need to create any additional layout object or code.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
4 2 le
3
r a b
s f e
FUNCTION spacing RETURN BOOLEAN IS
- t r an
BEGIN
non
IF MOD(:count_column, 3) = 0 THEN
s a
RETURN(TRUE); a
) h eฺ
ELSE m
co uid
i l ฺ
ma ent G
RETURN(FALSE);
END IF;
@ g d
END; t31 Stu
n i is
a v t h
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
UM lic
1T K Transparent rectangle
I
V N 2 Repeating frame, Vertical Elasticity = Variable
NA 3 Summary column name (created in Data Model)
4 Format trigger on transparent rectangle
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Event-Based Reporting
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle Advanced
PL/SQL Workflow Queuing
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-29 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-30 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-31 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary (continued)
Objects That Must Return a Value
The following table is a reminder of the Reports Builder triggers that must always return a
value, and the values that are acceptable.
Trigger Type Valid Values Result if False
Report trigger True, False Abort execution
Group filter True, False Do not process record
Validation trigger True, False Return to parameter
form
Format trigger True, False Do not format object
PL/SQL Formula (col- Computation: Character, N/A
a ble
umn) Number, Date f e r
ans
Writing Common Code
n - t r
Use report-level program units or PL/SQL libraries for common code
a no
requirements to
improve productivity and maintenance. ha s
)
Event-Driven Publishing
lฺcom deฺ ui
Use the PL/SQL procedures and functions in the i
aevent-driven
G publishing API to
g m n t
automatically submit jobs to OracleAS Reports
3 1 u de when an event occurs in the
@ tServices
database.
av e thinit sS
r n
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-32 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 19 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-33 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-34 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 19-35 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
SRW.SET_BOOKMARK SRW.DO_SQL
SRW.SET_FONT_STYLE SRW.RUN_REPORT
a ble
f e r
ans
n - t r
SRW.SET_MAXROW a
SRW.TRACE_START
no
h a s
SRW.MESSAGE m ) eฺ
SRW.PROGRAM_ABORT
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
ContentsU ic
Mof the Reports
l Builder Built-in Package
K
T Reports Builder built-in package, known as the SRW package, contains procedures,
IThe
V N
NA functions, and exceptions that can help you to do the following:
• Control report execution
• Output messages at run time
• Initialize layout fields
• Create a table of contents
• Perform DDL statements (create or drop temporary tables)
• Dynamically set format attributes, such as font style and fill patterns
Referencing the Contents of the Package
You can reference any part of the SRW package in a PL/SQL statement in any program
unit of a report, such as a paper layout format trigger or a report-level trigger.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Outputting Messages
• Warning:
WHEN <exception> THEN
SRW.MESSAGE (999, ‘Warning: report continues’);
• Error:
a b le
WHEN <exception> THEN
e r
SRW.MESSAGE (999, ‘Warning: report terminated’);nsf
- t r a
RAISE SRW.PROGRAM_ABORT;
on
s an
• Exceptions: ) ha
– SRW.INTEGER_ERROR c o m ideฺ
m ailฺ t Gu
– SRW.NULL_ARGUMENTS g
@ d e n
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Outputting
U Messages
K
T SRW.MESSAGE packaged procedure displays a message with a code and text string,
IThe
V N
NA which you specify. The message is displayed in the following format:
MSG-code: text
The message is displayed in a small dialog box. The user must acknowledge the message
before continuing.
Message Code and Text
You can enter a code number from zero up to ten digits. If you enter a number of fewer
than five digits, the code is displayed with leading zeros.
You can enter a text string to a maximum of 190 characters, excluding the code number.
You can embed extra spaces to display your message neatly in the message dialog box.
Reports does not suppress extra spaces in the message text.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
KOCHHAR
KOCHHAR.LIS
DE HAAN
yyy yyyyyyy
a ble
yyy yyyyyyy
f e r
ans
n - t r
o
DE HAAN.LIS
s an
) ha
zzz
o mzzzzzzz d e ฺ
c i
m ailฺ zzzt G u
zzzzzzz
SRW.RUN_REPORT
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
U
1T K Output from master output
N I
V 2 Output from detailed report
NA
Executing a Nested Report
SRW.RUN_REPORT invokes RWRUN with the string that you specify. Use
SRW.RUN_REPORT to execute a second report from within a report process. For
example:
• Output parts of a report to different destinations
• Divide a large report into several smaller reports that can be run conditionally
Both reports use the same process. SRW.RUN_REPORT starts only one run-time process;
it does not start a new process for each report execution.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Example:
SRW.RUN_REPORT
('Report=EMPS
DESTYPE=FILE
DESNAME='||:LAST_NAME||'.LIS
BATCH=YES
MGRNO='||TO_CHAR(:MANAGER_ID));
a ble
f e r
• Exceptions: ans
n - t r
– SRW.RUN_REPORT_FAILURE o
s an
– SRW.RUN_REPORT_BATCHNO
) ha
m ฺ
• Function: SRW.GETERR_RUN ilฺco uide
g ma ent G
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Executing
U Ma Nested
l ic Report (continued)
I T K
Example Function Code
VN
NA FUNCTION MGR_REP RETURN BOOLEAN IS
BEGIN
SRW.RUN_REPORT
('REPORT=EMPS
DESTYPE=FILE
DESNAME='||:LAST_NAME||'.LIS
BATCH=YES
MGRNO='||TO_CHAR(:MANAGER_ID));
RETURN(TRUE);
EXCEPTION
WHEN SRW.RUN_REPORT_FAILURE THEN
SRW.MESSAGE(100, 'Error executing EMPS report');
RAISE SRW.PROGRAM_ABORT;
END;
Note: Use LAST_NAME to create the output filename for each manager; use
MANAGER_ID to restrict the EMPS query.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Restricting Data
Q_EMP le
EMPLOYEE_ID LAST_NAME r a b
s f e
100 KING - t r an
G_EMP 101 no
KOCHHAR
n
a
102 asDE HAAN
) h eฺ
EMPLOYEE_ID m
co uid
LAST_NAME i l ฺ
g ma ent G
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Data lic
Restricting
U
I T K
Use SRW.SET_MAXROW to restrict the maximum number of records you want to
VN
NA retrieve for a specified query. Reports Builder uses only the retrieved rows of the query in
subsequent processing, such as computations and summaries.
Suppressing a Query
At run time, you can choose not to display any data from a query by setting the maximum
number of records to zero. This prevents Reports Builder from retrieving any records from
the database.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Initializing Fields
1
a ble
f e r
FUNCTION F_LOGICAL_PAGEFormatTrigger
ans
RETURN BOOLEAN IS n - t r
my_page number; a no
a s
) h eฺ
BEGIN
SRW.GET_PAGE_NUM(my_page); m
co uid
2
i l ฺ
SRW.SET_FIELD_NUM(0,my_page+3);
RETURN(TRUE); g ma ent G
END;
n31@ tud
it is S
n v
a e th
r us© 2004, Oracle. All rights reserved.
a Copyright
u m t o
R (k se
M A licen
U
1T K Create format trigger on F_NEWPAGE field
N I
V 2 Set field value to my_page+3
NA
Initializing Fields
You can dynamically initialize the value in a layout field by using the relevant
SET_FIELD packaged procedure; for example:
• SRW.SET_FIELD_CHAR (0, 'a text string')
• SRW.SET_FIELD_NUM (0, 1234)
• SRW.SET_FIELD_DATE (0, '01-JAN-2002')
The first argument is always 0 (zero); you can set the value of the current object.
These procedures are relevant only in the format trigger of a field of the correct type. If
you use a procedure that conflicts with the field type, it has no effect in the report; Reports
Builder ignores the code and does not raise an error.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Example:
SRW.DO_SQL('CREATE TABLE SRW_LOG
(RPT_NAME VARCHAR2(40),
REC_NUM NUMBER,
MSG_TEXT VARCHAR2(80))' );
ble
SRW.DO_SQL('INSERT INTO SRW_LOG
s f era
(RPT_NAME, REC_NUM, MSG_TEXT)
t r a n
VALUES
on -
a
(''PAY_REPORT'', TO_CHAR(:EMPLOYEE_ID), n
h a
:LAST_NAME||''PAY REPORT RUN'') s');
m ) eฺ
o
lฺc Guid
• Exception: SRW.DO_SQL_FAILURE a i
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Performing
U ic
M DDL lStatements
I T K
The SRW.DO_SQL packaged procedure executes any specified SQL statement from
VN
NA within Reports Builder.
Use SRW.DO_SQL to perform DDL statements dynamically during run time. For
example, create a temporary table and insert rows into it during execution.
You can also perform DML statements using this procedure, but DML statements run
faster if you code them directly within a PL/SQL block. Code DML statements in the
SRW.DO_SQL procedure only if necessary. For example:
• To insert records into a permanent table in the database, code DML in a PL/SQL
block.
• To insert records into a temporary table that does not exist until run time, code DML
in SRW.DO_SQL.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Borderwidth
Tuesday, January 2004 Fill pattern
Format mask
a ble
Printer tray control f e r
ans
n - t r
a no
h a s
m ) eฺ
Define ao bookmark
Car Policy a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
SettingUFormat l ic
M Attributes
I T K
The SRW.SET_<attributes> packaged procedures apply specified format attributes to the
VN
NA current layout object: frame, repeating frame, field, or boilerplate object.
Some of the reasons that you would want to use format attributes are:
• To change the visual appearance of layout objects conditionally, depending on values
in a repeating frame, or on run-time parameter values
• To switch to different printer trays as your report formats
• To place a logo or standard links in an HTML document
• To define a bookmark in an HTML or PDF document
You can code the packaged procedure in a function as a local or report-level program unit,
or in a PL/SQL library. This is useful if you want a common format attribute in more than
one object or more than one report. You can then call the function whenever required
from the format trigger of a specific object.
As an alternative to a PL/SQL library, in the Object Navigator, you can drag and drop
report-level program units between different reports. However, note that this creates a
copy of the program unit in each report, rather than a reference to one piece of code.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Visual attributes:
SRW.SET_FILL_PATTERN('solid');
SRW.SET_BORDER_WIDTH(250);
SRW.SET_FORMAT_MASK('Day, Month yyyy');
a ble
f e r
• Printer tray control:
ans
n - t r
SRW.SET_PRINTER_TRAY('letterhead'); o
s an
) ha
• Defining a bookmark: c o m ideฺ
a ilฺ Gu
SRW.SET_BOOKMARK('Car gPolicy m e n t
');
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
SettingUFormat l ic
M Attributes (continued)
T K
IExample
V N
NA Conditionally set the following attributes if salary is greater than $12000:
Attribute Value
Background fill color Blue
Fill pattern Sandpaper
Font style Italic
Font face Helvetica
Font weight Extra bold
Text color White
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
…
<rw:field id="F_SALARY" src="SALARY“. . .
formatTrigger="mystyles">
F_SALARY
</rw:field>
…
a ble
f e r
FUNCTION mystyles RETURN BOOLEAN IS
ans
BEGIN
n - t r
SRW.SET_JUSTIFICATION(SRW.RIGHT_HJUST);
a no
SRW.SET_TEXT_COLOR('Red');
a s
SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
m ) h eฺ
ฺ co uid
SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
i l
return (TRUE);
g ma ent G
END; @ d
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Using Format
U Attributes in a Web Layout
K
T that the formatTrigger attribute of the rw:field tag is used to modify the display
IRecall
V N
NA characteristics of the field. You can only use specific SRW packaged procedures to set the
field’s attributes. These are:
• SET_FORMAT_MASK • SET_FONT_SIZE
• SET_HYPERLINK • SET_FONT_WEIGHT
• SET_LINKAGE • SET_DISPLAY_NAME
• SET_TEXT_COLOR • SET_FIELD_CHAR
• SET_JUSTIFICATION • SET_FIELD_DATE
• SET_FONT_FACE • SET_FIELD_NUM
• SET_FONT_STYLE
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 20 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
IT KU
If You Have Time
N
V 4. Open report p10q1.rdf
NA In this report, you use report triggers to create a temporary table at the start of report
execution, and you insert rows into the table at various stages of the execution.
a. Write a trigger that creates a temporary table to hold the date and userid each
time the report is run. The table should contain three columns: one date column,
one character column of width 10, and one character column of width 80.
CREATE TABLE RUNREPORT
(DATE_RUN DATE, USER_RUN VARCHAR2(10), COMMENTS
VARCHAR2(80))
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 20-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Web
Enterprise Application Development Framework Services
System Management
Management
Portal Business Integration
Intelligence Broker
Any Data
Source
Application server a ble
f e r
Mobile and
a n s
Wireless
Grid Computing Infrastructure -t r
nPackaged
a noApplication
Oracle Application Server 10gha
s
m ) eฺ
o
ilฺc Guid
Business
Intelligence
m a t B2B
@ g de n
n i t3 is Stu
1
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
OracleAS U Reports Services Architecture
T K
IOracleAS
N Reports Services is architected to publish reports in both Web-based and non
V
NA Web-based environments. Reports Services can be configured in a number of ways
depending on your requirements. In this section, you will learn about the OracleAS
Reports Services runtime architecture and the various commands used to invoke a report
that is deployed on the Oracle Application Server.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
• Log in only once ans
n - t r
• Access application level authentication o
s an
• Access data level authentication ) ha
l ฺ c om ui deฺ
m ai t G
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
Enabling
U Single Sign-On Access
K
T deploying reports, you need to ensure that your user has the necessary privileges to
IWhen
V N
NA run that particular report, at that particular time, on that particular server.
Likewise, now that pluggable data sources are part of the benefits offered to you through
Oracle Reports, you need to ensure that your user has the privileges to access the required
data sources. You may want to spare your user the trouble of having to log in to multiple
data sources in order to run one job.
You can address application level authentication and data level authentication through
single sign-on (SSO).
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
HTTP
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
i t 3 1@PDS S tud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Running U Mthe Paperl ic Layout: Servlet Run-time Architecture
I T K
You use the Servlet run-time architecture to run the paper layout.
VN
NA When a request is received for the Reports servlet, the servlet contacts the Reports server
to ensure the user is authenticated to run the report. Once authentication has been
established, the Reports server spawns a Reports engine and sends the request to that
engine to run the report. The Reports engine executes the RDF by:
• Retrieving and formatting the data
• Populating the Reports cache
• Notifying the Reports server that the report is ready.
The Reports server accesses cache and send the report to the specified output destination.
If the report is a Reports JSP that contains a paper layout, the Reports engine interprets the
paper layout, coded in XML, and executes the report as stated above.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
URL syntax:
http://vesuvius.world.com:8888/reports/rwservlet?
report=emp_dept.rdf&desformat=html&destype=cache&
server=repsrv1&dept_param=10
Key map file: cgicmd.dat
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Running U M c
a PaperliReport on the Web
T K
IOracleAS
N Reports Services supports requests both from Web and non-Web clients. This
V
NA section covers how to run a report in both environments.
Thanks to the Reports thin client Web interfaces (the Reports Servlet or JSP), running a
report on the Web is simply a matter of entering a URL, just as you would fetch almost
any document on the Web. The URL specifies all the required information to run the
report, such as: what report to run, what format to produce the output in, whether to
schedule the report, and so on. Consider the following example:
http://vesuvius.world.com:8888/reports/rwservlet?
report=emp_dept.rdf&desformat=html&destype=cache&
server=repsrv1&dept_param=10
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• SERVER = <server_name>
• MODULE|REPORT = <runfile>
• DESTYPE = FILE, PRINTER, MAIL, CACHE,
LOCALFILE, SYSOUT,ORACLEPORTAL
• DESNAME = <desname> ble
f e r a
• DESFORMAT = PDF, HTML, HTMLCSS, RTF, s
DELIMITED, XML - t r an
no n
s a
RWCLIENT SERVER=server1 MODULE=my_rep.rdf
) ha
DESTYPE=cache DESFORMAT=html
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
RunningU a Report from the Command Line
T K
IExample
V N
NA 1. Invoke the command line. In Windows NT, Select Start > Run.
2. Enter the command string, for example:
RWCLIENT.EXE SERVER=server1 REPORT=my_rep.rdf
DESTYPE=FILE
DESFORMAT=PDF DESNAME=my_rep_output.pdf
This command references an executable file that parses and transfers the command line to
the specified OracleAS Reports server. The report is run immediately.
Returning Control to the Client
Include BACKGROUND=Yes in your RWCLIENT command line, the report runs
asynchronously, and then RWCLIENT returns immediately after submitting a job request
to Reports Services.
Technical Note
For a complete list of command line arguments, refer to Oracle Application Server
Reports Services, Publishing Reports to the Web documentation.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
RWCLIENT...
SCHEDULE=monthly_last_weekday_from_17:00_Nov_22,_2003_
retry_3_after_1_hour
a ble
f e r
ans
n - t r
FREQ CLOCK o
nDATE
s a
h
) eฺ a
o m
a ilฺc GuidTIME
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
The Schedule
U l ic
M Parameter
I T K
SCHEDULE is a scheduling parameter that you can include in the RWCLIENT command
VN
NA line to control the time and frequency with which your report runs.
The syntax of the SCHEDULE parameter comes primarily from the syntax of a “cron” job
on UNIX. To avoid quoting the schedule string, use underscores (_) instead of spaces.
In default mode, the program runs the report immediately.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Reports Caching
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using Oracle
U ic
M Enterprise
l Manager
K
T section introduces Oracle Enterprise Manager as a means for monitoring OracleAS
IThis
V N
NA Reports Services. It also explains the features of the Queue Manager and how to use it to
view and schedule reports in an easy-to-use GUI.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Queue Manager
Past jobs
Current jobs
Scheduled jobs
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
QueueU M
Manager l ic
I T K
The Queue Manager status bar enables you to switch among different views of report
VN
NA jobs.
Icon Name Description
Show Past Jobs Displays jobs that have already run for a given reports server
Show Current Jobs Displays jobs that are currently running
Show Scheduled Jobs Displays scheduled jobs in order to reprioritize or cancel a job
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Queue Manager
All my jobs
All jobs
Refresh
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
QueueU M
Manager l ic
(continued)
I T K
The Queue Manager status bar enables you to restrict the view of jobs by owner.
VN
NA Icon Name Description
Show All My Jobs Displays your reports for a given reports server
Show All Jobs Displays all reports for a given reports server
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
RSVR1
Queue
Manager
RSVR2
a ble
f e r
• Connect to any number of servers
a n s
n -t r
• Administrator can shut down server n o
s
• Reports Services restores scheduled jobsa
) ha after
shutdown om eฺ
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Using the
U c
MQueueliManager
I T K
You can connect to Reports Services by changing the server name in the Queue Manager
VN
NA status bar.
You can shut down Reports Services from the Queue Manager menu if you have
Administrator privileges. Select Queue > Shutdown. This option remains grayed out if
you are not logged on as Administrator.
Reports Services maintains a list of all scheduled jobs in a file, <oracle_home>/
reports/server/servername.dat. If Reports Services shuts down and restarts
for any reason, it reads this file at startup and restores all scheduled jobs.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 21 Overview
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
PracticeU Session Overview: Lesson 21
K
T practice session contains:
IThis
V N
NA • Constructing a URL to run a report on the Web
• Creating an entry in the key map file
You publish your reports using OracleAS Reports Services in the Oracle Application
Server. This practice session consists of paper-based questions to test your understanding
of OracleAS Reports Services.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 21-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m t o us© 2004, Oracle. All rights reserved.
a Copyright
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Objectives
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-2 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Tuning Reports
• No absolute rules
• Investigate specific areas:
– Data Model
– Paper Layout
– Web Layout and JSP report definitions le
r a b
– Run-time arguments
s f e
- t r an
n no
s a
h
) eฺ a
o m
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
M Reports
TuningUOracle l ic
I T K
Tuning a report is not a matter of applying a few small tweaks that will result in dramatic
VN
NA improvements in performance. It is more a case of investigating specific areas. The areas
to investigate are the Data Model, the Paper Layout, the Web Layout and JSP reports
definitions, and run-time arguments. Investigating some of these areas can result in
significant performance improvements, minor performance improvements, or may have
no effect on the actual performance at all, but rather impact the perceived performance.
Be aware that there are no absolute standards.
The Reports Measurement Tools
The first step to take when attempting to tune a report is to determine where the report is
spending the majority of its time in execution. In other words, does the report spend a
large portion of its time in the database retrieving the actual data, in the formatting
process once the data has been retrieved, or waiting for runtime resources and
distribution?
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-3 and/or its affiliates.
2010, Oracle
SQL Star International Limited
A VN
N
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-4 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Performance Measurement
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-5 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Non SQL U l ic
MData Sources
I T K
As you have learned, it is possible to publish data from any data source in Oracle Reports.
VN
NA Both the XML and Text pluggable data sources can be accessed through a remote URL. If
speed is a concern, download the data locally and use the local data stream rather than the
remote URL. You can also specify the domains for which you can bypass a proxy server.
The XML pluggable data source supports validation of the XML data at runtime. You can
activate this option by checking the “Validate Data Source” checkbox in the XML query
definition window. When you do, the XML data is validated against the data definition
you specified in the DTD or XML schema. This is a rather costly operation. If you are
sure that your XML data is valid, do not activate validation. You will see a noticeable
performance difference, especially if your XML data stream is very large.
You have the option to specify either an XML schema or a DTD for the data definition.
Using an XML schema forces type checking. With a DTD, the data is merely treated as a
string and no type checking is necessary.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-6 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-7 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-8 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-9 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• Frames
• Object size
• Format triggers
• Fetching ahead
• Bursting and distribution
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Investigating
U c
M theliPaper Layout
K
T the data has been retrieved, Oracle Reports needs to format the output following the
IOnce
V N
NA Paper Layout the user has created. The time it takes to generate the layout depends on a
number of factors, such as:
• Frames: When generating a default layout, Oracle Reports puts a frame around
virtually every object to protect the object from being overwritten by another object.
In some situations, such as boilerplate text column headings, there is clearly no risk of
the objects being overwritten, hence the immediately surrounding frame can be
removed.
• Object size: An object that is defined as variable, expanding, or contracting in either
or both the horizontal and vertical directions requires extra processing. In this case,
Oracle Reports must determine the size for the object’s instance before actually
formatting the object and any objects around it. If the sizing can be set to fixed, this
can be avoided as the positional relationship between objects is already known.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• RUNDEBUG=NO
• Array processing
• LONGCHUNK
• PARAMFORM
• Batch processing
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Running U M l
the Reportic
I T K
Having designed a report to run efficiently, it is possible to further affect the overall
VN
NA performance of a report by setting specific run-time arguments.
By default, Oracle Reports automatically runs error checks on the layout and bind
variables within a report. This is useful at the design stage but is generally superfluous in
a production environment. Setting the runtime parameter RUNDEBUG= No turns off this
extra checking at run-time.
Oracle Reports is able to take advantage of array processing capabilities. This allows
records to be fetched in batches instead of one at a time and results in fewer calls to the
database. The downside of array processing is that more space is required on the
execution platform for storing the arrays of records returned. If the load on the network
becomes a major bottleneck in the production environment, the ARRAYSIZE argument
(defined in kilobytes) can be set to as large a value as possible for the execution
environment to reduce the number of network trips made to fetch the data for the report.
The default value for ARRAYSIZE is 10 kilobytes.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Developing
U M Reportsl ic to Run in Different GUIs
I T K
There are a few points that you should consider when moving a report from one GUI to
VN
NA another, because the following GUI differences may affect the report output.
If possible, use fonts that you know exist on the target GUI; otherwise, remember to set up
your font alias file so that the fonts that you use during development map to existing
similar fonts on the target GUI.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
/* Mac fonts */
"Avant Garde“ = "Arial"
"New York“ = "Times New Roman"
ble
In the uifont.ali file on UNIX (motif), map Microsoft Windows fonts to Motif: fera
a n s
/* Microsoft Windows fonts */
n -t r
o
"Courier New" = lucidatypewriter
s an
"Times New Roman“ = lucidabright
) ha
Using Common Colors
c o m ideฺ
lฺ GUI;
aitarget
If possible, use a color that you know exists onmthe G u otherwise, use one that
g den t
@
maps well to the default color of the target GUI.
Beware of Dots Per Inch n i t31 is Stu
r n av e th
a differ
The dots per inch (DPI) may
m u samong machines, even if they use the same GUI. This
o
ku se t characters wordwrap on the screen. Therefore, if you
only affects how (alphanumeric
R
design a report n
A thatlicisedisplayed in the Previewer, try to use the same DPI as the users who
willK U M
eventually run the report.
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
• NLS_LANG
• DEVELOPER_NLS_LANG, USER_NLS_LANG
NLS_LANG=French_France.WE8DEC
a ble
f e r
Unicode:
ans
n - t r
NLS_LANG=<lang>_<territory>.UTF8 a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
BuildingU Reportslic
M to Run in Different Languages
K
T section gives a brief overview of the features available on the server and in Oracle
IThis
V N
NA Reports Developer that provide support for building multilingual applications.
• Switching languages using Oracle’s National Language Support (NLS)
• Translating an application using Oracle’s TranslationHub
Setting NLS Language Environment Variables
Three language environment variables are available:
• NLS_LANG
• DEVELOPER_NLS_LANG
• USER_NLS_LANG
DEVELOPER_NLS_LANG and USER_NLS_LANG take the same parameter as
NLS_LANG. Use them as an alternative to NLS_LANG when you need to use two sets of
resource and message files at the same time; for example, if you prefer to develop using
English but need to build an application in another language.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Translating an Oracle Reports Application (continued)
Considerations When Designing Multilingual Applications
• Format masks: Make sure to provide extra space for translation of date and numeric
format masks.
• Text strings: Avoid hard-coding a string containing language-specific words such as a
month name.
• Character sets: If using an application that will run with multiple character sets,
determine the one that is most frequently used and generate the application files with
the relevant NLS language settings.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Summary
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arnCopyright
u s©e2004, Oracle. All rights reserved.
( ku se to
A R en
Summary U M l ic
I T K
• Analyze the performance of your reports using the Trace option in Oracle Reports, as
VN well as the SQL trace facility in the database. Tune reports by optimizing SQL,
NA minimizing calls to the database, and minimizing the amount of unnecessary format
processing required for the layout of returned data.
• Using Oracle’s translation tool, TranslationHub, the NLS parameters, and various
features in Oracle Reports, you can build multilingual report applications.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice 22 Overview
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© 22-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
A
Practice Solutions
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-10 and/or its affiliates.
2010, Oracle
SQL Star International Limited
V N
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-11 and/or its affiliates.
2010, Oracle
SQL Star International Limited
A VN DEPARTMENTS.MANAGER_ID=EMPLOYEES.EMPLOYEE_ID.
Watch for syntax errors!
N
c. Group the report by the department name.
On the Groups tab copy DEPARTMENT_NAME to the Group Fields
area.
Click Finish.
d. Save the report as p4q3.rdf.
Select File > Save As from the menu and save the file to disk.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-12 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-13 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-14 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-15 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-16 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-17 and/or its affiliates.
2010, Oracle
SQL Star International Limited
I T K in the menu.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-18 and/or its affiliates.
2010, Oracle
SQL Star International Limited
A VN Place from the style bar. Repeat the action for the second decimal place.
You can also select the options from the Format menu.
N
d. Change the color of the employee data heading to blue.
Select a label, and choose Select Parent Frame from the style bar. Select
Fill Color from the vertical toolbar.
e. Make whatever other changes you like.
No formal solution.
f. Save the report to a file named p5q2.rdf and close it.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-19 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-20 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-21 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-22 and/or its affiliates.
2010, Oracle
SQL Star International Limited
I T K Right.
A VN Select the number field and the number heading in the Template Editor
and click the Align Right tool from the stylebar.
N
Alterative solution:
Open the Field Labels/Headings and the Fields nodes under Paper
Layout > Section > Body > Default in the Object Navigator.
Open the Property Inspector for your selections.
Click Union (the button is a toggle and the tooltip says Intersection at
this point) from the Property Inspector toolbar to display all properties.
Under the headings Labels and Fields, change the Number Justification
property to Right.
Select Summaries > Number in the Object Navigator.
In the Property Inspector change the Number Justification property for
fields to Right.
g. Save the template as laketech.tdf.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-23 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-24 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-25 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-26 and/or its affiliates.
2010, Oracle
SQL Star International Limited
A VN sum for salary. Reenter the Wizard. Select Group Left as the style. On the
Groups page, select DEPARTMENT_NAME from the Available Fields
N
list and copy into the Group Fields list. On the Totals page, select
SALARY and click Sum >. Finish the Wizard.
e. Examine the Web source again. Now how many <rw:foreach> tags are in the
code?
Display the Web Source view of the Report Editor. Use Edit > Find and
Replace to locate the rw:foreach tag(s). There are two rw:foreach tags,
one for each group in the Data Model—one for the master group, one for
the detail group.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-27 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a v n this
n product
arby se number..
Sort the output
m u
to using the Report Wizard. Create both a Web and
Create( kaunewsereport
A R layout.
paper en Select Tabular as the style and enter Our Products as the
M l i c
U title. Select SQL as the data source and enter the query:
I T K
V N SELECT product_id, product_name,
NA product_description, catalog_url
FROM products
ORDER BY product_id
Select all fields for display. Do not create any totals. Modify the labels as
above.
b. Select the predefined Beige template.
Select the Beige template and Finish the Wizard.
c. Run the Web layout to test.
Select Program > Run Web Layout from the menu or select the Run
Web Layout icon from the horizontal tool bar.
d. Save the report as p7q2.jsp.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-28 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-29 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-30 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-31 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-32 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-33 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-34 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-35 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Name Definition
last_name employees.last_name%type
first_name employees.first_name%type
salary employees.salary%type
Create a new report manually. Select the Program Units node in the
Object Navigator and click the Create icon.
In the New Program Unit dialog box, enter RefCur as the name for the r a ble
package and choose Package Spec. n s fe
- t r a
Enter the code for the package specification. This code is o
n n
available in
p9q5a.txt.
s a
PACKAGE RefCur IS a
) h eฺ
TYPE EmpRec IS RECORD ( m
co uid
i l ฺ
ma ent G
last_name employees.last_name%TYPE,
g
first_name employees.first_name%TYPE,
i t
salary employees.salary%TYPE);3 1@ Stud
Type EmpCur a ISv nREF thCURSOR
is RETURN EmpRec;
r n e
END;
u m a
t o us
R (k thescode
Compile e and close the PL/SQL editor.
n
U MAIn
b. the Data
l i ce Model, create a REF Cursor Query. The function opens the cursor
IT K for the following SELECT statement:
V N SELECT last_name, first_name, salary
NA FROM employees
Select the Ref Cursor Query tool and click in the painter area. Define the
following function or copy the code from the text file p9q5b.txt.
function QR_1RefCurDS return RefCur.EmpCur is
V_EmpCur RefCur.EmpCur;
begin
OPEN V_EmpCur
FOR
SELECT last_name, first_name, salary
FROM employees;
RETURN V_EmpCur;
end;
Compile the code and close the PL/SQL editor.
c. Open the Report Wizard to create the layout for the tabular report. Select all
the fields and choose a template. Click Finish to run the paper layout.
d. Save the report as p9q5.jsp and close it.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-36 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-37 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Hint: Manually edit the query created by Query Builder to modify the
display of order_date using the TO_CHAR function and specify an alias:
TO_CHAR(order_date, ‘dd-Mon-yyyy’)Order_Date
b. Modify the query to include line_total as a calculation of
unit_price*quantity.
Enter the formula unit_price*quantity into the query text and era
ble
give it an alias name of line_total. a n sf
You can also use the Query Builder to create expressions o -trquery:
innthe
Select the table ORDER_ITEMS.
s an
Select Define Column from the toolbar.
) ha
Enter Line_Total inside the Defined Columns o m box. d e ฺ
c i
ailฺ t Gu inside the Defined as
Enter the expression unit_price*quantity
m
box and click OK. @ g den
tu in the query is a better solution
t31 is Sdirectly
Note: Performing the icalculation
than having a formula
n
av column.
th
r n e
c. Group them
u
data
t o us ID and Order Date and display all the fields.
a on Order
Move(k Order_ID e and Order Date to the Group Fields section. Make sure
R
Athey are n s
U M l i ceat the same level.
IT K d. Create the following summaries. Can you use the Report Wizard to create the
V N summaries?
NA Because this is a single query report, you can use the Report Wizard.
Column Summary
line_total sum
line_total % Total
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-38 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-39 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-40 and/or its affiliates.
2010, Oracle
SQL Star International Limited
IT K if;
V N return (1);
NA end;
b. Use the Report Wizard to add the new columns to the layout. Display the
maximum order total, the maximum ORDER_ID, the minimum order total,
and the minimum ORDER_ID.
Display columns CS_Max, CS_Min, CP_Maxid, and CP_Minid. Give
them more meaningful labels.
c. Run the paper layout to test. Scroll down to the last page to see the new
columns.
d. Save the report as p10q4.rdf and close it.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-41 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-42 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-43 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-44 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-45 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-46 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-47 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-48 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-49 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-50 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-51 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-52 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-53 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Property Value
Name B_logo
Source File Format Image
Source Filename logo.tif
a ble
f e r
c. Run the paper layout. a n s
d. On the operating system, copy any other .tif file to logo.tif.n -t r
o
e. Rerun your report.
s an
f. Save the report as p13q3.rdf.
) ha
4. Continue with report p13q3.rdf.
c o m ideฺ
ilฺ onGthe
a. Ensure that all items of one order areaprinted u same page.
Select Edit Margin from the
m n
g detoolbar.
horizontal
t Open the Property
1 @ t u
v n it3 frame
Inspector for the repeating
i s S R_G_ORDER_ID and set the property
r n a e th
Page Protect to Yes.
b. Save the report us
ma as p13q4.rdf and close it.
( ku se to
A R en
U M l ic
IT K
V N
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-54 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
an s
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-55 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-56 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-57 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-58 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-59 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-60 and/or its affiliates.
2010, Oracle
SQL Star International Limited
cust_email Email 20
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-61 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-62 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-63 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-64 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Click OK.
b. Run the paper layout to test.
c. Save report to p17q2.jsp.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-65 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-66 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-67 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Practice Session Solutions: Lesson 17 (continued)
b. Run the Web layout to test. Ensure that a graph displays for each sales
representative.
c. Resize the graph to a width of 800 and a height of 450.
Display the Web Source view. Locate the rw:graph tag. Add width and
height settings to the attribute list: <rw:graph id="graph“
src="G_PRODUCT" groups="PRODUCT_ID“
dataValues="PROD_TOTAL" width="800" height="450">
d. Save the report as p17q5.jsp. Run the Web layout to test.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-68 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-69 and/or its affiliates.
2010, Oracle
SQL Star International Limited
product_id Product 5
month Month 4
SumTotal_value Total 5
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-70 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-71 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Property Value
Name F_SumMonthProduct
Source SumMonthProduct a ble
f e r
ans
Select the Field tool from the vertical toolbar. n - t r
Create a field below F_SumSumTOTAL_VALUEPerNAME. a no Position
the field in the R_G_MONTH repeating frameh a
but
soutside any other
repeating frames. m ) eฺ
c o id
Set the following properties: ailฺ Gu
m ent
@ tudg
Property i t 3 1Value S
v n h i s
Name
a rna use tF_SumMonth
( kumse to
Source SumMonth
R
A licen
M
Uh. Run the paper layout to test the report.
I T K
N i. Save the report as p18q2.jsp. Do not close it.
V
NA 3. Continue with the report from the previous exercise.
a. Add zeros for null values in the cells.
Open the Property Inspector for F_SumTOTAL_VALUE and set Value
if Null to 0.
b. Ensure that the report shows only three product columns on each page.
Open the Property Inspector for R_G_PRODUCT_ID and set Maximum
Records per Page to 3.
c. Format all numeric data to be right aligned.
Use the style bar.
d. Add commas and two decimal places where appropriate.
Use the style bar.
e. Run the paper layout to test the report.
f. Save the report as p18q3.jsp and close it.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-72 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-73 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-74 and/or its affiliates.
2010, Oracle
SQL Star International Limited
d. Create a user parameter, user_type, that has two possible values: Sales
Representative and Sales Clerk.
In the Object Navigator, select the User Parameters node and click the
Create icon.
Open the Property Inspector for the parameter. Enter USER_TYPE in
the Name property.
Ensure the Datatype property is set to Character.
Create a static list of values containing Sales Representative and
Sales Clerk.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-75 and/or its affiliates.
2010, Oracle
SQL Star International Limited
u m a
return(true);
t o us
R (k se
else
M en
A licreturn(false);
K U end if;
I T
A VN end;
Note: You can implement the same logic using the Conditional
N
Formatting property in the Property Inspector for both the group
frames.
To test the result, display the USER_TYPE parameter in the margin of the
report.
Display the Paper Layout view and select Edit Margin. Create a field. In
the Property Inspector, specify the source as USER_TYPE.
Make sure that you can enter a parameter value at run time.
Select Tools > Parameter Form Builder from the menu and select
USER_TYPE from the Parameter list. Click OK to create the Paper
Parameter Form.
Test the report by changing the User Type parameter on the Runtime
Parameter Form.
f. Save the report as p19q1.rdf.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-76 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-77 and/or its affiliates.
2010, Oracle
SQL Star International Limited
N IT In the Paper Layout view, increase the height of the repeating frame for
V
NA the second layout. Remember to switch Flex mode on, so that you can
increase the repeating frame and the group frame together.
Open the repeating frame Property Inspector and change the Vertical
Elasticity to Variable.
Select the rectangle tool and click and drag an area inside the repeating
frame, below the fields. Make sure the rectangle is transparent: no fill,
no line.
In the Object Navigator, rename the rectangle to B_space and create the
following format trigger:
function B_spaceFormatTrigger return boolean is
begin
if mod(:count_ord,2) = 0 then return(TRUE);
else return(FALSE);
end if;
end;
b. Save the report as p19q3.rdf and close it.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-78 and/or its affiliates.
2010, Oracle
SQL Star International Limited
A VN Display the Paper Parameter Form and include a parameter form field
N PF_cutoff along with descriptive text.
b. Test the report several times by changing the cutoff parameter at run time.
c. Save the report as p19q4.rdf.
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-79 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-80 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-82 and/or its affiliates.
2010, Oracle
SQL Star International Limited
N IT
V exception
NA when srw.do_sql_failure then null;
end;
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-84 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-85 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-86 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-87 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-88 and/or its affiliates.
2010, Oracle
SQL Star International Limited
I T K server=repserver4
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-89 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-90 and/or its affiliates.
2010, Oracle
SQL Star International Limited
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-91 and/or its affiliates.
2010, Oracle
SQL Star International Limited
Oracle
Unauthorized reproduction Reports Developer
or distribution prohibited.10g: Build Reports
Copyright© A-92 and/or its affiliates.
2010, Oracle
SQL Star International Limited
B
Table Descriptions
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Table Descriptions
Overall Description
The sample company portrayed by the Oracle Database 10g Sample Schemas operates
worldwide to fill orders for several different products. The company has several divisions:
• The Human Resources division tracks information on the company’s employees and
facilities.
• The Order Entry division tracks product inventories and sales of the company’s products
through various channels.
• The Product Media division maintains descriptions and detailed information on each
product sold by the company.
• The Shipping division manages the shipping of products to customer.
Each of these divisions is represented by a schema. In this course, the user has access to the
objects in all of these schemas.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
HR Human Resources
OE Order Entry
a ble
QS PM s f e r
- t r an
non
Queued Product a
s
Shipping Media ) ha ฺ
l ฺ c om uide
m ai t G
The Oracle Database Sample Schemas are a@ d e n schemas. This set of schemas is
setgof interlinked
aimed at providing a layered approachitto 31complexity:
S tu
• A simple schema (Human n
n
av e HR)
Resources,
s
thi for introducing basic topics.
• A second schema (Order
r s for dealing with matters of intermediate complexity. A
a Entry, uOE)
u m t o
multitude of data
R (ktypes siseavailable in this schema.
• The Online ACatalog c n subschema is a collection of object-relational database objects
e(OC)
U M l i
I T K
built inside the OE schema.
VN• A schema dedicated to multimedia data types (Product Media, PM)
NA • A set of schemas gathered under the main schema name QS (Queued Shipping) to
demonstrate Oracle Advanced Queuing capabilities.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
SQL> select count(*) from employees;
f e r
COUNT(*)
ans
---------- n - t r
o
107
s an
) ha
SQL> select count(*) from jobs;
c o m ideฺ
COUNT(*) a ilฺ Gu
---------- g m e n t
19
i t 3 1@ Stud
a v n this
SQL> select count(*)
m arnfrom
u e
sjob_history;
COUNT(*) ( ku se to
----------AR en
M
U 10 l i c
I T K
VN
NA SQL> select count(*) from locations;
COUNT(*)
----------
23
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
C
Creating Web
b le
Layout Templates
sfe
r a
t r an
on -
a n
a s
m ) h eฺ
i l ฺ co uid
g ma ent G
i t 3 1@ Stud
a v n this
m arn use
( ku se to
A R en
K UM lic
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
Creating Web Layout Templates
This appendix explains how to create a Web layout template for Oracle Reports Builder.
You can use templates to define common characteristics and objects that you want to apply to
multiple reports. For example, you can define a template that includes the company logo and
sets fonts and colors for selected areas of a report.
To create an Oracle Reports Web Layout template:
1. Create a template file (.tdf file).
2. Create an HTML file that describes the layout.
3. Update the Web Template description file (rwTemplates.xml).
4. Test the new template.
5. Deploy the template in Oracle Reports and Oracle Application Server.
6. Add the template to the template library.
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
TDF file i t 3
HTML
1@CSSStud
a v n tfile h is HTML file
r n e
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
First, create a Reports template file:
i t 3 1@ Stud
1. In Oracle Reports Builder, choose
a v n File t h>isNew > Template.
2. In the Object Navigator, a rnunderuTemplates,
s e your new template name is displayed.
3. Specify a namekfor m to in the Property Inspector, for example MyCompany.
u youretemplate
(
Note: ThisR
A c e ns by Oracle Reports to create the relationship between the HTML
name is used
andU M files. li
CSS
K
4.ITSave the file as MYCOMPANY.tdf in the $ORACLE_HOME/reports/templates/
N
N AV directory.
You have now created a template. You can edit this template for paper reports by using the
Report Wizard.
a ble
f e r
2. Put all your generic HTML below the following HTML tags:
ans
n - t r
a no
h a s
m ) eฺ
3. The <rw:style> tag is used to create the link between
l ฺ othe
u id and the CSS that we
c template
i
ma entfile:
created and references into the rwTemplates.xml
g
G
i t 3 1@ Stud
a v n this
m arn use
( ku se to
ARgeneric
4. Put allMyour l i c enHTML, such as the company logo in the <BODY> tag:
K U
I T
VN
NA
5. Specify the <rw:dataArea> tag, where the Wizard will insert the report block:
a ble
f e r
8. Save this document in the $ORACLE_HOME/reports/templates/ directory. ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
a ble
f e r
ans
n - t r
a no
Attribute Value
h a s
id references the name of the module in them ) etemplate
Reports ฺ file, for
o
example, mycompany.tdf. Thisilฺiscnot theuname id of the file, but
ma Navigator.
the name that you see in thegObject n t G
cssFile references the namet3
@ tfile
of1the CSS u de
that Report Wizard will place in
n i s S
the <LINK> a
r n v
tag.
e thi
classSet m
references
u t o us id into the current XML file. The classSet
a the classSet
R (k the
makes serelationship between each field type and the CSS Class.
A e n
htmlFile
U ic
M references
l the file name of the HTML template, for example
K
NIT
myCompany.html.
V
NA
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
Name Value
i t 3 1@ Stud
TableStyle nclassthname
specifies the
a v is of the <table> tag
ColumnHeader arn theusclass
specifies
m
e name of the <th> tag used for the column header
RowHeader ( e tothe class name of the <th> tag used at the row header in
ku specifies
A c ns reports
R ematrix
K UM
CellText
li
specifies the class name of the <td> tag used for alphanumeric data
I T
VNCellNumber specifies the class name of the <td> tag used for numeric data.
NA CellDate specifies the class name of the <td> tag used for date data
TotalText specifies the class name of the <th> tag used for the summary empty
cells
TotalNumber specifies the class name of the <td> tag used for the summary non
empty cells
GroupAboveHeader specifies the class name of the <th> and <caption> tags used for the
group above section
3. After adding the <webTemplate> and <classSet> entries, save the rwTemplates.xml
file and restart Reports Builder.
a ble
f e r
ans
n - t r
a no
h a s
m ) eฺ
o
a ilฺc Guid
g m ent
i t 3 1@ Stud
a v n this
m arn use
u eyoutosee the new report with your template code. The Report
2. When you clickkFinish,
(
R the
Wizard replaces
A e s <rw:style> and <rw:dataArea > tags with the generated code.
nempty
UM li c
IT K
V N
NA
Location Description
$ORACLE_HOME/reports/docroot/ Default root directory of Oracle
Reports Builder
$ORACLE_HOME/reports/docroot/images Default image directory of Oracle
Reports Builder
$ORACLE_HOME/reports/docroot/css Default CSS directory of Oracle
Reports Builder
While deploying a Web report on the Oracle Application Server, you need to make sure thatraall ble
f e
t r ansserver.
the associated elements such as images and CSS files are in the correct location on the
on -
a n
a s
m ) h eฺ
i l ฺ co uid
g ma ent G
i t 3 1@ Stud
a v n this
m arn use
( ku se to
A R en
K UM lic
N I T
V
NA
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Glossary
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.
SQL Star International Limited
A
API (Application Program Interface) Data Model view Displays a structural
A language and message format used by representation of the data in a report.
an application program to communicate The objects do not appear in the report
with the operating system or some other output, but the structure determines the
control program such as a database layout style, and the data objects provide
management system or communications the values that appear in the layout
protocol. objects.
J M
Java A computer language that margin An optional report region that
supports programming for the Internet in appears at the top and bottom of each
the form of platform-independent logical page in a report section: Header,
"applets." Main, and Trailer. The margin may
include any layout object, but typically
JAR Acronym for Java ARchive. A file contains boilerplate and fields for page
used for aggregating many files, such as numbers, page totals, grand totals, and
Java class files, images, and other files current date and time.
into one file.
O
J2EE (Java 2 Platform, Enterprise
Edition) An environment for object (1) An item that can be placed on
a ble
the layout. The following are examples f e r
developing and deploying enterprise
an s
of objects: rectangle, line, ellipse, arc,
applications in Java consisting of a set of
n - t r
polygon, polyline, rounded rectangle,
services, application programming
interfaces, and protocols that provide for a no
freehand, graph, text, symbol, and text
developing multitiered, Web-based a s
field. (2) In an Oracle database, an
h
applications. m ) eฺ
instance of an object type. An object can
o
ilฺc Guid
be a row in an object table, or the portion
a
JDBC (Java Database Connectivity)An g m ent
of a row contained in a column object in
industry standard for database and
i t 3 1@ Stud
a relational table.
arn use
call-level API for SQL-based database
browsing and editing interface that
access. m o
R (ku se t enables you to locate and manipulate
A
JSP (JavaServer e n An extension
Page)
c
application objects quickly and easily.
theM
to U li
servlet functionality that enables a Features include:
K
IT simple programmatic interface to Web · A hierarchy represented by
V N pages. JSPs are HTML pages with indentation and expandable nodes.
NA special tags and embedded Java code The top-level nodes show module
that is executed on the Web or types, database objects, and built-in
application server providing dynamic packages, enabling tasks such as
functionality to HTML pages. JSPs are creating, editing, renaming, and
actually compiled into servlets when deleting objects.
first requested and run in the server's · A find field and icons, enabling
JVM. forward and backward searches for
any level of node or for an individual
L item in a node
layout The area of an editor in which
you can create, modify, position, or
delete objects.
PL/SQL Oracle's proprietary extension REP file A file that contains a single
to the SQL language. Adds procedural report definition in binary format. .REP
and other constructs to SQL that make it files are used solely to run reports; you
suitable for writing applications. cannot edit a .REP file.
kumse to
Q Reports executable that provides a
(
R SELECT command line interface to send a
query AA SQL n statement that
e want to retrieve report to a remote Reports Server.
U M the datalicyou
specifies
N IT K
from one or more tables or views of a Report Editor The Reports Builder
V database. window that provides different views to
NA help you handle the data objects and
R layout objects for Web and paper
RDF file A file that contains a single reports. The views are: Data Model
report definition in binary format. RDF view, Paper Layout view, Paper Design
files are used to both run and edit view, Paper Parameter Form view, and
reports. Web source view.
reports jobs that are managed by the typically to access a database or perform
Reports Server. e-commerce processing. Servlets provide
an alternative to CGI (Common
Reports Runtime (rwrun) An Oracle Gateway Interface) scripts. Because they
Reports executable that runs a report are written in Java, servlets are portable
using the OracleAS Reports Services in- between servers and operating systems.
process server. The Reports Servlet and JSP are
components of OracleAS Reports
Reports Server (rwserver) An Oracle Services that process custom (JSP)
Reports executable that enables running report tags and deliver information
reports on a remote server. A component between the Oracle HTTP Server and the
of OracleAS Reports Services that Reports Server.
processes client requests, including user
a ble
authentication, scheduling, caching, and SQL A standard interface for storing f e r
report distribution. Use rwclient to ans
and retrieving information in a relational
send a report to the Reports Server. n
database. SQL is an acronym for - t r
Structured Query Language.
a no
Reports Servlet (rwservlet) An Oracle a s
SQL file A file that contains a query
h
Reports executable that translates and ) eฺ
stored in text (e.g., ASCII or EBCDIC)
m
o
delivers information between either a
ilฺc Guid
format.
a
Web Server or a J2EE Container for
example, OC4J, and the Reports Server, @g SQL
m escriptn t A file containing SQL
enabling you to run a report dynamically
i t 3 ud that you can run to perform
1 Ststatements
from your Web browser. avn t h is database administration quickly and
m arn use easily. Several SQL scripts are shipped
row One set of field
( k u et
values inoa table; for with Oracle products.
example, the
A c ns table EMP.
Rfieldserepresenting one
U M
employee in thel iexample SQL statement A SQL instruction to
a ble
f e r
ans
n - t r
o
s an
) ha
c o m ideฺ
m ailฺ t Gu
@ g den
n i t31 is Stu
r n av e th
u m a
t o us
R (k se
M A licen
K U
N I T
V
NA
Unauthorized reproduction or distribution prohibited. Copyright© 2010, Oracle and/or its affiliates.