Professional Documents
Culture Documents
40031GC11
Production 1.1
June 2001
D32797
Author Copyright Oracle Corporation, 2000, 2001. All rights reserved.
Andrey Ivkin This material or any portion of it may not be copied in any form or by any means
without the express prior written permission of Oracle Corporation. Any other
Sarah Jones copying is a violation of copyright law and may result in civil and/or criminal
penalties.
Paul Narth
If this documentation is delivered to a U.S. Government Agency not within the
Martin Pamplin Department of Defense, then it is delivered with “Restricted Rights,” as defined in
FAR 52.227-14, Rights in Data-General, including Alternate III (June 1987).
Frank Rovitto The information in this document is subject to change without notice. If you find
Raza Siddiqui any problems in the documentation, please report them in writing to Education
Products, Oracle Corporation, 500 Oracle Parkway, Box SB-6, Redwood Shores,
Hiroyuki Sugiyama CA 94065. Oracle Corporation does not warrant that this document is error-free.
Oracle is a registered trademark and all references to Oracle and Oracle products
Publisher are trademarks or registered trademarks of Oracle Corporation.
Shane Mattimoe All other products or company names are used for identification purposes only
and may be trademarks of their respective owners.
Contents
.....................................................................................................................................................
Contents
Preface
Profile xvii
Related Publications xviii
Typographic Conventions xix
Introduction
Course Objectives I-3
Course Content I-5
.....................................................................................................................................................
Oracle iDS Reports: Build Internet Reports iii
Contents
.....................................................................................................................................................
.....................................................................................................................................................
iv Oracle iDS Reports: Build Internet Reports
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle iDS Reports: Build Internet Reports v
Contents
.....................................................................................................................................................
.....................................................................................................................................................
vi Oracle iDS Reports: Build Internet Reports
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle iDS Reports: Build Internet Reports vii
Contents
.....................................................................................................................................................
.....................................................................................................................................................
viii Oracle iDS Reports: Build Internet Reports
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle iDS Reports: Build Internet Reports ix
Contents
.....................................................................................................................................................
Appendix A: Solutions
Practice Session Overview: Lesson 1 A-2
Practice Session Solutions: Lesson 1 A-3
Practice Session Overview: Lesson 2 A-7
Practice Session Solutions: Lesson 2 A-8
Practice Session Overview: Lesson 3 A-12
Practice Session Solutions: Lesson 3 A-13
Practice Session Overview: Lesson 4 A-15
Practice Session Solutions: Lesson 4 A-16
Practice Session Overview: Lesson 5 A-21
Practice Session Solutions: Lesson 5 A-22
Practice Session Overview: Lesson 6 A-26
Practice Session Solutions: Lesson 6 A-27
Practice Session Overview: Lesson 7 A-30
.....................................................................................................................................................
x Oracle iDS Reports: Build Internet Reports
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle iDS Reports: Build Internet Reports xi
Contents
.....................................................................................................................................................
.....................................................................................................................................................
xii Oracle iDS Reports: Build Internet Reports
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle iDS Reports: Build Internet Reports xiii
Contents
.....................................................................................................................................................
.....................................................................................................................................................
xiv Oracle iDS Reports: Build Internet Reports
................................
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
Objectives
......................................................................................................................................................
15-2 Oracle iDS Reports: Build Internet Reports
Overview
.....................................................................................................................................................
Overview
Introduction
Matrix or cross product reports show cells of information that relate to values
appearing across the top and down the left side of the report.
In an earlier lesson, you created a matrix report using the Report Wizard. In this
lesson, you modify the Data Model and layout objects to enhance your matrix reports.
Objectives
After completing this lesson, you should be able to do the following:
• Design a matrix Data Model
• Design a matrix Layout Model
• Modify a matrix structure
• Create additional matrix summaries
• Create a matrix with group report
• Create a nested matrix report
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-3
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
2
4
......................................................................................................................................................
15-4 Oracle iDS Reports: Build Internet Reports
The Matrix Data Model
.....................................................................................................................................................
Simple Matrix Style The wizard creates three basic data groups:
• One row of record values (Department)
• One column of record values (Job Title)
• One group of cells, where each cell contains data related to each row and column
combination.
There is an extra group that surrounds the row and column groups. It is called the cross
product group and contains the summary column that forms each cell value,
SumSalary, as well as the summaries to total the row and column values.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-5
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
1 2 3
......................................................................................................................................................
15-6 Oracle iDS Reports: Build Internet Reports
The Matrix Layout Model
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-7
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
1 2
3
®
......................................................................................................................................................
15-8 Oracle iDS Reports: Build Internet Reports
Creating Matrix Summaries
.....................................................................................................................................................
The Reset At option has the same effect as in other report styles. When you create
summaries with the wizard, each summary resets for each occurrence of the group. For
example, the department summary resets for each department. If you want the
summary values to accumulate throughout the report, change Reset At to a higher
level, such as Report.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-9
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
......................................................................................................................................................
15-10 Oracle iDS Reports: Build Internet Reports
Creating the Simple Matrix Report Manually
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-11
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
1
4
5
1 2 3 4
......................................................................................................................................................
15-12 Oracle iDS Reports: Build Internet Reports
Building a Matrix with Group Report
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-13
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
......................................................................................................................................................
15-14 Oracle iDS Reports: Build Internet Reports
Building a Nested Matrix
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-15
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
......................................................................................................................................................
15-16 Oracle iDS Reports: Build Internet Reports
Building a Nested Matrix
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-17
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
F_SumSALARY F_SumSALPerDEPT
F_Sum_REG_NAME
F_SumSALPerTITLE
......................................................................................................................................................
15-18 Oracle iDS Reports: Build Internet Reports
Building a Nested Matrix
.....................................................................................................................................................
The diagram also shows a fourth summary, F_Sum_REG_NAME, which you might
want to create yourself to produce a subtotal for each region.
1 Create another summary in the cross product group.
2 Create a layout field and place it as shown in the diagram, in the
R_G_REG_NAME repeating frame (use the Object Navigator to identify it). The
following table shows the property settings.
Field Name Reset At Product Order
F_Sum_REG_NAME G_REG_NAME G_REG_NAME
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-19
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
Displaying Zeros
......................................................................................................................................................
15-20 Oracle iDS Reports: Build Internet Reports
Building a Nested Matrix
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-21
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
Summary
......................................................................................................................................................
15-22 Oracle iDS Reports: Build Internet Reports
Summary
.....................................................................................................................................................
Summary
Letting the Wizard and Template Work for You
Use the wizard to create your matrix, even if you need to modify it later. Allowing the
wizard to create the initial Layout Model saves you a lot of time.
If you make many modifications to your wizard reports, consider creating or
modifying a template to include object spacing horizontally and vertically, between
frames, fields, and so on. This helps you to select and manipulate the objects in the
Layout Model.
Note: You can override the default template properties for the Matrix and Matrix with
Group sections of an existing template.
Matrix Structure
The Data Model and Layout Model of a matrix report contain special features, and
relationships between objects, to reflect the cross product structure of the report.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-23
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
Practice 15 Overview
......................................................................................................................................................
15-24 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 15
.....................................................................................................................................................
Introduction
In this practice session, you use an existing matrix report to investigate the different
methods of displaying the cell values and the implications. You use an existing
external query to create a nested matrix report. You then add row- and column-level
summaries to the report and display zeros for null values.
If you have time, include the product names instead of the product IDs and rotate the
names.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-25
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
......................................................................................................................................................
15-26 Oracle iDS Reports: Build Internet Reports
Practice Session: Lesson 15
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 15-27
Lesson 15: Enhancing Matrix Reports
.....................................................................................................................................................
......................................................................................................................................................
15-28 Oracle iDS Reports: Build Internet Reports
................................
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Objectives
......................................................................................................................................................
16-2 Oracle iDS Reports: Build Internet Reports
Overview
.....................................................................................................................................................
Overview
Introduction
This lesson identifies different trigger types and creates conditional trigger code to
control report output. It also explains how to improve productivity and maintenance by
sharing and reusing commonly referenced code.
Objectives
After completing this lesson, you should be able to do the following:
• Describe the different types of triggers
• Describe sample uses of the different types of triggers
• Write and reference common code
• Create and reference a PL/SQL library
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-3
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
• Report:
– Five triggers
– Report Triggers node in Object Navigator
• Data Model:
– Formula (column)
– Filter (group)
– Parameter validation
• Layout:
Format trigger on most objects
Trigger Code
Parameter
Boolean:
true
boolean false
Column
Character
Number
Number
Date
......................................................................................................................................................
16-4 Oracle iDS Reports: Build Internet Reports
Types of Triggers in Reports
.....................................................................................................................................................
Trigger Code
When you create a trigger such as a report trigger or a PL/SQL formula, the Program
Unit editor supplies a template for the function block, giving the basic syntax that you
require.
You can change the name of the function.
The value that you return must match the return data type in the function declaration.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-5
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Before
Parameter F
Form
1 2 If readonly=yes 3
F
If > 1 page
After Between After
Before page1 page2
Parameter Pages Report
Report
Form
F F
......................................................................................................................................................
16-6 Oracle iDS Reports: Build Internet Reports
Using Report Triggers
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-7
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
• Query syntax:
SELECT
SELECT ID,
ID, NAME
NAME
FROM
FROM CUSTOMER
CUSTOMER
&p_where_clause
ORDER
ORDER BY
BY NAME
NAME
®
......................................................................................................................................................
16-8 Oracle iDS Reports: Build Internet Reports
Using Report Triggers
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-9
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
• Group Filter
– Restrict records in a group
– Perform PL/SQL for each record
FUNCTION G_empGroupFilter RETURN BOOLEAN IS
BEGIN
IF :name = ’Operations’ AND :salary > 3000 THEN
RETURN(my_function);
ELSE
RETURN(TRUE);
END IF;
END;
......................................................................................................................................................
16-10 Oracle iDS Reports: Build Internet Reports
Using Data Model Triggers
.....................................................................................................................................................
Example
Use a group filter that calls a function for some records in the G_emp group,
depending on the department in the master group.
1 Open the property palette for the G_emp group.
2 Change Group Filter to PL/SQL.
The PL/SQL Filter property appears.
3 Select the PL/SQL Filter property to open the PL/SQL editor.
4 Enter the code. This filter code must return a boolean value of true or false.
Note: It is more efficient to use a WHERE clause in a query when possible. You
cannot use a WHERE clause in this case, because you want to process all records and
call the function for some.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-11
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Parameter Validation
• Example: Do not allow report output to be sent
directly to a printer
FUNCTION DESTYPEValidTrigger RETURN BOOLEAN IS
BEGIN
IF :DESTYPE = ’Printer’ THEN
RETURN(FALSE);
ELSE
RETURN(TRUE);
END IF;
END;
......................................................................................................................................................
16-12 Oracle iDS Reports: Build Internet Reports
Using Data Model Triggers
.....................................................................................................................................................
Example To prevent report output from being sent directly to a printer, test the value
of the DESTYPE system parameter.
1 Open the property palette for the DESTYPE parameter.
2 Select Validation Trigger to open the PL/SQL editor.
3 Enter the code and make sure that the value Printer has an initial capital.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-13
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Format triggers:
• Exist on most layout objects
• Can suppress an entire layout section (master
group frame): No records fetched
• Can suppress the display of individual records
(repeating frame): All records fetched
......................................................................................................................................................
16-14 Oracle iDS Reports: Build Internet Reports
Using Layout Model Triggers
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-15
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Dept: 10
Dept: f_deptno
Name Salary
Name Salary
No employees in
1 this department
Dept: 40
No employees in
this department
......................................................................................................................................................
16-16 Oracle iDS Reports: Build Internet Reports
Using Layout Model Triggers
.....................................................................................................................................................
Example
1 Create a summary column, :count_emp, in the master group that counts the
number of employee records (reset = master group).
2 Create a piece of boilerplate text, “No employees in this department”.
3 Position the text behind the column heading frame.
4 Code a format trigger on the column heading:
function hide_headings return boolean is
begin
if :count_emp = 0 then
return(false);
else
return(true);
end if;
end;
5 Either code the reverse logic in the format trigger of the boilerplate text item
created in step 2 or ensure that the column heading frame has a solid fill.
Note: You should code format triggers at the highest possible level of the layout
hierarchy. The format trigger on the column headings frame suppresses all objects
enclosed by the frame. Do not duplicate code unnecessarily by coding the same trigger
on all individual objects in the frame; this can cause increased processing and
maintenance overheads.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-17
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Employee Details
Employee Details
Ngao 08-MAR-90 2500
f_name f_date f_salary Biri 07-APR-91 1100
Magee Employee 1000
14-MAY-90 Details
f_name f_date
Ngao 08-MAR-90
Biri 07-APR-91
2 Magee 14-MAY-90
1 3
......................................................................................................................................................
16-18 Oracle iDS Reports: Build Internet Reports
Using Layout Model Triggers
.....................................................................................................................................................
Example
1 In the layout, create two repeating frames sourced by the same group. One
repeating frame must contain a salary field, the other must not.
Note: You can create two separate default layouts and modify the layout as
required.
2 Place one repeating frame behind the other.
3 Add a format trigger to suppress the top repeating frame (the one that contains the
salary field), or alternatively use conditional formatting:
function pay_clerks_see_this return boolean is
begin
if :user_type = ’PAY_CLERK’ then
return(true);
else
return(false);
end if;
end;
Note: User_type can be a column or parameter that is initialized at run time.
4 Either code the reverse logic on the other repeating frame or ensure that the top
repeating frame (containing salary) has a solid fill.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-19
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Employee Details
Employee Details
Ngao 08-MAR-90 2500 1
f_name f_date f_salary
Biri 07-APR-91 1100
Magee Employee 1000
14-MAY-90 Details
Ngao 08-MAR-90
Biri 07-APR-91
Magee14-MAY-90
2
®
......................................................................................................................................................
16-20 Oracle iDS Reports: Build Internet Reports
Using Layout Model Triggers
.....................................................................................................................................................
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 iDS Reports: Build Internet Reports 16-21
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
1 2
3 4
FUNCTION
FUNCTION spacing
spacing RETURN
RETURN BOOLEAN
BOOLEAN IS
IS
BEGIN
BEGIN
IF
IF MOD(:count_column,
MOD(:count_column, 3)
3) == 00 THEN
THEN
RETURN(TRUE);
RETURN(TRUE);
ELSE
ELSE
RETURN(FALSE);
RETURN(FALSE);
END
END IF;
IF;
END;
END;
®
......................................................................................................................................................
16-22 Oracle iDS Reports: Build Internet Reports
Using Layout Model Triggers
.....................................................................................................................................................
Example
1 Create a transparent rectangle inside the repeating frame to increase spacing
conditionally at run time.
2 In the repeating frame property palette, set Vertical Elasticity to Variable.
3 In the Data Model, create a summary column named COUNT_COLUMN that
counts the number of records retrieved (Reset=Report).
4 On the rectangle, create a format trigger that references the summary column, as
shown on the opposite page.
Note: You can vary the number of records in each group dynamically at run time by
creating a parameter.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-23
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
At Report level:
• Object Navigator, Program Units
• Menu: Program—>PL/SQL Editor
In a library:
• Object Navigator, PL/SQL Library
• File—>New: Create new library
• File—>Open: Add to existing library
• Attach library to report
......................................................................................................................................................
16-24 Oracle iDS Reports: Build Internet Reports
Writing Common Code
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-25
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Summary
Trigger types:
Report, Data Model, Layout
Examples:
• Building a dynamic WHERE clause
• Validating a parameter value
• Dynamically altering record display
• Suppressing null fields
Common code:
• Report-level program units
• PL/SQL libraries
®
......................................................................................................................................................
16-26 Oracle iDS Reports: Build Internet Reports
Summary
.....................................................................................................................................................
Summary
Using PL/SQL Triggers
Select the most applicable type of trigger for your requirement.
Report-level triggers fire once for each of the five events during the report execution.
Data Model triggers can affect which records are processed and how they are
processed.
Layout triggers affect the way in which objects are formatted.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-27
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
Practice 16 Overview
......................................................................................................................................................
16-28 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 16
.....................................................................................................................................................
Introduction
In this practice session, you create a format trigger, or use conditional formatting to
display one of two layouts for the same data, depending on a parameter value at run
time. You also conditionally flag some records in a report by creating and referencing
a report-level (local) PL/SQL function. You then move the code into a new PL/SQL
library and alter the reference to use the library function instead.
If you have time, restrict the number of records processed in a report by creating your
own group filter.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-29
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
c Create a Tabular layout using the following columns from the query:
Column
ID
DATE_ORDERED
DATE_SHIPPED
TOTAL
d Make sure that only the Group Above layout is displayed when you Select a
destination of Screen, and only the Tabular layout is displayed when you select
a destination of Preview.
To test the result, display the DESTYPE parameter in the report.
Make sure that you can enter a parameter value at run time.
Hint: As an alternative to coding format triggers, you can also use conditional
formatting.
e Save the report as p16q1.rdf.
......................................................................................................................................................
16-30 Oracle iDS Reports: Build Internet Reports
Practice Session: Lesson 16
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 16-31
Lesson 16: Coding PL/SQL Triggers in Reports
.....................................................................................................................................................
......................................................................................................................................................
16-32 Oracle iDS Reports: Build Internet Reports
................................
Lesson 17: Building a Web Report
.....................................................................................................................................................
Objectives
......................................................................................................................................................
17-2 Oracle iDS Reports: Build Internet Reports
Overview
.....................................................................................................................................................
Overview
Introduction
The Web has become the quickest and easiest way to provide information within
business organizations. In this lesson, you take a report and give it a complete
makeover to turn it into a rich Web report.
Objectives
After completing this lesson, you should be able to do the following:
• Name output formats and features used in Web reports
• Differentiate between static and dynamic Web reporting
• Enhance a report for the Web
• Publish a report on the Web
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-3
Lesson 17: Building a Web Report
.....................................................................................................................................................
•• HTML
HTML
•• PDF
PDF
•• HTMLCSS
HTMLCSS
•• Page
Page Streaming
• XML
®
®
......................................................................................................................................................
17-4 Oracle iDS Reports: Build Internet Reports
High-Quality Web Publishing
.....................................................................................................................................................
HTML Output
Without knowing anything about HTML tags, you can easily create HTML output
from your report. Simply select the HTML output format at run time and it will be
generated for you. You can also customize your HTML code by using Report Escapes
and Web Settings properties.
PDF Output
Oracle Reports has a PDF generator built into it. Simply select PDF output at run time.
As with HTML, PDF files have the capability to launch other applications. One key
usage of this feature is to drill down to another dynamically generated document.
XML Output
XML produces tag-delimited output that defines structured information. It may be
used for exchanging electronic data as well as for publishing via the Web.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-5
Lesson 17: Building a Web Report
.....................................................................................................................................................
• Bookmarks
• Hyperlinks
• Chart Hyperlinks
• Images as URLs
• JavaScript
• Java applet
......................................................................................................................................................
17-6 Oracle iDS Reports: Build Internet Reports
High-Quality Web Publishing
.....................................................................................................................................................
Bookmarks
Bookmarks provide a hyperlinked table of contents that enable you to easily navigate
to specific parts of the report that pertain to them. They are of the most useful
navigational tools for HTML and PDF output formats. Bookmarks defined in Report
Builder can incorporate data from the database (for example, column values) as well
as static text. The Web Wizard automatically generates bookmarks for you. You can
also manually specify them for any layout object in your report.
Hyperlinks
Like bookmarks, hyperlinks allow you to quickly jump to related information. You
can use them to drill down to more detailed information or call drill-down reports.
Hyperlinks can incorporate data from the database as well as static text. You can
define hyperlinks and hyperlink targets for any layout object in your report.
Chart Hyperlinks
Chart hyperlinks enable you to click a chart value in HTML or PDF output formats to
access more detailed information about that value, or drill down to another report with
that value.
Images as URLs
You can reference image resources as URLs for HTML output. You can define
boilerplate link file objects, columns, and fields as references to image URLs. The
images are displayed when you format a report for HTML output.
JavaScript
JavaScript is a powerful browser scripting language. It is common to find Web pages
with some sort of JavaScript embedded in the page to perform conditional logic or
event trapping.
Java Applets
Java applets are platform-independent programs written in the Java language. They
can be dynamically imported into Web pages or applications as needed. They also
differ from JavaScript in that they can be entire fully funtional applications.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-7
Lesson 17: Building a Web Report
.....................................................................................................................................................
Web Scenarios
• Web Wizard
• Static
• Dynamic
......................................................................................................................................................
17-8 Oracle iDS Reports: Build Internet Reports
Report Builder Web Scenarios
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-9
Lesson 17: Building a Web Report
.....................................................................................................................................................
"".
......................................................................................................................................................
17-10 Oracle iDS Reports: Build Internet Reports
Publishing Web Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-11
Lesson 17: Building a Web Report
.....................................................................................................................................................
• URL as a hyperlink
<A
<A HREF="http://vesuvius_serv/your-cgi-bin/
HREF="http://vesuvius_serv/your-cgi-bin/
rwcgi60.exe?key1>
rwcgi60.exe?key1>
My_report>
My_report> </A>
</A>
......................................................................................................................................................
17-12 Oracle iDS Reports: Build Internet Reports
Publishing Web Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-13
Lesson 17: Building a Web Report
.....................................................................................................................................................
• Adding bookmarks
• Adding animated GIFs (GIF89a)
• Drilling down between Web reports
• Adding chart hyperlink
• Customizing Page-on-Demand
• Adding JavaScript
• Adding Java applets
......................................................................................................................................................
17-14 Oracle iDS Reports: Build Internet Reports
Enhancing Reports for the Web
.....................................................................................................................................................
The Scenario
You will build a Group Above report that shows order information for each customer,
and then add the following Web features to it:
• Bookmarks
• Drill-down to a detail item report
• Chart hyperlink
• Page streaming
• HTML header
• HTML page separator
• Animated GIF
• Hyperlinks and hyperlink destinations
• JavaScript
• Java applet
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-15
Lesson 17: Building a Web Report
.....................................................................................................................................................
Bookmarks
Animated GIFs
......................................................................................................................................................
17-16 Oracle iDS Reports: Build Internet Reports
Enhancing Reports for the Web
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-17
Lesson 17: Building a Web Report
.....................................................................................................................................................
Drill-Down Reporting
• Use parameters in
detail report query
• In master report,
hyperlink to detail
and pass parameter
......................................................................................................................................................
17-18 Oracle iDS Reports: Build Internet Reports
Enhancing Reports for the Web
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-19
Lesson 17: Building a Web Report
.....................................................................................................................................................
HTML Header
<html>
<head>
<title>
A simple HTML example
</head>
</title
<body>
...
</body>
</html>
......................................................................................................................................................
17-20 Oracle iDS Reports: Build Internet Reports
Enhancing Reports for the Web
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-21
Lesson 17: Building a Web Report
.....................................................................................................................................................
Page Streaming
• Customizable
......................................................................................................................................................
17-22 Oracle iDS Reports: Build Internet Reports
Enhancing Reports for the Web
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-23
Lesson 17: Building a Web Report
.....................................................................................................................................................
JavaScript
javascript:showmyalert(’have
javascript:showmyalert(’have aa nice
nice day’)
day’)
......................................................................................................................................................
17-24 Oracle iDS Reports: Build Internet Reports
Enhancing Reports for the Web
.....................................................................................................................................................
Adding JavaScript
JavaScript is a powerful browser-side scripting language that you can use for things
such as conditional logic, event trapping, and so on. You will use JavaScript to display
an alert.
First you need to write the JavaScript code and embed it in the Web page.
Traditionally this is embedded at the top of the page. You do this by means of the
Before Report Value report property and set it to:
<HTML>
<HEAD>
<SCRIPT LANGUAGE = "JavaScript">
function showmyalert(themessage)
{alert(themessage);}
</SCRIPT>
</HEAD>
<body dir=&Direction bgcolor="ffffff">
When you run the report this code will be at the top of the report. It calls the JavaScript
function "alert," which pops up a dialog box with user defined text. You call the
JavaScript code from a hyperlink on the customer name field as listed below:
javascript:showmyalert(’Credit Rating: $&<credit_rating>’)
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-25
Lesson 17: Building a Web Report
.....................................................................................................................................................
Java Applet
......................................................................................................................................................
17-26 Oracle iDS Reports: Build Internet Reports
Enhancing Reports for the Web
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-27
Lesson 17: Building a Web Report
.....................................................................................................................................................
......................................................................................................................................................
17-28 Oracle iDS Reports: Build Internet Reports
Enhancing Reports for the Web
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-29
Lesson 17: Building a Web Report
.....................................................................................................................................................
Summary
......................................................................................................................................................
17-30 Oracle iDS Reports: Build Internet Reports
Summary
.....................................................................................................................................................
Summary
• Web report features
– Style sheet support
– HTML page streaming
– Hyperlinks
– Bookmarks
– JavaScript
– Java applets
• Static versus Dynamic Web reporting
• Key map file
• Publishing a report
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-31
Lesson 17: Building a Web Report
.....................................................................................................................................................
Practice 17 Overview
......................................................................................................................................................
17-32 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 17
.....................................................................................................................................................
Introduction
If you use the Web Wizard and change some properties, you can easily prepare a
report for the Web. You will open an existing report and add: bookmarks, hyperlinks,
pagestreaming, animated gifs, and JavaScript.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 17-33
Lesson 17: Building a Web Report
.....................................................................................................................................................
......................................................................................................................................................
17-34 Oracle iDS Reports: Build Internet Reports
................................
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Objectives
......................................................................................................................................................
18-2 Oracle iDS Reports: Build Internet Reports
Overview
.....................................................................................................................................................
Overview
Introduction
This lesson provides examples of the contents and use of the Report Builder built-in
package. The package contains program units that you can reference in your
PL/SQL code.
Objectives
After completing this lesson, you should be able to do the following:
• Describe the contents of the Report Builder built-in package
• Output messages at run time
• Execute a drill-down report
• Create and populate temporary tables within a report
• Modify visual attributes dynamically at run time
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-3
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
SRW.SET_BOOKMARK SRW.DO_SQL
SRW.SET_ATTR SRW.RUN_REPORT
SRW.REFERENCE SRW.MESSAGE
SRW.USER_EXIT SRW.TRACE
SRW.SET_MAXROW SRW.PROGRAM_ABORT
......................................................................................................................................................
18-4 Oracle iDS Reports: Build Internet Reports
Contents of the Report Builder Built-in Package
.....................................................................................................................................................
Rules
• You can only call the contents of the SRW package from within Report Builder.
Other tools, such as Form Builder, do not recognize this package.
• You must always reference an SRW procedure, function, or exception by
preceding it with the package name, SRW; for example, SRW.MESSAGE or
SRW.DO_SQL.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-5
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Outputting Messages
Warning
WHEN
WHEN <exception>
<exception> THEN
THEN
SRW.MESSAGE(999,
SRW.MESSAGE(999,
’Warning:
’Warning: report
report continues
continues’);
’);
Error
WHEN
WHEN <exception>
<exception> THEN
THEN
SRW.MESSAGE(999,
SRW.MESSAGE(999,
’Error:
’Error: report
report terminated
terminated’);
’);
RAISE SRW.PROGRAM_ABORT;
Exceptions
SRW.INTEGER_ERROR
SRW.INTEGER_ERROR
SRW.NULL_ARGUMENTS
SRW.NULL_ARGUMENTS
®
......................................................................................................................................................
18-6 Oracle iDS Reports: Build Internet Reports
Outputting Messages
.....................................................................................................................................................
Outputting Messages
Introduction
The SRW.MESSAGE packaged procedure displays a message with a code and text
string, which you specify. The message is displayed in the following format:
MSG-code: text
The message is displayed in a small dialog box. The user must acknowledge the
message before continuing.
Is It a Warning or an Error?
SRW.MESSAGE does not implicitly terminate the report execution. You can choose to
issue a warning message that enables the report to continue execution after the user
accepts the message.
To force the report to terminate after outputting the message, raise the exception
SRW.PROGRAM_ABORT.
Note: You cannot suppress or replace the default message that Report Builder gives if
you abort a report. Your own error message augments the existing messages.
Causes of Exceptions
Exception Name Cause
SRW.INTEGER_ERROR You entered a code that is not a numeric integer.
SRW.NULL_ARGUMENTS You omitted the code number or text message or
both.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-7
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Executing a Report
1 BLOGGS.LIS 2
xxx xxxxxxx
BLOGGS xxx xxxxxxx
SMITH
SMITH.LIS
JONES
yyy yyyyyyy
yyy yyyyyyy
JONES.LIS
zzz zzzzzzz
zzz zzzzzzz
SRW.RUN_REPORT
......................................................................................................................................................
18-8 Oracle iDS Reports: Build Internet Reports
Executing a Nested Report
.....................................................................................................................................................
Example
Run a report called MANAGERS that retrieves the employee record for each manager.
Call the EMPS report (for example, from a group filter). EMPS retrieves the employee
records of all employees managed by the current manager only.
Sample code to implement this example appears on the following page.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-9
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Executing a Report
Example
SRW.RUN_REPORT
(’Report=EMPS
DESTYPE=FILE
DESNAME=’||:LAST_NAME||’.LIS
BATCH=YES
MGRNO=’||TO_CHAR(:ID));
Exceptions
SRW.RUN_REPORT_FAILURE
SRW.RUN_REPORT_FAILURE
SRW.RUN_REPORT_BATCHNO
SRW.RUN_REPORT_BATCHNO
Function
SRW.GETERR_RUN
SRW.GETERR_RUN
®
......................................................................................................................................................
18-10 Oracle iDS Reports: Build Internet Reports
Executing a Nested Report
.....................................................................................................................................................
Note: Use LAST_NAME to create the output filename for each manager; use ID to
restrict the EMPS query.
Causes of Exceptions
Report Builder raises a specific exception that applies to the SRW.RUN_REPORT
procedure in two cases:
Exception Name Causes
SRW.RUN_REPORT_FAILURE Detail report does not exist.
Detail report failed during execution.
SRW.RUN_REPORT_BATCHNO BATCH parameter is used inconsistently:
master report running with BATCH=YES,
called a detail report with BATCH=NO
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-11
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
1 2
41 Details 42
xxxxxxxxx
xxxxxxxxx
42 Details xxxxxxxxx
SRW.RUN_REPORT xxxxxxxxx
43 Details
......................................................................................................................................................
18-12 Oracle iDS Reports: Build Internet Reports
Executing a Nested Report
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-13
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Restricting Data
Q_EMP
ID LAST_NAME
1 BLOGGS
G_EMP
2 SMITH
3 JONES
ID
LAST_NAME
......................................................................................................................................................
18-14 Oracle iDS Reports: Build Internet Reports
Restricting Data
.....................................................................................................................................................
Restricting Data
Introduction
Use SRW.SET_MAXROW to restrict the maximum number of records you want to
retrieve for a specified query. Report 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 Report Builder from retrieving any
records from the database.
Example
Below is a function to display data for the Q_emp query only if a value of one or more
is entered in a run-time parameter called HOW_MANY:
FUNCTION FETCHIT RETURN BOOLEAN IS
BEGIN
IF :HOW_MANY >= 1 THEN
SRW.SET_MAXROW (’Q_emp’, :how_many);
ELSE
SRW.SET_MAXROW(’Q_emp’, 0);
END IF;
RETURN(TRUE);
EXCEPTION
WHEN SRW.MAXROW_UNSET THEN
SRW.MESSAGE (100,
’Data was fetched before SRW.MAXROW was called’);
RAISE SRW.PROGRAM_ABORT;
WHEN SRW.MAXROW_INERR THEN
SRW.MESSAGE(200, ’Contact someone clever!’);
RAISE SRW.PROGRAM_ABORT;
END;
You must set SRW.SET_MAXROW in the Before Report trigger; that is, after the
query has been parsed but before it has been executed. If you call it after the Before
Report trigger, Report Builder raises the SRW.MAXROW_UNSET exception.
If you handle SRW.MAXROW_INERR, always raise SRW.PROGRAM_ABORT,
because your report has an internal problem and you cannot guarantee the outcome.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-15
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Initializing Fields
FUNCTION
FUNCTION F_LOGICAL_PAGEFormatTrigger
F_LOGICAL_PAGEFormatTrigger
RETURN
RETURN BOOLEAN
BOOLEAN IS
IS
my_page
my_page number;
number;
BEGIN
BEGIN
SRW.GET_PAGE_NUM(my_page);
SRW.GET_PAGE_NUM(my_page); 2
SRW.SET_FIELD_NUM(0,my_page+3);
SRW.SET_FIELD_NUM(0,my_page+3);
RETURN(TRUE);
RETURN(TRUE);
END;
END;
®
......................................................................................................................................................
18-16 Oracle iDS Reports: Build Internet Reports
Initializing Fields
.....................................................................................................................................................
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-95’)
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;
Report Builder ignores the code and does not raise an error.
Example Create a function to display the logical page number plus three in a field
called F_NEWPAGE.
Because the logical page number variable is available only in the report layout, not in
the Data Model, you cannot calculate the value in a data column. Therefore, you use a
layout field to get the current page number and output a new number by initializing the
same field.
Make use of a packaged procedure called SRW.GET_PAGE_NUM to retrieve the
current logical page number into a local PL/SQL variable, as in the format trigger code
opposite.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-17
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Example
SRW.DO_SQL(’CREATE TABLE SRW_LOG
(RPT_NAME VARCHAR2(40),
REC_NUM NUMBER,
MSG_TEXT VARCHAR2(80))’ );
Exception
SRW.DO_SQL_FAILURE
SRW.DO_SQL_FAILURE
®
......................................................................................................................................................
18-18 Oracle iDS Reports: Build Internet Reports
Performing DDL Statements
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-19
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Borderwidth
Tuesday, 01 Sep
Fill pattern
Format mask
......................................................................................................................................................
18-20 Oracle iDS Reports: Build Internet Reports
Setting Format Attributes
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-21
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Visual attributes
SRW.SET_FILL_PATTERN(
SRW.SET_FILL_PATTERN(’solid
’solid’);
’);
SRW.SET_BORDER_WIDTH(250);
SRW.SET_BORDER_WIDTH(250);
SRW.SET_FORMAT_MASK(’Day,
SRW.SET_FORMAT_MASK( ’Day, Month
Month yyyy
yyyy’);
’);
Defining a bookmark
SRW.SET_BOOKMARK(
SRW.SET_BOOKMARK(’Car
’Car Policy
Policy’);
’);
®
......................................................................................................................................................
18-22 Oracle iDS Reports: Build Internet Reports
Setting Format Attributes
.....................................................................................................................................................
’Example
Conditionally set the following attributes if salary equals 2000:
Attribute Value
Background fill color Dark yellow
Fill pattern Sandpaper
Font style Italic
Font face Helvetica
Font weight Extra bold
Text color Dark blue
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-23
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Summary
Package contents:
• Procedures
• Functions
• Exceptions:
• SRW.PROGRAM_ABORT to exit
Examples:
• Drill-down report
• Support for DDL statements
• Conditional layout formatting and display
......................................................................................................................................................
18-24 Oracle iDS Reports: Build Internet Reports
Summary
.....................................................................................................................................................
Summary
• The SRW package contains procedures, functions, and exceptions.
Remember that you can raise the exception SRW.PROGRAM_ABORT in your
PL/SQL code to stop report processing at any time.
• The SRW package provides a number of features, including:
– Drill-down reports, using SRW.RUN_REPORT in a button
– Support for DDL statements, using SRW.DO_SQL, to enable you to create or
drop temporary tables from PL/SQL code in a report
– Conditional formatting and display using SRW.SET_<attributes>
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-25
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
Practice 18 Overview
......................................................................................................................................................
18-26 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 18
.....................................................................................................................................................
Introduction
In this practice session, you highlight values based on conditional PL/SQL code.
You build a master report that enables you to call a separate report from a button in the
previewer.
If you have time, you add report-level triggers to an existing report to write messages
to a temporary table at various stages of report execution.
Write PL/SQL functions as local PL/SQL (report-level), and reference the code in a
condition within the relevant object trigger in the report.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-27
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
......................................................................................................................................................
18-28 Oracle iDS Reports: Build Internet Reports
Practice Session: Lesson 18
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 18-29
Lesson 18: Using the Report Builder Built-In Package
.....................................................................................................................................................
......................................................................................................................................................
18-30 Oracle iDS Reports: Build Internet Reports
................................
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
Objectives
......................................................................................................................................................
19-2 Oracle iDS Reports: Build Internet Reports
Overview
.....................................................................................................................................................
Overview
Introduction
It is possible to build a report definition using XML tags. This XML report definition
can be run by itself or can be applied to another report at run time to customize the
output for a specific audience.
Objectives
After completing this lesson, you should be able to do the following:
• Describe the benefits of using XML report definitions
• Create XML report definitions
• Apply XML report definitions to an existing report
• Debug XML report definitions
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-3
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
......................................................................................................................................................
19-4 Oracle iDS Reports: Build Internet Reports
Why Use XML Report Definitions?
.....................................................................................................................................................
Run-Time Customizations
You can apply customizations to change the look and feel of a report at run time
without changing the original report. This allows for a report to be different for
different audiences. For example, labels can be designed according to geography, or
colors and format masks can be designed on a per user or user group basis.
Furthermore, you can add objects to a report’s Data Model.
Batch Updates
Using an XML report definition, you can apply batch updates to existing reports. You
have the option of saving the combined definition to a file. The advantage is that you
can quickly update a large number of reports without having to open each file in the
Report Builder to make the changes.
Product Openness
XML support in Oracle Reports provides a mechanism for exchanging data with third-
party applications. It also offers a way to furnish data to tools that accept XML output
for data analysis, and XML is easily displayed on the Web.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-5
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
<report>
<report>
• XML tags
<data>
<data> • Partial definition
.. .. .. • Full definition
</data>
</data>
<layout>
<layout>
.. .. ..
</layout>
</layout>
</report>
</report>
......................................................................................................................................................
19-6 Oracle iDS Reports: Build Internet Reports
Creating and Using XML Report Definitions
.....................................................................................................................................................
Example
The following is a sample of a partial report definition:
<report name="employee" DTDVersion="1.0">
<layout>
<section name="main">
<field name="f_sal" source="sal" textColor="red"/>
<field name="f_mgr" source="mgr" fontSize="14"
font="Roman"/>
<field name="f_deptno" source="deptno" fontStyle="bold"
fontEffect="undereline"/>
</section>
</layout>
</report>
Every XML report definition, whether full or partial, must contain the required
<report> </report> tag. It indicates the beginning and end of the report and contains
the name and the version number of the Document Type Definition file that is being
used. A full report requires both a Data Model and Layout Model and therefore
requires the <data></data> and <layout></layout> tags and their contents.
The report name attribute in the <report> tag can be different than the name of the
.rdf file. The name attributes in the <field> and <section> tags match the names of
the fields and sections. As a result, the attributes will be applied to the fields and
sections listed.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-7
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
<report>
<report>
• Empty <data> tag
<data>
<data> • Use of <layout>
</data>
</data> • Use of <field>
<layout>
<layout>
<section>
<section>
<field
<field .../>
.../>
...
...
</section>
</section>
</layout>
</layout>
</report>
</report>
......................................................................................................................................................
19-8 Oracle iDS Reports: Build Internet Reports
Creating and Using XML Report Definitions
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-9
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
<report>
<report>
• Empty <data> tag
<layout>
<layout> • Use of <exception>
<section>
<section> • Use of <condition>
<field
<field ...>
...>
<exception>
<exception>
<condition
<condition .../>
.../>
</exception>
</exception>
</field>
</field>
</section>
</section>
</layout>
</layout>
</report>
</report>
......................................................................................................................................................
19-10 Oracle iDS Reports: Build Internet Reports
Creating and Using XML Report Definitions
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-11
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
......................................................................................................................................................
19-12 Oracle iDS Reports: Build Internet Reports
Creating and Using XML Report Definitions
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-13
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
......................................................................................................................................................
19-14 Oracle iDS Reports: Build Internet Reports
Creating and Using XML Report Definitions
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-15
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
......................................................................................................................................................
19-16 Oracle iDS Reports: Build Internet Reports
Running XML Report Definitions
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-17
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
• Run by itself
• Batch updates
RWCON60
RWCON60 source="(...)"
source="(...)"
dest=...
dest=... customize=...
customize=...
batch=yes
batch=yes
......................................................................................................................................................
19-18 Oracle iDS Reports: Build Internet Reports
Running XML Report Definitions
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-19
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
• XML parser
• Tracing option
• Using Report Builder
......................................................................................................................................................
19-20 Oracle iDS Reports: Build Internet Reports
Debugging XML Report Definitions
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-21
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
Summary
......................................................................................................................................................
19-22 Oracle iDS Reports: Build Internet Reports
Summary
.....................................................................................................................................................
Summary
• Using XML report definitions:
– Run-time customizations
– Batch updates
– Stand-alone reports
• Applying XML report definitions:
– From the command line
– From PL/SQL
• Debugging XML report definitions:
– The XML parser
– The trace option
– Using Report Builder
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-23
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
Practice 19 Overview
......................................................................................................................................................
19-24 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 19
.....................................................................................................................................................
Introduction
Using XML you can build fully functional reports or partial reports that can serve as a
customization file.
You will run an XML file, apply an XML definition to an existing report, and debug an
XML report definition.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 19-25
Lesson 19: Customizing Reports at Run Time
.....................................................................................................................................................
......................................................................................................................................................
19-26 Oracle iDS Reports: Build Internet Reports
................................
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Objectives
......................................................................................................................................................
20-2 Oracle iDS Reports: Build Internet Reports
Overview
.....................................................................................................................................................
Overview
Introduction
In this lesson, you learn how to make report requests to use, control, and monitor
remote Reports Services, and how to view and schedule reports sent from a client to
Reports Services.
Objectives
After completing this lesson, you should be able to do the following:
• Distinguish between local client and remote services reporting
• Describe the architecture used to run reports on the Web
• Describe how a report is processed on the Web
• Differentiate the different methods of invoking a report
• View and schedule server-side reports using the Queue Manager
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-3
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Client reporting:
• All processing and formatting is
done on the client
• Suitable for small and medium
size reports
• Everyone runs the same report
again and again; no sharing
DB
Benefits of Reports
Services (RWMTS60):
• Web support
• Formats, prints reports
on a powerful server RWMTS60
• Eliminates rerunning
reports RWRUN60 RWRUN60 RWRUN60
• Enhances scalability
and performance DB DB
......................................................................................................................................................
20-4 Oracle iDS Reports: Build Internet Reports
Why Use Remote Services?
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-5
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
......................................................................................................................................................
20-6 Oracle iDS Reports: Build Internet Reports
Why Use Remote Services?
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-7
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Web server
Reports CGI
or Servlet
Reports Server
Runtime Engine
Thin client tier Database tier
Oracle9i Application
Server
®
Introduction
Oracle Reports Services can be configured in a number of ways depending on your
requirements. This section explains the Reports Services architecture and discusses the
commands to invoke a report on the remote server.
Web Architecture
When used in a Web environment, the Reports Services architecture consists of
multiple tiers:
• The thin client tier
• The Web server tier
• The Reports Services tier
• The database tier
The range of possible configurations runs from having all of these tiers on one and the
same machine to having each of the tiers on a separate machine.The most common
configurations typically have the tiers spread across three or four machines. The
diagram on the opposite page shows the multi tier concept with the Web server and the
Reports Services tiers on the same machine.
......................................................................................................................................................
20-8 Oracle iDS Reports: Build Internet Reports
Reports Services Web Architecture and Configuration
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-9
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Web Processing
HTTP
Server Reports Services
Web Reports server
Listener
Reports
Web CGI
Instance of of
Instance
Runtime
Instance
Runtime of
Reports Engine
Runtime
Engine
Servlet Engine
Database
Browser
Report Output
......................................................................................................................................................
20-10 Oracle iDS Reports: Build Internet Reports
Reports Services Web Architecture and Configuration
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-11
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Multitiered
Multitiered Server
Server
Engine Engine
Engine
Engine
Engine Engine
Multitiered
Engine Server
Engine
Engine Engine
Engine
Engine
Multitiered
Server
Engine Engine
Engine
Engine
......................................................................................................................................................
20-12 Oracle iDS Reports: Build Internet Reports
Reports Services Clustering
.....................................................................................................................................................
Optimizing Resources
The master server performs duplicate job and tolerance checks before a job is
allocated. If it receives a duplicate request within a defined time period, the job is
serviced from the cache rather than by reexecuting it.
Running a Report
In a Reports Services cluster, you run a report by specifying
server=master_name in the command line for the client executable. The master
server then assigns incoming jobs to the engines on the slave servers.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-13
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
URL syntax
http://vesuvius_serv/our-cgi-bin/rwcgi60.exe?
report=emp_dept.rdf+desformat=html+destype=cache+
server=repsrv60+dept_param=10
Key mapCGI
Reports file Key map file : cgicmd.dat
• Reports Web CGI: cgicmd.dat
• Reports Web Cartridge: owscmd.dat
......................................................................................................................................................
20-14 Oracle iDS Reports: Build Internet Reports
Making a Request to Run a Report
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-15
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
s
• SERVER = <master_server>
• MODULE|REPORT = <runfile>
• DESTYPE = FILE, PRINTER, MAIL, CACHE,
LOCALFILE, SYSOUT
• DESNAME = <desname>
• DESFORMAT = PDF, DFLT, HTML, HTMLCSS, RTF,
DELIMITED
RWCLI60.EXE
RWCLI60.EXE SERVER=masterserver
SERVER=masterserver MODULE=my_rep.rdf
MODULE=my_rep.rdf
DESTYPE=FILE
DESTYPE=FILE DESNAME=my_rep.pdf
DESNAME=my_rep.pdf DESFORMAT=pdf
DESFORMAT=pdf
......................................................................................................................................................
20-16 Oracle iDS Reports: Build Internet Reports
Making a Request to Run a Report
.....................................................................................................................................................
Example
1 Invoke the command line. In Windows NT, Select Start—>Run.
2 Enter the command string, for example:
RWCLI60.EXE SERVER=masterserver REPORT=my_rep.rdf DESTYPE=FILE
This command sends the report to the remote master server, and the report runs
immediately.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-17
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
RWCLI60...
SCHEDULE=monthly_last_weekday_from_17:00_Oct_23,_1999_
retry_3_after_1_hour
TIME
......................................................................................................................................................
20-18 Oracle iDS Reports: Build Internet Reports
Making a Request to Run a Report
.....................................................................................................................................................
Syntax
The full syntax of the SCHEDULE parameter is:, [SCHEDULE=] string,
where the string is, [FREQ from] TIME [retry {n} + after LEN]
FREQ = hourly|daily|weekly|monthly|{every LEN|DAYREPEAT}|{last
{WEEKDAYS| weekday | weekend} before {n}+}
TIME = CLOCK [DATE] [INCR]
CLOCK = <hh:mm>
DATE=<calendar date>
INCR = {+LEN} | {next SUFFIX}
LEN = {n} * SUFFIX
SUFFIX = <time, date, FREQ>
Example
SCHEDULE=hourly_from_09:00am_May_01,_1999
SCHEDULE=last_weekday_from_17:00_Oct_23,_1999_retry_3_after_1_hour
Note: This syntax is necessary only if you want to control your report jobs from the
command line. You can also specify the scheduled time and frequency of a report
when you define a new job in the easy-to-use Queue Manager screen, which you use
later in this course.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-19
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Reports Caching
......................................................................................................................................................
20-20 Oracle iDS Reports: Build Internet Reports
Making a Request to Run a Report
.....................................................................................................................................................
Reports Caching
Include the TOLERANCE parameter in your command line to cache the report output
for a specified number of minutes.
Setting TOLERANCE=60 means that Reports Services can detect a duplicate report
request from the same userid and return the existing cached output to the client
without rerunning the report if the existing report output is 60 minutes old or less.
Setting TOLERANCE=0 forces the report to rerun for each request. This is the default
behavior.
Cached Output
Reports Services uses a parameter CACHEDIR to determine where to place the
cached output.
The default directory is <oracle_home>\report60\server\cache.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-21
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
......................................................................................................................................................
20-22 Oracle iDS Reports: Build Internet Reports
Making a Request to Run a Report
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-23
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Configuring a Clustered
Reports Services: Example
clusterconfig=" (server=nt-2
minengine=0
maxengine=2
initengine=2
cachedir="H:\Cache")
(server=sun-1
minengine=0
maxengine=2
initengine=2
cachedir="/share/Cache") "
......................................................................................................................................................
20-24 Oracle iDS Reports: Build Internet Reports
Making a Request to Run a Report
.....................................................................................................................................................
Technical Note
Reports Services requires Oracle Net8. When installing Oracle9i Application Server,
the Installer knows this is a dependency and installs it if necessary.
Reports supports the following protocols: Named Pipes, and TCP/IP.
If you have a sqlnet.ora file with a default domain, you must make sure that you
specify the domain in your tnsnames.ora file when entering the server name; for
example, my_server.world=(). Alternatively, if you do not use your
sqlnet.ora file, remove or rename it.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-25
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
......................................................................................................................................................
20-26 Oracle iDS Reports: Build Internet Reports
Viewing and Scheduling Reports in the Queue Manager
.....................................................................................................................................................
Administrator Privilege
In the <servername>.ora file, the first line gives an encrypted password,
IDENTIFIER=.
You can set this password the first time that you start the Reports Services. At the
login prompt, select any username and password to assign as Administrator.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-27
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Queue Manager
Past jobs
Current jobs
Scheduled jobs
Queue Manager
All my jobs
All jobs
Refresh
......................................................................................................................................................
20-28 Oracle iDS Reports: Build Internet Reports
Viewing and Scheduling Reports in the Queue Manager
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-29
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
RSVR1
Queue
Manager
RSVR2
......................................................................................................................................................
20-30 Oracle iDS Reports: Build Internet Reports
Viewing and Scheduling Reports in the Queue Manager
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-31
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
......................................................................................................................................................
20-32 Oracle iDS Reports: Build Internet Reports
Viewing and Scheduling Reports in the Queue Manager
.....................................................................................................................................................
Remote or Local Remote Reporting The ActiveX control can run a report by a
synchronous or an asynchronous call to the remote Reports Services; it can also run a
report by calling the Reports Background Engine.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-33
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Summary
......................................................................................................................................................
20-34 Oracle iDS Reports: Build Internet Reports
Summary
.....................................................................................................................................................
Summary
The remote Reports Services provides increased efficiency, scalability, and distributed
capabilities for large reports, and uses a multitier architecture.
The Queue Manager provides an easy-to-use GUI for viewing and scheduling report
jobs.
By caching report output, you can ensure that users do not rerun common reports
unnecessarily.
You can embed the Reports Services ActiveX control in other Windows applications
to run and schedule reports.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-35
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
Practice 20 Overview
......................................................................................................................................................
20-36 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 20
.....................................................................................................................................................
Introduction
In this practice session, you run a report locally and then on a remote server, using the
Queue Manager. You also use the Queue Manager to view the submitted jobs.
If you have time, you can submit a report to a remote server using the command line
options.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 20-37
Lesson 20: Maximizing Performance Using Reports Services
.....................................................................................................................................................
......................................................................................................................................................
20-38 Oracle iDS Reports: Build Internet Reports
................................
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
Objectives
......................................................................................................................................................
21-2 Oracle iDS Reports: Build Internet Reports
Overview
.....................................................................................................................................................
Overview
Introduction
A report does not run in a vacuum. It is dependent on the underlying hardware,
software, and network connection. Because of this complex interrelationship,
performance is always an issue. This lesson focuses on performance in the run-time
environment and gives you a number of performance tips. You should also realize that
Report applications are portable across multiple platforms and multiple languages.
You can reduce cross-platform development effort by planning for platform-specific
features or restrictions. In this lesson, you also learn how to build reports to run on
various platforms, and in different environments and languages.
Objectives
After completing this lesson, you should be able to do the following:
• Describe the various areas to investigate to improve performance
• Use the performance measuring tools
• Describe the considerations when building reports for different graphical user
interfaces (GUIs)
• Describe the facilities available for building reports to run in other languages
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-3
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
Tuning Reports
• No absolute rules
• Investigate specific areas:
– Data Model
– Layout Model
– Run-time arguments
– Query and application partitioning
......................................................................................................................................................
21-4 Oracle iDS Reports: Build Internet Reports
Tuning Oracle Reports
.....................................................................................................................................................
The Reports Profile option When you set this option, Oracle Reports produces a
log file that shows where processing time is spent. To set the Profile option, use the
PROFILE=<log_file> command line argument with RWRUN60, or from the main
menu select Tools—>Preferences, Runtime Settings. Typical profile output is shown
below:
Reports Profiler Statistics
TOTAL ELAPSED Time: 29.00 seconds
Reports Time: 24.00 seconds (82.75% of TOTAL)
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-5
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
Performance Measurement
• Measurement tools:
– Profile option
– Trace option
• Server and network Measurements
– SQL Trace
– Traffic and bandwidth
......................................................................................................................................................
21-6 Oracle iDS Reports: Build Internet Reports
Tuning Oracle Reports
.....................................................................................................................................................
The Reports Trace Option The Reports Trace option produces a file that describes
the series of steps completed during the execution of the report. You have the option to
log all events or only a subset of events such as SQL execution or breakpoints. The
trace file can provide very useful information for performance evaluation, and also
tells you what executed when.
To set the Trace option, use the TRACEFILE=<trace_file> command line argument
when running the report, or from the main menu select Tools—> Trace.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-7
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
......................................................................................................................................................
21-8 Oracle iDS Reports: Build Internet Reports
Tuning Oracle Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-9
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
......................................................................................................................................................
21-10 Oracle iDS Reports: Build Internet Reports
Tuning Oracle Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-11
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
• Frames
• Object size
• Format triggers
• Fetching ahead
• Sectioning and distribution
......................................................................................................................................................
21-12 Oracle iDS Reports: Build Internet Reports
Tuning Oracle Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-13
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
• RUNDEBUG=NO
• Array processing
• LONGCHUNK
• PARAMFORM
• Batch processing
......................................................................................................................................................
21-14 Oracle iDS Reports: Build Internet Reports
Tuning Oracle Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-15
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
• Query partitioning
• Move wait time forward
• Share work between components
......................................................................................................................................................
21-16 Oracle iDS Reports: Build Internet Reports
Tuning Oracle Reports
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-17
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
......................................................................................................................................................
21-18 Oracle iDS Reports: Build Internet Reports
Different Development and Run-Time Environments
.....................................................................................................................................................
Bitmapped Environment
This environment has a unit of pixel and typically supports a mouse. Interaction with
the host computer is continuous.
The bitmapped Designer allows you, as a developer, to take advantage of the graphical
user interface.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-19
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
......................................................................................................................................................
21-20 Oracle iDS Reports: Build Internet Reports
Developing Reports to Run in Different GUIs
.....................................................................................................................................................
Example
In the uifont.ali file on Microsoft Windows, map Motif and Mac fonts to Microsoft
Windows:
/* Motif fonts */
lucidatypewriter= "Courier New"
lucidabright= "Times New Roman"
fixed = "Courier New"
/* Mac fonts */
"Avant Garde"= "Arial"
"New York"= "Times New Roman"
In the uifont.ali file on UNIX (motif), map Microsoft Windows fonts to Motif:
/* Microsoft Windows fonts */
"Courier New" = lucidatypewriter
"Times New Roman"= lucidabright
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-21
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
• NLS_LANG
• DEVELOPER_NLS_LANG, USER_NLS_LANG
NLS_LANG=French_France.WE8DEC
NLS_LANG=French_France.WE8DEC
• Unicode
NLS_LANG=<lang>_<territory>.AL24UTFFSS
NLS_LANG=<lang>_<territory>.AL24UTFFSS
......................................................................................................................................................
21-22 Oracle iDS Reports: Build Internet Reports
Building Reports to Run in Different Languages
.....................................................................................................................................................
Example NLS_LANG=French_France.WE8DEC
Syntax
NLS_LANG = <language>_<territory>.AL24UTFFSS
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-23
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
Translating an Application
......................................................................................................................................................
21-24 Oracle iDS Reports: Build Internet Reports
Building Reports to Run in Different Languages
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-25
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
Summary
......................................................................................................................................................
21-26 Oracle iDS Reports: Build Internet Reports
Building Reports to Run in Different Languages
.....................................................................................................................................................
Practice 21 Overview
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-27
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
Introduction
Report performance is always an issue. Report Builder offers a few tools that allow
you to measure preformance. In this practice you will use them and interpret the
results.
......................................................................................................................................................
21-28 Oracle iDS Reports: Build Internet Reports
Practice Session: Lesson 21
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports 21-29
Lesson 21: Building Reports: Efficiency Guidelines
.....................................................................................................................................................
......................................................................................................................................................
21-30 Oracle iDS Reports: Build Internet Reports
................................
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-2 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 1
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-3
Appendix A: Solutions
.....................................................................................................................................................
Close the Help system and leave the Preferences dialog box.
......................................................................................................................................................
A-4 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 1
.....................................................................................................................................................
11 Use Help Topics to discover more about the functionality of Oracle Developer
Report Builder:
Select Help—>Report Builder Help Topics from the menu.
a What is MAPI?
Use the index to look for MAPI. Select MAPI, about.
MAPI is the Microsoft Messaging Application Program Interface used to
send reports to an e-mail system.
b What are the prerequisites for sending a report as an e-mail attachment?
You must have an appropriate MAPI mail client.
c The report is sent as what type of attachment format?
Bitmapped reports are sent as PostScript files, character mode reports as
ASCII text.
d What is delimited output?
Delimited output enables you to specify a delimiter to separate the data in
your report. Using this feature you can create report output that is easily
imported into spreadsheets.
12 Use Help on Manuals to answer the following questions in the Oracle Information
Navigator:
Note: In the Information Navigator, select Tools—>Preferences to initialize your
Web browser. Your instructor will tell you which browser to use.
Select Help—>Manuals from the menu.
a List three of the top-level folder names for the online manuals.
Release Notes, Getting Started, Publishing Reports
b In the Publishing Reports Manual, what is the purpose of the RWCLI60
command and what is the maximum length of the logon definition?
Expand the node Oracle Developer 6i Online Manuals: Publishing
Reports.
Select Appendix A: RWCLI60 Command Line Arguments
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-5
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-6 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 2
.....................................................................................................................................................
Introduction
Before you learn to develop reports in the Builder, you should investigate the run-
time executable that you use constantly in the production environment and for
testing your reports prior to production.
This practice session consists of a combination of practical and paper-based
questions.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-7
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-8 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 2
.....................................................................................................................................................
To split the Previewer vertically: Select the small gray area at the left of
the horizontal scroll bar at the bottom of the window. Press the left mouse
button down and drag the gray area. As you do this, you see that a thick
dotted line is dragged right across the Previewer. Depress the left mouse
button when you have reached the desired split point. Now you have two
windows, which work independently from each other.
d Close the Previewer window. You are now back in the Runtime window.
In the Previewer click Close Previewer.
4 Open your browser and run report p2q4.
From the desktop double-click the browser. Provide the URL to run p2q4.
a What style of report is this?
It is a Master/Detail report.
b How many groups of data are in this report?
There are two groups of data.
c How many pages are there in this report?
There are three pages.
d Close the browser.
In the browser, click Close.
5 From the Runtime window, run report p2q5.rep
From the menu select File—>Run. The File Browse window opens. Select
p2q5.rep and select Open.
a What style of report is this?
It is a Matrix report.
b How many groups of data are in this report?
There are four groups of data:
Year
Department
Job Title
Salary
There actually is an additional, invisible “cross product” group around
Year, Department, and Job; this special group defines the matrix
structure and is explained in the lesson on matrix reports.
c Close the Previewer window. You are now back in the Runtime window.
In the Previewer click Close Previewer.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-9
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-10 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 2
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-11
Appendix A: Solutions
.....................................................................................................................................................
Introduction
The questions in the practice session provide an introduction to the Report Builder
interface. You open and navigate through an existing report definition and use the
Help system to obtain information about some of the Report executables.
......................................................................................................................................................
A-12 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 3
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-13
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-14 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 4
.....................................................................................................................................................
Introduction
The questions in the practice session are intended to ensure that you have a good
understanding of how to create various styles of reports using the Report Wizard.
Note: When you are completing the practice sessions, keep to the filenaming
conventions that the questions specify. You might need these files in later practices.
In addition, note the field headings and widths. With many reports, you need to
change these to achieve the desired result.
Many of the practice sessions ask you to rename files beforehand; be sure to use
Save As, not Save, so that you do not overwrite the existing file name.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-15
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-16 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 4
.....................................................................................................................................................
3 Using the reentrant wizard, modify the report to create a break report.
Select the report style Group Above.
Select the report style on the Style tab.
Group the report by the department name.
On the Groups tab copy NAME to the Group Fields area.
Select the template called Bright 1.
Select the template on the Template tab. Click Finish to close the Wizard.
Save the report as p4q3.rdf.
Select File—>Save As from the menu and save the file to disk.
4 Create a new report containing the following data:
a Use the Report Wizard.
b Select the Mailing Labels style.
c Use Query Builder to build the query.
Create a new report by selecting the Report node in the Object Navigator
and choosing Create Object.
As an alternative you can also select File—>New—>Report from the
menu.
Select Mailing Label style. For the query type, accept the default selection
of SQL statement.
Select Query Builder.
In the Select Data Tables highlight the S_CUSTOMER and S_ORD
tables, choose Include, and close the dialog box.
In the Query Builder window select the necessary columns from the tables
and click OK.
S_CUSTOMER: NAME, ADDRESS, CITY, STATE
S_ORD: ID, DATE_SHIPPED, TOTAL
d In the text area, include all four customer fields, each field on a new line.
Copy NAME, CITY, ADDRESS, and STATE to the Mailing Label Text
area. To enter the line feeds you can either use the button or simply press
the [Return] key.
e Select the Draft template and click Finish.
Select the template on the next page.
f Save the report to a file named p4q4.rdf.
Select File—>Save As from the menu and save the file to disk.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-17
Appendix A: Solutions
.....................................................................................................................................................
5 Using the reentrant wizard, modify the report to create a Form Letter style.
Reenter the Report wizard by choosing Report Wizard from the toolbar or
selecting Tools—>Report Wizard from the menu.
On the Style tab select Form Letter.
a In the text area, enter some free-flowing text for each order. For example:
Order No. &<ID> was shipped to &<NAME> in &<CITY> on
&<DATE_SHIPPED>.
b The order has a total value of &<TOTAL> dollars.
c Add the following text: Thank you for your business.
Copy the fields that you want to use to the Form Letter Text area and
enter your free-flowing text.
d Select a different template and click Finish.
e Save the report as p4q5.rdf.
Select File—>Save As from the menu and save the file to disk.
6 Create a new report.
Use Query Builder to build the query.
Create a new report by selecting the Report node in the Object Navigator and
choosing Create Object.
As an alternative you can also select File—>New—>Report from the menu.
a Select the matrix report style.
On the first page choose Matrix.
b For the query, import the contents of p4q6.sql.
Choose Import SQL Query and select p4q6.sql from the Import dialog
box.
c Display customer names down the left side of the page.
Copy NAME to the Matrix Row Fields area.
d Display product numbers across the top of the page.
Copy PRODUCT_ID to the Matrix Column Fields area.
e Display the total value in the cells.
Select Sum to copy the sum of TOTAL_VALUE to the Matrix Cell Fields
area.
f Create a summary to give the total of the sum(total_value) values.
Select Sum(TOTAL_VALUE) and choose Sum.
g Reduce the widths of PRODUCT_ID to 5 and all four summaries to 7.
h Change the PRODUCT_ID label to Product.
Make the necessary changes in the Labels and Width fields.
......................................................................................................................................................
A-18 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 4
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-19
Appendix A: Solutions
.....................................................................................................................................................
Go back to the Live Previewer window and undo this change by selecting
f
Edit—>Undo. What happens next?
Select Edit—>Undo. The report reappears in the browser and reflects the
change.
g Close the browser.
Close the browser.
h Switch off Web preview mode.
Select Web Preview from the Toolbar.
9 Web-enable a report by using the Web Wizard.
a Using the same report as in the previous exercise, invoke the Web Wizard and
click Next on the welcome page.
Select the Web Wizard from the Toolbar. Select Next in the Welcome
screen.
b In the Web Wizard, select Name from the available columns list to serve as
bookmarks.
Copy the Name field from the Available Columns to the Bookmarks.
Select Next on the wizard page.
c Add p4_9.html as a Header HTML File.
Select Browse for the Header HTML file. In the file Open dialog box select
p4_9.html and Select Open.
Select Next on the wizard page.
d Generate HTML Style Sheet output and view the result.
Select Generate HTML Style Sheet output now. Select Generate output to
a Web browser.
e In the Save File dialog box, save the file as p4q9.html.
In the Save file dialog box change the filename to p4q9.html and select
Save.
f What happens when you click on the bookmarks?
The cursor jumps to that specific part in the report.
g What happens when you click the Oracle logo in the header?
The report invokes the Oracle Website.
h Close the browser and save the report as p4q9.rdf.
Close the browser. Select File—>Save as and change the filename to
p4q9.rdf. Select Save.
i Back in Report Builder, save and close all reports.
For each open report, select File—>Save from the menu or Choose Save
from the Toolbar. Then Select File—>Close.
......................................................................................................................................................
A-20 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 5
.....................................................................................................................................................
Introduction
In this practice session, you will reuse some of the reports that you created in the last
session.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-21
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-22 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 5
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-23
Appendix A: Solutions
.....................................................................................................................................................
3 Open report p5q3_a.rdf. Make the following changes in the Live Previewer:
To open the file select File—>Open from the menu or select Open from the
toolbar.
Run the report by selecting it in the Object Navigator and then selecting
Program—>Run Report from the menu or selecting Run from the toolbar.
a Add a date at the top center of the page. Give it any format you want.
Hint: Choose the font, style, and text color you want before inserting the date.
Select Insert Date and Time from the top toolbar or
Insert—>Date and Time from the menu.
b Make whatever other changes you like.
No formal solution.
c Save the report to a file named p5q3.rdf and close it.
4 Open report p4q6.rdf. Make the following changes in the Live Previewer:
To open the file select File—>Open from the menu or select Open from the
toolbar.
Run the report by selecting it in the Object Navigator and then selecting
Program—>Run Report from the menu or selecting Run from the toolbar.
a Right-justify the Product ID field.
Select the Product ID field, then select End Justify from the style bar or
select Format—>Justify—>End from the menu.
b Remove the border around the cell values and the parent frame.
Select the column, hold down the [Shift] key, and choose Select Parent
Frame from the style bar. Then hold down the [Shift] key and select the
column again. Select Line Color from the vertical toolbar. Select No Line
to remove the line color from both the column and the parent frame.
c Add commas and two decimal places to the cells and summaries and make
them right-justified.
Select the columns and choose End Justify from the style bar or select
Format—>Justify—>End from the menu.
While the columns are selected choose Commas and then Add Decimal
Place from the style bar. You can also select the options from the Format
menu.
d Add a gray line color to the parent frames of NAME and PRODUCT ID.
Select the column NAME and choose Select Parent Frame from the style
bar. Select Line Color from the vertical toolbar.
Repeat for the column PRODUCT.
e Save the report to a file named p5q4.rdf and close it.
......................................................................................................................................................
A-24 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 5
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-25
Appendix A: Solutions
.....................................................................................................................................................
Introduction
In this practice session, you open an existing template, which is one of the standard
templates shipped with the Oracle Developer Release 6 installation.
You modify objects in the margin and body regions and save the template to a new
filename. Then you apply the modified template to an existing report and note the
differences.
......................................................................................................................................................
A-26 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 6
.....................................................................................................................................................
e Display the body region to view the changes you will make in the next steps.
Click the Margin/Body toggle button from the toolbar in the Template
editor.
f Change the foreground color (fill color) of the section frame to white. Make
these changes general, not specific to a particular layout.
Select any of the objects and use the Select Parent Frame tool multiple
times to select the outermost frame.
Use the Fill Color palette or the property palette to change the color.
Alternative solution:
In the Object Navigator expand the Body node, the Default node, and the
Frames node. Open the property palette for the section frame.
Under the heading Style, change the Foreground Color property to White.
g Change the justification of numeric fields (number field and summary) to End.
Do not forget to change the justification of labels for number fields to End.
Select the number field and the number heading in the Template editor
and click the End justify tool from the stylebar.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-27
Appendix A: Solutions
.....................................................................................................................................................
Alterative solution:
Open the Field Labels/Headings and the Fields nodes in the Object
Navigator. Select Number in both nodes.
Open the property palette for your selections.
Click Union (the button is a toggle and the tooltip says Intersection at this
point) from the property palette toolbar to display all properties. Under
the headings Label and Fields, change the number justification to End.
Change the justification of number summary fields to End.
Select Summaries in the Object Navigator.
In the property palette change the number justifications for fields to End.
h Save the template as summit.tdf.
2 Apply the modified template to an existing report.
Hint: you must search for the template file; it does not appear in the list of
predefined templates.
Open p4q3.rdf.
a
b Apply summit.tdf to the report.
Invoke the Report Wizard. On the Template tab select the option
Template File. Click Browse to enter the name of the file in the field
below.
c The report shows some changes but not all. Which template changes have been
applied and which have not?
Changes applied: Logo, report title, color of section frame region
Changes not applied: Number justification
d To apply all changes to your report, you will have to create the layout again.
From the menu, select Edit—>Select All to select all layout objects. Now
delete them. Invoke the Report Wizard and reapply your template.
e Save the report as p6q2.rdf.
3 Continue to modify the template and test it using a new report.
a Change the text color of the master group fields to red for the Group Left style
only.
Hint: In the Template editor, use the Report Style list to switch to a Group Left
style. This way you can select the correct group. You may also want to use the
Zoom Out tool so that you can see the entire template layout structure, and
recognize the difference between the master group fields and the detail group
fields.
Select the Character, Number, and Date fields and change the text color
with the Text color palette.
......................................................................................................................................................
A-28 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 6
.....................................................................................................................................................
Alternative solution:
In the Object Navigator, expand the Override node, then the Group Left,
the Section (Level1), and the Fields nodes.
Bring up the property palette for all the fields
Change the text color to red.
b Save your template as summit2.tdf and close it.
c Create a new report, using the Report Wizard.
Use the layout style Group Left.
Import the query p6q3.sql from your working directory.
Make NAME the group field.
Display all other columns.
Do not create summaries.
Change the width of SALARY to 6 and COMMISSION_PCT to 4.
Apply the Template file summit2.tdf.
No formal solution.
d Save the report as p6q3.rdf and close it.
4 Add Web links to a template.
a Open p6q4.rdf and run the report on the Web. Close your browser.
Use the Oracle Reports web report tester or provide the URL syntax in
your browser.
b In Report Builder open the template gray.tdf.
Select the Templates node in the Object Navigator. Select Open and select
the file named gray.tdf.
c Set the necessary properties so that the template contains the Web links in the
file temp_hdr.html. The links must appear at the beginning of the
document.
In the property palette, set the Before Report Type property to file, and
Before Report Value property to temp_hdr.html (use the browse button
to locate the file).
d Save and close the template.
e Apply the template gray.tdf to the report. Save the report.
Invoke the Report Wizard. On the Template tab select the option
Template File. Click Browse to enter the name of the file in the field below.
f Run the report on the Web. Try the Web links
Open your browser and provide the URL. The Web links take you to the
online book and music store amazon.com.
g Close the browser. Save the report.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-29
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-30 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 7
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-31
Appendix A: Solutions
.....................................................................................................................................................
3 Open the registry and investigate the setting for the REPORTS60_PATH key.
No formal solution.
......................................................................................................................................................
A-32 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 8
.....................................................................................................................................................
Introduction
In this practice session, you include new data in a report by adding a query to an
existing single-query report created with the wizard. You also practice linking data
from different queries to alter the report structure. Using two different techniques, you
restrict the records in a report. If you have time, you create an external query and link
it to a report.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-33
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-34 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 8
.....................................................................................................................................................
bRedo the layout by opening the Report Wizard. Select the Group Above style.
Do not display CUSTOMER_ID.
c Save the report as p8q3.rdf.
d Run the report on the Web.
4 Modify p8q3.rdf to show and restrict customers’ credit rating. You need to
modify the query properties.
a Include CREDIT_RATING in the query statement, although you do not need
to display it. Restrict the query statement to show those who have a poor credit
rating.
In the Data Model select the query Q_1. Press the right mouse button to
open the SQL Query Statement or open it from the property palette.
Either enter WHERE S_CUSTOMER.CREDIT_RATING = ’POOR’ directly
in the query statement area or use the Query Builder to build the WHERE
clause.
If you use the Query Builder, click in the blank condition field Conditions
panel to activate it. Then click the column CREDIT_RATING in the
S_CUSTOMER table. Enter = ’POOR’ and press [Return].
b Save the report as p8q4.rdf and run it on the Web.
5 Create a new report that lists the sales representatives and the products they have
sold.
a Select a Group Above report style.
b Import the query file p8q5_a.sql.
c Make NAME and ID the group fields. Make sure that these fields are in one
group, at Level 1, not two separate groups.
d Do not display ID, but display all other fields in the order described in the
following table.
Hint: You can change the order of fields in the Report Wizard in the Displayed
Fields text region.
e Change the following field attributes:
Column Label Width
NAME Name 20
PRODUCT Product 10
PRODUCT_ID ID 4
QUANTITY Quantity 4
PROD_TOTAL Total 6
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-35
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-36 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 8
.....................................................................................................................................................
, S_EMP.TITLE
, S_EMP.SALARY
FROM S_DEPT, S_EMP
WHERE S_EMP.DEPT_ID=S_DEPT.ID
cSave the query as p8q6.sql and close the query window.
7 Use the Report Wizard to create a Group Left report using the external query
created in question 6.
a Department information should be in the master group.
b Look at the Data Model. Notice that the break group exists.
c In the Data Model, move TITLE into a group at the top of the hierarchy.
Hint: Move it into the Department group first, and then up into its own new
group.
Click and drag TITLE to the Department group, then up again to make a
separate group.
Note: Because this is a single-query report, you can also make the group change
using the Report Wizard Group tab. However, you have learned that you can
combine many queries and groups in your own reports, and this simple exercise
helps you to practice moving columns in the Data Model.
d Open the Report Wizard and click Finish to update the layout and run the
report.
e Save the report as p8q7.rdf and close it.
f Run and test the report on the Web.
8 Create a new report using a ref cursor query.
a In the Object Navigator, create a client-side package defining a record and a ref
cursor. The record has the following fields:
Name Definition
last_name s_emp.last_name%type
first_name s_emp.first_name%type
salary s_emp.salary%type
Create a new report manually. Select the Program Units node in the
Object Navigator and click Create.
In the New Program Unit dialog box enter a name for the package and
choose Package Spec.
Enter the code for the package specification.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-37
Appendix A: Solutions
.....................................................................................................................................................
PACKAGE RefCur IS
TYPE EmpRec IS RECORD ( last_name s_emp.last_name%TYPE,
first_name s_emp.first_name%TYPE,
salary s_emp.salary%TYPE);
Type EmpCur IS REF CURSOR RETURN EmpRec;
END;
You can also import the text file p8q8a.txt. While the PL/SQL editor is active
and the cursor is in the text area, select File—>Import Text from the menu to
import the text file.
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 s_emp
Note: You can import the p8q8b.txt file.
Write the following function or import the text file p8q8b.txt:
FUNCTION QR_1RefCurDS RETURN RefCur.EmpCur IS
V_EmpCur RefCur.EmpCur;
BEGIN
OPEN V_EmpCur
FOR
SELECT last_name, first_name, salary
FROM s_emp;
RETURN V_EmpCur;
END;
cOpen the Report Wizard to create the layout for the report. Select all the fields and
choose a template.
d Run and test the report.
e Save the report as p8q8.rdf and close it.
If you still have any objects open in the Object Navigator, close them all.
......................................................................................................................................................
A-38 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 9
.....................................................................................................................................................
Introduction
In your reports, you may need to include additional columns with summary
functions—or even add summaries, such as break totals and report totals. This practice
gives you the opportunity to create summaries and additional columns with
functionality that cannot be achieved using SQL alone.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-39
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-40 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 9
.....................................................................................................................................................
Open the property palettes for each group and change the names.
Click on DATE_ORDERED and drag it above ID; be careful not to drag
it outside the group.
Open the property palette for DATE_ORDERED and change the Break
Order property to Descending.
f Run and test the report (do not reenter the wizard).
g Save the report as p9q1.rdf and close it.
2 Open report p8q5.rdf.
a Add a summary to total PROD_TOTAL for each employee master. Can you
use the Report Wizard?
Because this is a multiquery report, you have to create all summaries
manually unless you created them with the first query.
Select Summary Column in the vertical toolbar and click inside the group
G_NAME. This creates a new summary.
Open the property palette for the new column and name it REP_TOTAL.
In the Summary section select the function Sum.The Source is
PROD_TOTAL.
Reset at G_NAME.
b Create columns to show the percentage of the total per sales representative for
PROD_TOTAL and CUST_TOTAL.
Select Summary Column in the vertical toolbar and click inside the group
G_PRODUCT. This creates a new summary.
Open the property palette for the new column and name it PCT_PROD.
In the Summary section select the function % of Total.
The Source is PROD_TOTAL.
Reset at G_PRODUCT.
Compute at G_NAME.
Select Summary Column in the vertical toolbar and click inside the group
G_CUSTOMER. This creates a new summary.
Open the property palette for the new column and name it PCT_CUST.
In the Summary section select the function % of Total.
The Source is CUST_TOTAL.
Reset at G_CUSTOMER.
Compute at G_NAME.
c Make all the new summaries four characters wide.
d Save the report as p9q2.rdf and close it.
e Run the report on the Web.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-41
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-42 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 9
.....................................................................................................................................................
b Because you want to list the highest total first, set the break order for TOTAL
accordingly, and move the TOTAL column so that it is first in the G_ORD
group.
Set the break order for TOTAL to Descending. Click and drag TOTAL to
be the first column in the group G_ORD.
c To display the ranking add another column called RANK in the group G_ORD.
Create a summary column in the group G_ORD.
Name it Rank. Select the function Count.
The Source is ID.
Reset at Report.
d Use the Report Wizard to display the rank, giving it a width of 2. You do not
need to display the total, because there is already a total on the G_ITEM group.
e Run the report to test.
f Save the report as p9q4.rdf and close it.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-43
Appendix A: Solutions
.....................................................................................................................................................
a (continued)
Also at report level create two placeholder columns. Name them
CP_Maxid and CP_Minid. This is where the IDs of the highest and lowest
orders will go.
Create a formula column in the upper group and name it CF_GetIds.
Return number 1 (although it does not really matter what you return if
the formula column is a character type).
The PL/SQL formula is the following:
function CF_GetIdsFormula return Number is
begin
if :SumLine_TotalPerId = :CS_Max then
:CP_Maxid := :ID;
end if;
if :SumLine_TotalPerId = :CS_Min then
:CP_Minid := :Id;
end if;
return (1);
end;
b Use the Report Wizard to put the new columns into the layout. Display the
maximum order total, the maximum ID, the minimum order total, and the
minimum ID.
Display columns CS_Max, CS_Min, CP_Maxid, and CP_Minid. Give
them more meaningful labels.
c Run the report to test. Scroll down to the last page to see the new columns.
d Save the report as p9q5.rdf and close it.
......................................................................................................................................................
A-44 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 10
.....................................................................................................................................................
Introduction
In this practice session, you use reports created in earlier practice sessions. The aim is
to familiarize you with the different layout sections and regions of a report, and to use
report bursting. You also investigate the layout hieraarchy add flexible lines to a frame
and anchor one object to another.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-45
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-46 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 10
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-47
Appendix A: Solutions
.....................................................................................................................................................
Resize the repeating frame and all enclosing frames to be just large enough to
f
fit the fields inside.
Hint: Think of Flex Mode.
Enable Flex Mode and resize the repeating frame.
g Save the report as p10q2.rdf and close it.
h Run and test your report. Do not use the Live Previewer; use Reports Runtime.
i Select File—>Administration—>Convert to convert the .rdf file into a
.rep file. Now invoke the Reports Runtime and test your report.
3 Open report p9q1.rdf.
a Modify the report to add a header section that lists all order numbers, order
dates, and order totals in the body region
Open the Layout Model editor. Select Header Section from the horizontal
toolbar, or choose View —>Layout Section—>Header Section from the
menu. Make sure that you are editing the Body region.
Select the Additional Default layout tool from the vertical toolbar and
click in the Layout area. In the Report Wizard
select a tabular layout.
Select the group G_ORD and give a print direction down.
Select the fields ID, DATE_ORDERED, and SumLinetotalPerId.
b Add “Executive Summary” as boilerplate text in the margin region of the
Header section.
From the vertical toolbar, choose Edit Margin. Select the Text tool and
create the boiler plate text.
c Set the distribution for the header section to an HTMLCSS file.
In the Object Navigator, open the Property Palette for the Header Section.
Select the Distribution property. In the Distribution Dialog box set the
distribution ID, desname, and desformat fields. Make sure the output
format is HTMLCSS.
d Set the distibution for the main section to a PDF file.
In the Object Navigator, open the Property Palette for the Main Section.
Select the Distribution property. In the Distribution Dialog box set the
distribution id, desname, and desformat fields. Make sure the output
format is PDF. Save the report.
e Compile the report to generate a .rep file.
f Run and test the report using the Distribute facility in the Reports Runtime.
In the Reports Runtime, select File—>Distribute.
......................................................................................................................................................
A-48 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 10
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-49
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-50 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 10
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-51
Appendix A: Solutions
.....................................................................................................................................................
Introduction
Sometimes detail records get separated from their master header. You ensure that this
does not happen.
All layout objects support Web features. You will create a report that takes you to a
PDF document with a simple click using a hyperlink.
......................................................................................................................................................
A-52 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 11
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-53
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-54 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 12
.....................................................................................................................................................
Introduction
Modify a mailing label report to ensure you fill the printed page with label records.
You then restrict the number of labels that are printed on each page.
You add a link file to display a company logo by dynamically referencing a file at run
time.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-55
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-56 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 12
.....................................................................................................................................................
create an external boilerplate object in the margin region where the logo
was. Set the following properties:
Note: Do not include a file pathname.
Property Value
Name B_logo
Source File Format Image
Source File Name logo.tif
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-57
Appendix A: Solutions
.....................................................................................................................................................
Introduction
In this practice session, you create bind and lexical parameters to restrict records in the
report. You add lists of values to select valid values at run time.
You then create your own default parameter form and customize it to include extra
text and graphics.
......................................................................................................................................................
A-58 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 13
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-59
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-60 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 13
.....................................................................................................................................................
b Use your imagination to customize the form in the Parameter Form editor.
Make sure that the parameter P_CUSTOMER is placed in a prominent position
for user entry.
Add some graphics; modify colors and fill patterns.
No formal solution.
c Run the report using the Live Previewer to test.
d Save the report as p13q4.rdf and close it.
e Run the report on the Web.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-61
Appendix A: Solutions
.....................................................................................................................................................
Introduction
In this practice session you open existing reports to add charts using the Chart Wizard.
You also reenter the Chart Wizard to change the characteristics of a chart.
......................................................................................................................................................
A-62 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 14
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-63
Appendix A: Solutions
.....................................................................................................................................................
In the Layout editor, move the chart beneath the product group and resize it to
b
the same width as the product group.
Select the chart and drag it below the product group frame. You must
enable Flex Mode. Do not forget to turn it off again when you have
finished.
Select the group frame and the chart and select Arrange—>Size Objects
from the menu to resize the chart.
c Run and test the report.
d Close the Graphics Batch.
4 Create a report containing a chart hyperlink.
a Open p14q4a.rdf and run the report using the Live previewer.
b Open p14a4b.rdf and run the report using the Live Prewviewer.
c Create a chart hyperlink to invoke p14q4b.rdf when you run
p14q4a.rdf on the Web and click the pie chart.
......................................................................................................................................................
A-64 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 14
.....................................................................................................................................................
Note: The name of the user parameter in the detail report is p_cust. The
customer name should be passed to the detail report.
In the Object Navigator, select the pie chart object in module
p14q4a.rdf and open its Property Palette. Set the Chart Hyperlink
property to the following:
/dev60cgi/rwcgi60.exe?p14q4b+&<name>
d Save the report and test the chart hyperlink.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-65
Appendix A: Solutions
.....................................................................................................................................................
Introduction
In this practice session, you use an existing matrix report to investigate the different
methods of displaying the cell values and the implications. You use an existing
external query to create a nested matrix report. You then add row- and column-level
summaries to the report and display zeros for null values.
If you have time, include the product names instead of the product IDs and rotate the
names.
......................................................................................................................................................
A-66 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 15
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-67
Appendix A: Solutions
.....................................................................................................................................................
Property Value
Name SumMonthProduct
Product Order G_MONTH G_PRODUCT_ID
Function Sum
Source SumTOTAL_VALUE
Reset At G_PRODUCT_ID
g Use the Layout editor to create the fields. You must expand the appropriate
repeating frame.
Select and expand R_G_MONTH. You must enable Flex Mode. Do not
forget to disable it again when you have finished.
Select the Field tool from the vertical toolbar.
Create a field below F_SumTOTAL_VALUE. Position the field in the
R_G_MONTH and the R_G_PRODUCT_ID repeating frames.
Set the following properties:
Property Value
Name F_SumMonthProduct
Source SumMonthProduct
......................................................................................................................................................
A-68 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 15
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-69
Appendix A: Solutions
.....................................................................................................................................................
SELECT S_CUSTOMER.NAME
, S_ITEM.PRODUCT_ID
, SUM(S_ITEM.PRICE*S_ITEM.QUANTITY_SHIPPED) TOTAL_VALUE
, TO_CHAR(S_ORD.DATE_ORDERED, ’MM/RR’) MONTH
, S_PRODUCT.NAME PRODUCT
FROM S_CUSTOMER, S_ITEM, S_ORD, S_PRODUCT
WHERE S_ITEM.PRODUCT_ID LIKE ’4%’
AND S_ITEM.ORD_ID=S_ORD.ID
AND S_PRODUCT.ID=S_ITEM.PRODUCT_ID
AND S_ORD.CUSTOMER_ID=S_CUSTOMER.ID
GROUP BY S_CUSTOMER.NAME
, S_ITEM.PRODUCT_ID
, TO_CHAR(S_ORD.DATE_ORDERED, ’MM/RR’)
, S_PRODUCT.NAME
b In the Layout Model, editor delete the product_id field and insert a
boilerplate object to display the product name. Rotate this object by
90 degrees.
Note: You may have to expand the R_G_PRODUCT_ID frame and the
outermost frame. Watch out for frequency errors.
Select F_PRODUCT_ID and press [Delete].
Select the Text tool from the vertical toolbar and create a text object in the
place of the F_PRODUCT_ID field.
Enter: &PRODUCT.
Select the boilerplate object.
Select the Rotate tool from the vertical toolbar.
Press [Shift] and click the boilerplate object to rotate it by 90 degrees.
Open the property palette for the boilerplate object and set Vertical and
Horizontal Elasticity to Variable.
Open the data model and ensure that the G_PRODUCT_ID group
contains the PRODUCT column by dragging it in there.
c Save the report as p15q4.rdf and close it.
d Run and test the report on the Web using a format of PDF or
HTMLCSS.
......................................................................................................................................................
A-70 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 16
.....................................................................................................................................................
Introduction
In this practice session, you create a format trigger to conditionally flag one of two
layout versions for the same data. You also conditionally flag some records in a report
by creating and referencing a report-level (local) PL/SQL function. You then move the
code into a new PL/SQL library and alter the reference to use the library function
instead.
If you have time, restrict the number of records processed in a report by creating your
own group filter.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-71
Appendix A: Solutions
.....................................................................................................................................................
c Create a Tabular layout using the following columns from the query:
In the Layout Model editor select the Additional Default Layout tool from
the vertical toolbar.
Display the following fields. Select Labels and other properties as you
wish.
Column
ID
DATE_ORDERED
DATE_SHIPPED
TOTAL
d Ensure that only the Group Above layout is displayed when you select a
destination of Screen, and that only the Tabular layout is displayed when you
select a destination of Preview.
Create a format trigger on the M_G_CUSTOMER_ID_GRPFR group
frame in the first layout or use conditional formatting.
function M_G_CUSTOMER_ID_GRPFRFormatTrigger return BOOLEAN is
begin
if:destype = ’Screen’ then
return(true);
else
return(false);
end if;
end;
......................................................................................................................................................
A-72 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 16
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-73
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-74 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 16
.....................................................................................................................................................
In the Data Model editor, create a summary column in the G_ID group to
keep a running total of records.
Name Function Source Reset At
COUNT_ORD COUNT ID Report
In the Layout Editor, increase the height of the repeating frame for the
second layout. Remember to switch Flex mode on, so that you can increase the
repeating frame and the group frame together.
Open the repeating frame property palette 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 p16q3.rdf and close it.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-75
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-76 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 17
.....................................................................................................................................................
Introduction
If you use the Web Wizard and change some properties, you can easily prepare a
report for the Web. You will open an existing report and add: bookmarks,
hyperlinks, pagestreaming, animated gifs, and JavaScript.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-77
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-78 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 17
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-79
Appendix A: Solutions
.....................................................................................................................................................
Introduction
In this practice session, you highlight values based on conditional PL/SQL code.
You build a master report that enables you to call a separate report from a button in
the previewer.
If you have time, you add report-level triggers to an existing report to write
messages to a temporary table at various stages of report execution.
Write PL/SQL functions as local PL/SQL (report-level), and reference the code in a
condition within the relevant object trigger in the report.
......................................................................................................................................................
A-80 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 18
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-81
Appendix A: Solutions
.....................................................................................................................................................
c Add a button to this report to display a drill-down report when the button is
clicked at run time. The button should be displayed once for every customer
record.
In the Layout editor, increase the width of the R_G_CUSTOMER
repeating frame to allow room for the button.
Create a button inside the repeating frame.
d When the button is clicked , the detail report (p18q2c.rdf) is called with the
customer ID as a parameter.
Hint: Have a look at report p18q2c.rdf to check the name of the parameter.
You can import the file p18q2d.txt.
Open the property palette for the button and set the Type property to PL/
......................................................................................................................................................
A-82 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 18
.....................................................................................................................................................
SQL.
Import the file p18q2d.txt into the PL/SQL code, or enter the following
code:
procedure U_1ButtonAction is
begin
srw.run_report(’report=p18q2c.rdf
p_customer=’||to_char(:customer_id)||’ paramform=no’);
end;
e Save the report as p18q2.rdf.
f Test the report using the run time executable and then close the run time.
b The same trigger should also insert the current date, userid, and “Starting
Report” into this table.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-83
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-84 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 18
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-85
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-86 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 19
.....................................................................................................................................................
Introduction
Using XML you can build fully functional reports or partial reports that can serve as a
customization file.
You will run an XML file, apply an XML definition to an existing report, and debug
an XML report definition.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-87
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-88 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 19
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-89
Appendix A: Solutions
.....................................................................................................................................................
Introduction
In this practice session, you run a report locally and then on a remote server, using the
Queue Manager. You also use the Queue Manager to view the submitted jobs.
If you have time, you can submit a report to a remote server using the command line
options.
......................................................................................................................................................
A-90 Oracle iDS Reports: Build Internet Reports
Practice Session Solutions: Lesson 20
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-91
Appendix A: Solutions
.....................................................................................................................................................
dDisplay all jobs to see where your jobs are queued in relation to the reports of
other students.
Select Show All Jobs from the toolbar if it is not selected.
e Display all your own jobs only.
Select Show All My Jobs from the toolbar.
f Refresh the screen several times to see how quickly the report pages are
formatted.
Select Refresh from the toolbar.
g Cancel your own longrun2.rdf from the server queue.
Select the job and select Job—>Remove from the menu.
3 When the report longrun1.rdf has finished, copy the output to a filename,
longrun1.pdf, in your home directory.
When the job has finished, it is no longer displayed in the Current Jobs
window.
Select Show Past Jobs from the toolbar.
Select the job and choose Job—>Copy Output To from the menu.
Choose your home directory.
Enter the filename longrun1.pdf and click Save.
......................................................................................................................................................
A-92 Oracle iDS Reports: Build Internet Reports
Practice Session Overview: Lesson 21
.....................................................................................................................................................
Introduction
Report performance is always an issue. Report Builder offers a few tools that allow
you to measure preformance. In this practice you will use them and interpret the
results.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports A-93
Appendix A: Solutions
.....................................................................................................................................................
......................................................................................................................................................
A-94 Oracle iDS Reports: Build Internet Reports
................................
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ORD_ID
ID
S_ITEM S_ORD
PRODUCT_ID CUSTOMER_ID
SALES_REP_ID
S_INVENTORY
PRODUCT_ID
ID
ID ID
S_CUSTOMER
S_PRODUCT SALES_REP_ID
IMAGE_ID
ID ID ID
S_IMAGE S_EMP
DEPT_ID
ID
S_DEPT
......................................................................................................................................................
B-2 Oracle iDS Reports: Build Internet Reports
S_CUSTOMER Description
.....................................................................................................................................................
S_CUSTOMER Description
Column Name Null? Datatype
-------------- --------- ------------- -----------------
ID NOT NULL NUMBER(7)
NAME NOT NULL VARCHAR2(50)
PHONE VARCHAR2(25)
ADDRESS VARCHAR2(400)
CITY VARCHAR2(30)
STATE VARCHAR2(20)
COUNTRY VARCHAR2(30)
ZIP_CODE VARCHAR2(75)
CREDIT_RATING VARCHAR2(9)
SALES_REP_ID NUMBER(7)
REGION_ID NUMBER(7)
COMMENTS VARCHAR2(255)
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-3
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
S_CUSTOMER Data
......................................................................................................................................................
B-4 Oracle iDS Reports: Build Internet Reports
S_CUSTOMER Data
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-5
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
......................................................................................................................................................
B-6 Oracle iDS Reports: Build Internet Reports
S_CUSTOMER Data
.....................................................................................................................................................
15 rows selected.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-7
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID NAME REGION_ID
------ ---------------- -----------------
10 Finance 1
31 Sales 1
32 Sales 2
33 Sales 3
34 Sales 4
35 Sales 5
41 Operations 1
42 Operations 2
43 Operations 3
44 Operations 4
45 Operations 5
50 Administration 1
12 rows selected.
......................................................................................................................................................
B-8 Oracle iDS Reports: Build Internet Reports
S_EMP Description
.....................................................................................................................................................
S_EMP Description
Column Name Null? Datatype
------------------------ -------------- --------------
ID NOT NULL NUMBER(7)
LAST_NAME NOT NULL VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
USERID VARCHAR2(8)
START_DATE DATE
COMMENT VARCHAR2(255)
MANAGER_ID NUMBER(7)
TITLE VARCHAR2(25)
DEPT_ID NUMBER(7)
SALARY NUMBER(11,2)
COMMISSION_PCT NUMBER(4,2)
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-9
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
S_EMP Data
......................................................................................................................................................
B-10 Oracle iDS Reports: Build Internet Reports
S_EMP Data
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-11
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
25 rows selected.
......................................................................................................................................................
B-12 Oracle iDS Reports: Build Internet Reports
S_ITEM Description
.....................................................................................................................................................
S_ITEM Description
Column Name Null? Datatype
------------------------- -------------- ----------
ORD_ID NOT NULL NUMBER(7)
ITEM_ID NOT NULL NUMBER(7)
PRODUCT_ID NOT NULL NUMBER(7)
PRICE NUMBER(11,2)
QUANTITY NUMBER(9)
QUANTITY_SHIPPED NUMBER(9)
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-13
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
S_ITEM Data
......................................................................................................................................................
B-14 Oracle iDS Reports: Build Internet Reports
S_ITEM Data
.....................................................................................................................................................
62 rows selected.
ID CUSTOMER_IDDATE_ORDEDATE_SHIPSALES_REP_IDTOTALPAYMENORDER_F
--- ------------------------------------------------------------
100 204 31-AUG9210-SEP-9211601100CREDITY
101 205 31-AUG-9215-SEP-92148056.6CREDITY
102 206 01-SEP-9208-SEP-92158335CREDITY
103 208 02-SEP-9222-SEP-9215377CASHY
104 208 03-SEP-9223-SEP-921532430CREDITY
105 209 04-SEP-92 18-SEP-92112722.24CREDITY
106 210 07-SEP-92 15-SEP-921215634CREDITY
107 211 07-SEP-9221-SEP-9215142171CREDITY
108 212 07-SEP-9210-SEP-9213149570CREDITY
109 213 08-SEP-92 28-SEP-92111020935CREDITY
110 214 09-SEP-92 21-SEP-92111539.13CASHY
111 204 09-SEP-92 21-SEP-92112770CASHY
97 201 28-AUG-92 17-SEP-921284000 CREDITY
98 202 31-AUG-92 10-SEP-9214595CASHY
99 203 31-AUG-92 18-SEP-92147707CREDITY
112 210 31-AUG-92 10-SEP-9212550CREDITY
16 rows selected.
......................................................................................................................................................
B-16 Oracle iDS Reports: Build Internet Reports
S_PRODUCT Description
.....................................................................................................................................................
S_PRODUCT Description
Column NameNull?Datatype
---------------------------------------------------
ID NOT NULLNUMBER(7)
NAMENOT NULLVARCHAR2(50)
SHORT_DESCVARCHAR2(255)
LONGTEXT_IDNUMBER(7)
IMAGE_ID NUMBER(7)
SUGGESTED_WHLSL_PRICE‘NUMBER(11,2)
WHLSL_UNITSVARCHAR2(25)
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-17
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
S_PRODUCT Data
IDNAMESHORT_DESCLONGTEXT_ID
-----------------------------------------
IMAGE_IDSUGGESTED_WHLSL_PRICEWHLSL_UNITS
----------------------------------------
10011 BootBeginner ’s ski boot518
1001150
......................................................................................................................................................
B-18 Oracle iDS Reports: Build Internet Reports
S_PRODUCT Data
.....................................................................................................................................................
ID NAMESHORT_DESCLONGTEXT_ID
-------------------------------------------
IMAGE_IDSUGGESTED_WHLSL_PRICEWHLSL_UNITS
----------------------------------------
20510Black Hawk Knee pads, pair1017
Knee Pads9
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-19
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID NAMESHORT_DESCLONGTEXT_ID
-------------------------------------------
IMAGE_IDSUGGESTED_WHLSL_PRICEWHLSL_UNITS
----------------------------------------
40421Alexeyer ProStraight bar928
Lifting Bar
1381 65
......................................................................................................................................................
B-20 Oracle iDS Reports: Build Internet Reports
S_PRODUCT Data
.....................................................................................................................................................
ID NAMESHORT_DESCLONGTEXT_ID
---------------------------------------------
IMAGE_IDSUGGESTED_WHLSL_PRICEWHLSL_UNITS
----------------------------------------
50273 Chapman HelmetBatting helmet780
1223 22.89
33 rows selected.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-21
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID NAME
--- --------------------------
1 North America
2 South America
3 Africa / Middle East
4 Asia
5 Europe
......................................................................................................................................................
B-22 Oracle iDS Reports: Build Internet Reports
S_TITLE Description and Data
.....................................................................................................................................................
TITLE
------------------------
President
Sales Representative
Stock Clerk
VP, Administration
VP, Finance
VP, Operations
VP, Sales
Warehouse Manager
8 rows selected.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-23
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
emp_type_RefCol
Name Null? Type
-------------------------------------------------
ID NUMBER(7)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
USERID VARCHAR2(8)
START_DATE DATE
MANAGER_ID NUMBER(7)
TITLE VARCHAR2(25)
DEPT_ID REF OF DEPT_TYPE
SALARY NUMBER(11,2)
COMMISSION_PCT NUMBER(4,2)
dept_type
-------------------------------------------------
ID NUMBER
NAME VARCHAR2(25)
REGION_ID NUMBER(7)
......................................................................................................................................................
B-24 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
Tables
oo_emp_Table_ObjCol
Name Null? Type
-------------------------------------------------
ID NUMBER(7)
LAST_NAME VARCHAR2(25)
FIRST_NAMEVARCHAR2(25)
USERID VARCHAR2(8)
START_DATE DATE
MANAGER_ID NUMBER(7)
TITLE VARCHAR2(25)
DEPT_ID DEPT_TYPE
SALARY NUMBER(11,2)
COMMISSION_PCT NUMBER(4,2)
ID LAST_NAMEFIRST_NAME USERID
--------- --------------------- --------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
1VelasquezCarmencvelasqu
03-MAR-90President
DEPT_TYPE(50, ’Administration’, 1)
2500
2NgaoLaDorislngao
08-MAR-901 VP Operations
DEPT_TYPE(41, ’Operations’, 1)
1450
3NagayamaMidorimnagayam
17-JUN-91 1 VP Sales
DEPT_TYPE(31, ’Sales’, 1)
1400
ID LAST_NAMEFIRST_NAMEUSERID
---------- ----------------------------- --------
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-25
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
5RopeburnAudryaropebur
04-MAR-901 VP Administration
DEPT_TYPE(50, ’Administration’, 1)
1550
6 Urguhart Mollymurguhar
18-JAN-91 2 Warehouse Manager
DEPT_TYPE(41, ’Operations’, 1)
1200
7 MenchuRobertarmenchu
14-MAY-90 2 Warehouse Manager
DEPT_TYPE(42, ’Operations’, 2)
1250
8 Biri Benbbiri
07-APR-902 Warehouse Manager
DEPT_TYPE(43, ’Operations’, 3)
1100
9 CatchpoleAntoinetteacatchpo
09-FEB-922 Warehouse Manager
DEPT_TYPE(44, ’Operations’, 4)
1300
ID LAST_NAMEFIRST_NAMEUSERID
---------- ------------------------------ --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
......................................................................................................................................................
B-26 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
11 MageeColincmagee
14-MAY-903 Sales Representative
DEPT_TYPE(31, ’Sales’, 1)
140010
12 GiljumHenry hgiljum
18-JAN-92 3 Sales Representative
DEPT_TYPE(32, ’Sales’, 2)
149013
13 SedeghiYasminysedeghi
18-FEB-913 Sales Representative
DEPT_TYPE(33, ’Sales’, 3)
1515 10
14 NguyenMai mnguyen
22-JAN-923 Sales Representative
DEPT_TYPE(34, ’Sales’, 4)
1525 15
15 DumasAndreadumas
09-OCT-913 Sales Representative
DEPT_TYPE(35, ’Sales’, 5)
145018
ID LAST_NAMEFIRST_NAMEUSERID
---------- ----------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-27
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
SALARY COMMISSION_PCT
---------- --------------
16 MaduroElena emaduro
07-FEB-926 Stock Clerk
DEPT_TYPE(41, ’Operations’, 1)
1400
17SmithGeorgegsmith
08-MAR-906 Stock Clerk
DEPT_TYPE(41, ’Operations’, 1)
940
18 NozakiAkira anozaki
09-FEB-91 7 Stock Clerk
DEPT_TYPE(42, ’Operations’, 2)
1200
19PatelVikramvpatel
06-AUG-91 7 Stock Clerk
DEPT_TYPE(42, ’Operations’, 2)
795
20 NewmanChad cnewman
21-JUL-918 Stock Clerk
DEPT_TYPE(43, ’Operations’, 3)
750
21 MarkarianAlexanderamarkari
26-MAY-91 8 Stock Clerk
DEPT_TYPE(43, ’Operations’, 3)
850
ID LAST_NAMEFIRST_NAMEUSERID
---------- ------------------------------ --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
......................................................................................................................................................
B-28 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
22 ChangEddie echang
30-NOV-90 9 Stock Clerk
DEPT_TYPE(44, ’Operations’, 4)
800
23 PatelRadharpatel
17-OCT-909 Stock Clerk
DEPT_TYPE(34, ’Sales’, 4)
795
25 SchwartzSylviesschwart
09-MAY-9110 Stock Clerk
DEPT_TYPE(45, ’Operations’, 5)
1100
oo_emp_Table_RefCol
Name Null? Type
----------------------------------------------
ID NUMBER(7)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
USERID VARCHAR2(8)
START_DATE DATE
MANAGER_ID NUMBER(7)
TITLE VARCHAR2(25)
DEPT_ID REF OF DEPT_TYPE
SALARY NUMBER(11,2)
COMMISSION_PCTNUMBER(4,2)
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
1 Velasquez Carmencvelasqu
03-MAR-90President
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-29
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
0000220208447F54A9ED64676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
2500
2NgaoLaDorislngao
08-MAR-90 1 VP Operations
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1450
3 NagayamaMidorimnagayam
17-JUN-91 1 VP Sales
0000220208447F54A9ED5A676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1400
4 Quick-To-SeeMarkmquickto
07-APR-90 1 VP Finance
0000220208447F54A9ED59676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1450
5 Ropeburn Audryaropebur
04-MAR-90 1 VP Administration
0000220208447F54A9ED64676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1550
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
6 UrguhartMollymurguhar
18-JAN-912 Warehouse Manager
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1200
......................................................................................................................................................
B-30 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
9 CatchpoleAntoinetteacatchpo
09-FEB-922 Warehouse Manager
0000220208447F54A9ED62676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1300
10 Havel Martamhavel
27-FEB-91 2 Warehouse Manager
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1307
11 Magee Colincmagee
14-MAY-90 3 Sales Representative
0000220208447F54A9ED5A676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1400 10
13 SedeghiYasminysedeghi
18-FEB-91 3 Sales Representative
0000220208447F54A9ED5C676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1515 10
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-31
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
14 NguyenMaimnguyen
22-JAN-92 3 Sales Representative
0000220208447F54A9ED5D676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1525 15
15 DumasAndreadumas
09-OCT-913 Sales Representative
0000220208447F54A9ED5E676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1450 18
16 MaduroElenaemaduro
07-FEB-92 6 Stock Clerk
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1400
17 SmithGeorgegsmith
08-MAR-90 6 Stock Clerk
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
940
18 NozakiAkiraanozaki
09-FEB-91 7 Stock Clerk
0000220208447F54A9ED60676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1200
......................................................................................................................................................
B-32 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
19 PatelVikramvpatel
06-AUG-91 7 Stock Clerk
0000220208447F54A9ED60676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
795
20 NewmanChadcnewman
21-JUL-918 Stock Clerk
0000220208447F54A9ED61676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
750
21 MarkarianAlexanderamarkari
26-MAY-91 8 Stock Clerk
0000220208447F54A9ED61676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
850
22 ChangEddieechang
30-NOV-90 9 Stock Clerk
0000220208447F54A9ED62676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
800
23 PatelRadharpatel
17-OCT-90 9 Stock Clerk
0000220208447F54A9ED5D676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
795
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-33
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
24 DancsBelabdancs
17-MAR-91 10 Stock Clerk
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
860
25 SchwartzSylviesschwart
09-MAY-91 10 Stock Clerk
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1100
oo_dept_table
Name Null? Type
-------------------------------------------------
ID NUMBER
NAME VARCHAR2(25)
REGION_ID NUMBER(7)
ID NAME REGION_ID
-------------------------------------------------
10 Finance1
31 Sales 1
32 Sales 2
33 Sales 3
34 Sales 4
35 Sales 5
41 Operations 1
42 Operations 2
43 Operations 3
44 Operations 4
45 Operations 5
50 Administration 1
......................................................................................................................................................
B-34 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
rel_emp_Table_Objcol
Name Null? Type
-------------------------------------------------
ID NUMBER(7)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
USERID VARCHAR2(8)
START_DATE DATE
MANAGER_ID NUMBER(7)
TITLE VARCHAR2(25)
DEPT_ID DEPT_TYPE
SALARY NUMBER(11,2)
COMMISSION_PCT NUMBER(4,2)
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
1 VelasquezCarmencvelasqu
03-MAR-90President
DEPT_TYPE(50, ’Administration’, 1)
2500
2 NgaoLaDorislngao
08-MAR-90 1 VP Operations
DEPT_TYPE(41, ’Operations’, 1)
1450
3 NagayamaMidorimnagayam
17-JUN-91 1 VP Sales
DEPT_TYPE(31, ’Sales’, 1)
1400
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-35
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
4 Quick-To-SeeMarkmquickto
07-APR-90 1 VP Finance
DEPT_TYPE(10, ’Finance’, 1)
1450
5 RopeburnAudryaropebur
04-MAR-90 1 VP Administration
DEPT_TYPE(50, ’Administration’, 1)
1550
6 Urguhart Mollymurguhar
18-JAN-91 2 Warehouse Manager
DEPT_TYPE(41, ’Operations’, 1)
1200
7 Menchu Robertarmenchu
14-MAY-90 2 Warehouse Manager
DEPT_TYPE(42, ’Operations’, 2)
1250
8 Biri Benbbiri
07-APR-90 2 Warehouse Manager
DEPT_TYPE(43, ’Operations’, 3)
1100
9 CatchpoleAntoinetteacatchpo
09-FEB-92 2 Warehouse Manager
DEPT_TYPE(44, ’Operations’, 4)
1300
......................................................................................................................................................
B-36 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
10 Havel Martamhavel
27-FEB-91 2 Warehouse Manager
DEPT_TYPE(45, ’Operations’, 5)
1307
11 MageeColincmagee
14-MAY-90 3 Sales Representative
DEPT_TYPE(31, ’Sales’, 1)
1400 10
12 GiljumHenryhgiljum
18-JAN-92 3 Sales Representative
DEPT_TYPE(32, ’Sales’, 2)
1490 13
14 NguyenMaimnguyen
22-JAN-92 3 Sales Representative
DEPT_TYPE(34, ’Sales’, 4)
1525 15
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-37
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
16 MaduroElenaemaduro
07-FEB-92 6 Stock Clerk
DEPT_TYPE(41, ’Operations’, 1)
1400
19 PatelVikramvpatel
06-AUG-91 7 Stock Clerk
DEPT_TYPE(42, ’Operations’, 2)
795
21 Markarian Alexanderamarkari
26-MAY-91 8 Stock Clerk
DEPT_TYPE(43, ’Operations’, 3)
850
......................................................................................................................................................
B-38 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
22 ChangEddieechang
30-NOV-90 9 Stock Clerk
DEPT_TYPE(44, ’Operations’, 4)
800
rel_emp_Table_RefCol
Name Null? Type
-------------------------------------------------
ID NUMBER(7)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
USERID VARCHAR2(8)
START_DATE DATE
MANAGER_ID NUMBER(7)
TITLE VARCHAR2(25)
DEPT_ID REF OF DEPT_TYPE
SALARY NUMBER(11,2)
COMMISSION_PCT NUMBER(4,2)
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-39
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
1 Velasquez Carmen cvelasqu
03-MAR-90 President
0000220208447F54A9ED64676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
2500
......................................................................................................................................................
B-40 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
6 Urguhart Molly murguhar
18-JAN-91 2 Warehouse Manager
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1200
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-41
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
14 Nguyen Mai mnguyen
22-JAN-92 3 Sales Representative
0000220208447F54A9ED5D676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
1525 15
......................................................................................................................................................
B-42 Oracle iDS Reports: Build Internet Reports
Oracle8 Objects: Types, Tables
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
19 Patel Vikram vpatel
06-AUG-91 7 Stock Clerk
0000220208447F54A9ED60676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
795
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports B-43
Appendix B: Table Descriptions and Data
.....................................................................................................................................................
ID LAST_NAMEFIRST_NAMEUSERID
---------- --------------------------------- --------
START_DAT MANAGER_ID TITLE
--------- ---------- -------------------------
DEPT_ID(ID, NAME, REGION_ID)
------------------------------------------------------------
SALARY COMMISSION_PCT
---------- --------------
24 Dancs Bela bdancs
17-MAR-91 10 Stock Clerk
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE0340800
2072C15B
860
......................................................................................................................................................
B-44 Oracle iDS Reports: Build Internet Reports
................................
Appendix C: Frequently Asked Questions
.....................................................................................................................................................
......................................................................................................................................................
C-2 Oracle iDS Reports: Build Internet Reports
Frequently Asked Questions and Answers
.....................................................................................................................................................
Answer The Multitiered Reports Server, which is part of Oracle Reports Developer
release 6i, enables you to run reports on a remote application server. When used in
conjunction with the Reports Web CGI or Web Cartridge, it also enables you to run
reports from a Web browser using standard URL syntax. The server can be installed on
Windows NT, Windows95, or UNIX. It handles client requests to run reports by
entering all requests into a job queue.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports C-3
Appendix C: Frequently Asked Questions
.....................................................................................................................................................
......................................................................................................................................................
C-4 Oracle iDS Reports: Build Internet Reports
Frequently Asked Questions and Answers
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports C-5
Appendix C: Frequently Asked Questions
.....................................................................................................................................................
......................................................................................................................................................
C-6 Oracle iDS Reports: Build Internet Reports
Frequently Asked Questions and Answers
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports C-7
Appendix C: Frequently Asked Questions
.....................................................................................................................................................
......................................................................................................................................................
C-8 Oracle iDS Reports: Build Internet Reports
................................
Appendix D: Oracle Rdb Overview
.....................................................................................................................................................
Supported Platforms
Oracle Rdb is available on the following computing platforms:
• OpenVMS VAX
• OpenVMS Alpha
• Windows NT Intel and Alpha
......................................................................................................................................................
D-2 Oracle iDS Reports: Build Internet Reports
What Is Oracle Rdb?
.....................................................................................................................................................
Other Information
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports D-3
Appendix D: Oracle Rdb Overview
.....................................................................................................................................................
Oracle Rdb Product Information The Rdb Web site is a resource for finding out
the latest news on the product and its features. Look here for information such as:
• New product releases
• Product interoperability information
• How customers are using Oracle Rdb
• Calendar of product-related events
To access the Web site, go to the following URL: http://www.oracle.com/
rdb
......................................................................................................................................................
D-4 Oracle iDS Reports: Build Internet Reports
................................
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-2 Oracle iDS Reports: Build Internet Reports
What Is Query Builder?
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-3
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-4 Oracle iDS Reports: Build Internet Reports
What Is Query Builder?
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-5
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
2 3
1 Toolbar
2 Conditions panel
3 Datasource panel
......................................................................................................................................................
E-6 Oracle iDS Reports: Build Internet Reports
The Query Builder Window
.....................................................................................................................................................
Toolbar
The toolbar enables you to issue commands with a click of the mouse. You can create
conditions, add new datasources, or define new columns.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-7
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-8 Oracle iDS Reports: Build Internet Reports
Building a New Query
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-9
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Datasource Components
1 5
2
6
3
7
4 8
......................................................................................................................................................
E-10 Oracle iDS Reports: Build Internet Reports
Datasource Components
.....................................................................................................................................................
Datasource Components
Tables
A table that has been included in a query is referred to as a datasource. It is displayed
as a rectangular graphic in the Datasource panel of the Query window. The top part of
the rectangle contains the table name and an icon representing its type.
Type Description
Table Stores data in the database.
View Acts like a table when you execute a query, but is really a pointer to either a
subset of a table, a combination of tables, or a join of two or more tables.
Synonym Another name for an object. Sometimes table names can be rather cryptic,
such as emp_em_con_tbl. You can create a synonym that simply calls this
table Contracts.
Alias Query Builder uses an alias name for a table when the table is used more
than once, mostly with self-joins (you can also rename a table).
Columns
The body of the rectangle contains column names listed vertically. To the right of the
column name is an icon representing the datatype.
Columns also provide additional information.
• Primary keys are displayed in bold.
• Foreign keys are displayed in italics.
• Recursive relationships are indicated by a self-relationship icon.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-11
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Refining a Query
......................................................................................................................................................
E-12 Oracle iDS Reports: Build Internet Reports
Refining a Query
.....................................................................................................................................................
Refining a Query
Adding Columns to a Query
There are several methods of adding columns to a query:
• Select the check box to the right of the column name
• Double-click the column name
To include all columns from any single table, double-click the table heading.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-13
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Sorting Data
......................................................................................................................................................
E-14 Oracle iDS Reports: Build Internet Reports
Refining a Query
.....................................................................................................................................................
Sorting Data
By default, a query returns the data in no specific order. To sort the data, you must add
an ORDER BY clause to the query.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-15
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-16 Oracle iDS Reports: Build Internet Reports
Viewing and Saving Queries
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-17
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-18 Oracle iDS Reports: Build Internet Reports
Including Additional Tables
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-19
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Viewing Comments
......................................................................................................................................................
E-20 Oracle iDS Reports: Build Internet Reports
Including Additional Tables
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-21
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-22 Oracle iDS Reports: Build Internet Reports
Relationships
.....................................................................................................................................................
Relationships
To combine data from multiple tables into one query, Query Builder enables you to
search for relationships between tables and to create user-defined relationships if they
do not exist. Additionally, you can activate or deactivate relationships to suit your
needs.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-23
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-24 Oracle iDS Reports: Build Internet Reports
Relationships
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-25
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Unmatched Rows
......................................................................................................................................................
E-26 Oracle iDS Reports: Build Internet Reports
Relationships
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-27
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Conditions
......................................................................................................................................................
E-28 Oracle iDS Reports: Build Internet Reports
Selecting Rows with Conditions
.....................................................................................................................................................
The Toolbar
The logical operators and the Accept and Cancel tools in the toolbar are active
whenever the Condition field is active. You can insert an operator from the toolbar into
the condition by clicking it.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-29
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Operators
Arithmetic
• Perform calculations on numeric and date columns
• Examples: +, -, x, /
Logical
• Combine conditions
• Examples: AND, OR, NOT
Comparison
• Compare one expression with another
• Examples: =, <>, <, IN, IS NULL,
BETWEEN ... AND
......................................................................................................................................................
E-30 Oracle iDS Reports: Build Internet Reports
Operators
.....................................................................................................................................................
Operators
An operator is a character or reserved word that is used to perform some operation in
Query Builder, such as the + operator, which performs addition. Query Builder uses
several types of operators.
Arithmetic Operators
Arithmetic (+, -, x, /) operators are used to perform calculations on numeric and date
columns. In handling calculations, Query Builder first evaluates any multiplication or
division, and then evaluates any addition or subtraction.
Logical Operators
Logical operators are used to combine conditions. They include:
• AND: Causes the browser to retrieve only data that meets all conditions
• OR: Causes the browser to retrieve all data that meets at least one of the
conditions
• NOT: Used to make a negative condition, such as NOT NULL
Comparison Operators
Comparison operators are used to compare one expression with another, such that the
result will either be true or false. The browser returns all data for which the result
evaluates true.
Operator Usage
= Equal
<> Not equal
< Less than
<= Less than or equal
> Greater than
>= Greater than or equal
BETWEEN... Between two values
AND...
IN (LIST) Equal to any member of the following list
IS NULL Is a NULL value. A row without a value in one column is said to contain a
NULL value.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-31
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Multiple Conditions
......................................................................................................................................................
E-32 Oracle iDS Reports: Build Internet Reports
Entering Multiple Conditions
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-33
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
Deactivating a Condition
......................................................................................................................................................
E-34 Oracle iDS Reports: Build Internet Reports
Changing Conditions
.....................................................................................................................................................
Changing Conditions
If you change your mind about including one or more conditions in your query, you
can delete, deactivate, or edit any of them in the Conditions panel.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-35
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-36 Oracle iDS Reports: Build Internet Reports
Defining Columns Using an Expression
.....................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-37
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-38 Oracle iDS Reports: Build Internet Reports
Defining Columns Using a Function
.....................................................................................................................................................
What Is a Function?
A function is similar to an operator in that it performs a calculation and returns a
result. Functions consist of a function name followed by parentheses, in which you
indicate the arguments.
An argument is an expression that supplies information for the function to use.
Functions usually include at least one argument, most commonly the name of the
column on which the operation will be performed.
Single-Row Functions
• Return one value for every data row operated on
• Examples: INITCAP(), SUBSTR(), TRUNC()
Aggregate Functions
• Return a single row based on the input of multiple rows of data
• Examples: AVG(), COUNT(), SUM()
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports E-39
Appendix E: Introduction to Query Builder
.....................................................................................................................................................
......................................................................................................................................................
E-40 Oracle iDS Reports: Build Internet Reports
................................
i
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
Objectives
......................................................................................................................................................
F-2 Oracle iDS Reports: Build Internet Reports
Overview
.....................................................................................................................................................
Overview
Introduction
In this lesson, you will review certain object features of Oracle8. This lesson also
explains how these objects are displayed in the Object Navigator.
Objectives
After completing of this lesson, you should be able to do the following:
• Describe the new Oracle8 scalar datatypes
• Describe object types and objects
• Describe object tables, object columns, and object views
• Describe the INSTEAD-OF triggers
• Describe object REFs
• Identify the display of objects in Object Navigator
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-3
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
• NCHAR
• NVARCHAR2
• FLOAT
• NLS types
......................................................................................................................................................
F-4 Oracle iDS Reports: Build Internet Reports
New Oracle8 Datatypes
.....................................................................................................................................................
NLS Types
Oracle8 offers extended NLS (National Language Support) including national
character sets and the datatypes NCHAR and NVARCHAR2, which store NLS data.
With NLS, number and date formats adapt automatically to the language conventions
specified for a user session, so that users around the world can interact with Oracle in
their native languages. NLS is discussed in Oracle8 Server Reference Manual.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-5
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
Object Types
Attributes
Ship
ORDER
po_no Cancel
Check custinfo
status line_items
amount
Hold
Methods
......................................................................................................................................................
F-6 Oracle iDS Reports: Build Internet Reports
New Oracle8 Datatypes
.....................................................................................................................................................
Object Types
An object type is a user-defined composite datatype. Orcale8 requires enough
knowledge of a user-defined datatype to interact with it. Therefore, in some sense an
object type is similar to a record type, and in some sense it is similar to a package.
An object type must have one or more attributes and can contain methods.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-7
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
Object Types
Attributes
Ship
ORDER
po_no Cancel
Check custinfo
status line_items
amount
Hold
Methods
......................................................................................................................................................
F-8 Oracle iDS Reports: Build Internet Reports
New Oracle8 Datatypes
.....................................................................................................................................................
Methods An object type is also similar to a package. Once an object is declared, its
attributes are similar to package variables. And like packages, objects types can
contain procedures and functions. In object types, these subprograms are known as
methods. A method describes the behavior of an object type.
Like packages, object types can be declared in two parts: a specification and a body.
As with package variables, attributes declared in the object type specification are
public and those declared in the body are private. Also as with package subprograms,
all methods are defined in the package body, but only those whose specification
appears in the object type specification are public methods.
Here is an example of an object type:
CREATE TYPE dept_type AS OBJECT
(dept_idNUMBER(2),
dnameVARCHAR2(14),
loc VARCHAR2(3),
MEMBER PROCEDURE set_dept_id (d_id NUMBER),
PRAGMA RESTRICT_REFERENCES (set_dept_id,
RNDS,WNDS,RNPS,WNPS),
MEMBER FUNCTION get_dept_id RETURN NUMBER,
PRAGMA RESTRICT_REFERENCES (get_dept_id,
RNDS,WNDS,RNPS,WNPS));
CREATE TYPE BODY dept_type AS
MEMBER PROCEDURE set_dept_id (d_id NUMBER)
IS
BEGIN
dept_id := d_id;
END;
MEMBER FUNCTION get_dept_id
RETURN NUMBER
IS
BEGIN
RETURN (dept_id);
END;
END;
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-9
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
Object Tables
......................................................................................................................................................
F-10 Oracle iDS Reports: Build Internet Reports
Creating Oracle8 Objects
.....................................................................................................................................................
Object Tables
One way to create an object is to create a table whose rows are objects of that object
type.
Here is an example of an object table declaration:
CREATE TABLE o_dept OF dept_type;
SQL and PL/SQL treat object tables very similarly to relational tables, with the
attribute of the object corresponding to the columns of the table. But there are
significant differences. The most important difference is that rows in an object table
are assigned object IDs (OIDs) and can be referenced using a REF type.
Note: REF types are reviewed later.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-11
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
Object Columns
......................................................................................................................................................
F-12 Oracle iDS Reports: Build Internet Reports
Creating Oracle8 Objects
.....................................................................................................................................................
Object Columns
Another construct that can be based on an object type is an object column in a
relational table. Here is an example of a relational table creation statement with an
object column:
CREATE TABLE o_customer (
custid NUMBER (6) NOT NULL,
name VARCHAR2 (45),
repid NUMBER (4) NOT NULL,
creditlimit NUMBER (9,2),
address address_type,
phone phone_type);
In the object table, the rows of a table are objects. In a relational table with an object
column, the column is an object. The table will usually have standard columns, as well
as one or more object column.
Object columns are not assigned object IDs, and therefore cannot be referenced using
object REF values.
Note: Object REFs are reviewed later in this section.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-13
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
Object Views
Object
Object-oriented view Relational
application table
......................................................................................................................................................
F-14 Oracle iDS Reports: Build Internet Reports
Creating Oracle8 Objects
.....................................................................................................................................................
Object Views
Often, the most difficult part of adopting a new technology is the conversion process
itself. For example, a large enterprise might have several applications accessing the
same data stored in relational tables. If such an enterprise decided to start using object-
relational technology, they would not convert all of the applications at once. They
would convert the applications one at a time.
That presents a problem. The applications that have been converted need the data
stored as objects, while the applications that have not been converted need the data
stored in relational tables.
This dilemma is addressed by object views. Like all views, an object view transforms
the way a table appears to a user, without changing the actual structure of the table.
Object views make relational tables look like object tables. This allows the developers
to postpone converting the data from relational structures to object-relational
structures until after all of the applications have been converted. During the
conversion process, the object-relational applications can operate against the object
view, while the relational applications can continue to operate against the relational
tables.
Objects accessed through object views are assigned object IDs, and can be referenced
using Object REFs.
Note: Object REFs are reviewed later in this section.
Here is an example of an object view creation statement:
CREATE VIEW emp_view OF emp_type
WITH OBJECT OID (eno)
AS
SELECT e.empno, e.ename, e.sal, e.job
FROM emp e;
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-15
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
INSTEAD-OF Triggers
DECLARE
BEGIN
EXCEPTION
END;
Nonupdatable INSTEAD-OF
view Trigger
......................................................................................................................................................
F-16 Oracle iDS Reports: Build Internet Reports
Creating Oracle8 Objects
.....................................................................................................................................................
INSTEAD-OF Triggers
INSTEAD-OF triggers provide a transparent way of modifying views that cannot be
modified directly through SQL DML statements (INSERT, UPDATE, and DELETE).
These triggers are called INSTEAD-OF triggers because, unlike other types of
triggers, Oracle fires the trigger instead of executing the triggering statement. The
trigger performs update, insert, or delete operations directly on the underlying tables.
Users write normal INSERT, DELETE, and UPDATE statements against the view and
the INSTEAD-OF trigger works invisibly in the background to make the right actions
take place.
INSTEAD-OF triggers are activated for each row.
Note: Although INSTEAD-OF triggers can be used with any view, they are typically
needed with object views.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-17
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
References to Objects
OID
......................................................................................................................................................
F-18 Oracle iDS Reports: Build Internet Reports
Referencing Objects
.....................................................................................................................................................
Referencing Objects
Introduction
In relational databases, primary key values are used to uniquely identify records. In
object-relational databases, OIDs provide an alternate method.
When a row in an object table or object view is created, it is automatically assigned a
unique identifier called an object ID.
Object REFs
With relational tables, you can associate two records by storing the primary key of one
record in one of the columns (the foreign key column) of another.
In a similar way, you can associate a row in a relational table to an object by storing
the OID of an object in a column of a relational table.
You can also associate two objects by storing the OID of one object in an attribute of
another. The stored copy of the OID then becomes a pointer, or reference (REF), to the
original object.
The attribute or column that holds the OID is of datatype REF.
Note: Object columns are not assigned OIDs and cannot be pointed to by a REF.
Here is an example of a table declaration that includes a column with a REF datatype:
CREATE TABLE o_emp
( empno NUMBER(4) NOT NULL,
ename VARCHAR2(10),
job VARCHAR2(10),
mgr NUMBER(4),
hiredate DATE,
sal NUMBER(7,2),
comm NUMBER(7,2),
dept REF dept_type SCOPE IS o_dept) ;
Note: The REF is scoped here to restrict the reference to a single table, O_DEPT. The
object itself is not stored in the table, only the OID value for the object.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-19
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
......................................................................................................................................................
F-20 Oracle iDS Reports: Build Internet Reports
Displaying Oracle8 Objects in the Object Navigator
.....................................................................................................................................................
Object Types
Both the attributes and the methods are listed under each type. Also, the nested types
within address_and_phone_type are displayed in an indented sublevel.
This convention is used for nested object and object type displays throughout Oracle
Developer.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-21
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
......................................................................................................................................................
F-22 Oracle iDS Reports: Build Internet Reports
Displaying Oracle8 Objects in the Object Navigator
.....................................................................................................................................................
Object Tables
Object tables are displayed like relational tables, with the attributes of the object
displayed like columns in a relational table. Also, the object table type name is
displayed in parentheses after the name of the object table.
Object Columns
Object columns are displayed with the object type in parentheses after the column
name, and with the attributes of the type indented underneath the column name.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-23
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
......................................................................................................................................................
F-24 Oracle iDS Reports: Build Internet Reports
Displaying Oracle8 Objects in the Object Navigator
.....................................................................................................................................................
Object Views
Object views are displayed like any other view, except that the object type they are
based on appears in parentheses after the view name.
INSTEAD-OF Triggers
INSTEAD-OF database triggers can now be created through the trigger creation
dialog box, just like any other database trigger.
INSTEAD-OF INSERT, UPDATE, and DELETE triggers allow you to directly insert,
update, and delete against object views. They can also be used with any other type of
view that does not allow direct DML.
When a view has an INSTEAD-OF trigger, the code in the trigger is executed in place
of the triggering DML code.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-25
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
......................................................................................................................................................
F-26 Oracle iDS Reports: Build Internet Reports
Displaying Oracle8 Objects in the Object Navigator
.....................................................................................................................................................
Object REFs
Object types that contain attributes of type REF, and relational tables that have
columns of type REF, display the keyword REF before the name of the object type that
is being referenced.
The attributes of the referenced object type are displayed indented underneath the
column or attribute.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-27
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
Summary
Summary
......................................................................................................................................................
F-28 Oracle iDS Reports: Build Internet Reports
Summary
.....................................................................................................................................................
Summary
New Oracle8 Datatypes
Oracle8 introduced three new scalar datatypes and new composite dataypes such as
object types.
Objects
Three kinds of objects are object tables, object columns, and object views.
INSTEAD-OF triggers allow DML on object views.
Object REFs store the object identifier of certain types of objects.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports F-29
Appendix F: Object Features in Oracle 8i
.....................................................................................................................................................
......................................................................................................................................................
F-30 Oracle iDS Reports: Build Internet Reports
................................
Appendix G: Using the Layout Editor
......................................................................................................................................................
Objectives
......................................................................................................................................................
G-2 Oracle iDS Reports: Build Internet Reports
Overview
......................................................................................................................................................
Overview
Introduction
In this lesson, you learn the graphical features of the Layout Editor common to Oracle
Forms Developer and Oracle Reports Developer. This will help you control the visual
arrangement and appearance of objects in your applications.
Objectives
After completing this lesson, you should be able to do the following:
• Control the position and size of objects in a layout
• Add lines and geometric shapes
• Define the colors and fonts used for text
• Color the body and boundaries of objects
• Import images onto the layout
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-3
Appendix G: Using the Layout Editor
......................................................................................................................................................
Common features:
• Moving and resizing objects and text
• Defining colors and fonts
• Importing and manipulating images and drawings
• Creating geometric lines and shapes
Layout types:
• Canvases in Forms
• Report layouts
......................................................................................................................................................
G-4 Oracle iDS Reports: Build Internet Reports
Why Use the Layout Editor?
......................................................................................................................................................
Layout Types
You can use the Layout Editor to control the visual layout in Oracle Forms Developer
and Oracle Reports Developer. The surfaces include:
• Canvas views in Forms
A canvas is the surface on which you arrange a form’s objects. Its view is the
portion of that canvas that is initially visible in a window at run time. You can also
see stacked or tabbed canvas views in the Layout Editor; their views might overlay
others in the same window. You can also display stacked views in the Layout
Editor.
• Layouts in Reports
Here, the Layout Editor lets you plan the format of a report. This includes the
frame structure of the report, as well as buttons, graphics, and background text
(boilerplate).
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-5
Appendix G: Using the Layout Editor
......................................................................................................................................................
......................................................................................................................................................
G-6 Oracle iDS Reports: Build Internet Reports
How to Access the Layout Editor
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-7
Appendix G: Using the Layout Editor
......................................................................................................................................................
5 2
4
Copyright Oracle Corporation, 2000. All rights reserved.
......................................................................................................................................................
G-8 Oracle iDS Reports: Build Internet Reports
Components of the Layout Editor
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-9
Appendix G: Using the Layout Editor
......................................................................................................................................................
Tool Palette
1
2 8
3 9
4 10
5 11
6 12
7 13
1 Select 8 Rotate
2 Magnify 9 Reshape
3 Rectangle 10 Line
4 Ellipse 11 Arc
5 Polygon 12 Polyline
6 Rounded rectangle 13 Freehand
7 Text
......................................................................................................................................................
G-10 Oracle iDS Reports: Build Internet Reports
Creating and Modifying Objects in the Layout
......................................................................................................................................................
Creating Text
The Text tool (T) lets you open a Boilerplate Text object on the layout. You can type
one or more lines of text into this object while it is selected with the Text tool. Uses of
text objects vary according to the Oracle Developer tool in which you create them.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-11
Appendix G: Using the Layout Editor
......................................................................................................................................................
Selecting Objects
Manipulating Objects
Expand/contract
in one direction
Expand/contract
diagonally
......................................................................................................................................................
G-12 Oracle iDS Reports: Build Internet Reports
Creating and Modifying Objects in the Layout
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-13
Appendix G: Using the Layout Editor
......................................................................................................................................................
......................................................................................................................................................
G-14 Oracle iDS Reports: Build Internet Reports
Creating and Modifying Objects in the Layout
......................................................................................................................................................
A Note on Grid-Snap Alignment You can ensure that all objects that you move
align with snap points that are defined on the grid. To activate these, select
View—>Snap to Grid from the menu. You can also use the View options to change the
grid-snap spacing and units.
Note: If you position an object using one grid-snap spacing, and then try to position
other objects under different settings, it may prove difficult to align them with each
other.
Try to stick to the same snap units, if you use grid-snap at all.
Overlapping Objects
You can position objects on top of each other. If they are transparent, then one object
can be seen through another (this is explained in detail later in this lesson).
Change the stacking order of overlapping objects by selecting the object to move and
then choosing the following as required, from the Arrange menu:
• Bring to Front
• Send to Back
• Move Forward
• Move Backward
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-15
Appendix G: Using the Layout Editor
......................................................................................................................................................
......................................................................................................................................................
G-16 Oracle iDS Reports: Build Internet Reports
Creating and Modifying Objects in the Layout
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-17
Appendix G: Using the Layout Editor
......................................................................................................................................................
Format Menu
......................................................................................................................................................
G-18 Oracle iDS Reports: Build Internet Reports
Formatting Objects in the Layout
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-19
Appendix G: Using the Layout Editor
......................................................................................................................................................
2
3
4
1 Sample window
2 Fill color/pattern
3 Line color
4 Text color
......................................................................................................................................................
G-20 Oracle iDS Reports: Build Internet Reports
Coloring Objects and Text
......................................................................................................................................................
Coloring Objects
You can separately color the fill area (body) of an object and its boundary line (a line
object has no body).
Coloring an Area
1 Select the objects whose color you want to change.
2 Select the Fill Color tool. The color palette appears.
If you want the objects to become transparent, select No Fill at the
bottom of the color palette window.
3 Select a color from those visible. If you want the fill area to be patterned
instead of plain, then select Patterns from the bottom of the color palette,
and follow the next step.
4 If you select Patterns, another window appears with patterns for you to
choose. Select one. You can define separate colors for the two shades of
the pattern by selecting the pattern color buttons at the bottom of the Fill
Pattern palette; each button opens a further color palette.
Coloring a Line
1 With the desired layout objects selected, click the Line Color tool. The
color palette opens.
2 Select the color for lines and bounding lines from this color palette.
Select No Line at the bottom of this window to remove the objects’
boundary lines.
Note: If you set both No Fill and No Line, the affected objects become invisible.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-21
Appendix G: Using the Layout Editor
......................................................................................................................................................
2
3
4
1 Sample window
2 Fill color/pattern
3 Line color
4 Text color
......................................................................................................................................................
G-22 Oracle iDS Reports: Build Internet Reports
Coloring Objects and Text
......................................................................................................................................................
Coloring Text
1 Select the textual objects whose color you want to change in the layout.
2 Select the Text Color tool. The color palette appears, showing the
available colors.
3 Select a color from those shown (click the appropriate square).
4 Notice that the selected objects on the layout have adopted the chosen
text color. Also, the sample area in the vertical toolbar shows a T with
the selected color, and this color appears next to the Text Color tool. This
indicates the current text color setting.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-23
Appendix G: Using the Layout Editor
......................................................................................................................................................
Importing Images
......................................................................................................................................................
G-24 Oracle iDS Reports: Build Internet Reports
Importing Images and Drawings
......................................................................................................................................................
Importing Drawings
You can import line art onto the layout from either the file system or the database.
Select File—>Import—>Drawing from the menus, and specify the source in the
Import dialog box. The format can be Oracle or a CGM file.
Importing Images
Select File—>Import—>Image from the menus, and set the Import Image options:
Option Description
(Radio buttons) File/Database Where to import from
Filename File to be imported
Format Image format (BMP, TIFF, PCX, PICT, GIF, CALS,
RAS, Oracle Format, and PCD [Kodak Photo CD])
Quality Range from Excellent to Poor. This is a trade-off
between image resolution and memory required.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-25
Appendix G: Using the Layout Editor
......................................................................................................................................................
Summary
......................................................................................................................................................
G-26 Oracle iDS Reports: Build Internet Reports
Summary
......................................................................................................................................................
Summary
• You can create objects by:
- Choosing the correct toolbar tool
- Clicking and dragging the layout region
• There are color palette tools for fill area, lines, and text.
• View, Arrange, and Format menus are available while you are in the
Layout Editor.
• You can group objects for operations.
• You can import images and drawings by selecting Edit—>Import.
......................................................................................................................................................
Oracle iDS Reports: Build Internet Reports G-27
Appendix G: Using the Layout Editor
......................................................................................................................................................
......................................................................................................................................................
G-28 Oracle iDS Reports: Build Internet Reports