Beruflich Dokumente
Kultur Dokumente
43211GC10
Production 1.0
January 1998
M06140
Author Copyright Oracle Corporation, 1997. All rights reserved.
Gunnar Boehrs 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 the Worldwide Education Services
Jacquelyn Bruce Crispell group of Oracle Corporation. Any other copying is a violation of copyright law and
Laurent Dereac may result in civil and/or criminal penalties.
Gillian Elias If this documentation is delivered to a U.S. Government Agency not within the
Pascal Gibert Department of Defense, then it is delivered with “Restricted Right,” as defined in
FAR 52.227-14, Rights in Data-General, including Alternate III (June 1987).
Steve Gramman
Marti Koppelmans The information in this document is subject to change without notice. If you find
any problems in the documentation, please report them in writing to Education
Steve Lirette Products, Oracle Corporation, 500 Oracle Parkway, Box 659806, Redwood
Jean Loup Lespine Shores, CA 94065. Oracle Corporation does not warrant that this document is
error-free.
Rita Morin
Vittavas Rattanamethawong Developer/2000, Designer/2000, PL/SQL, SQL*Plus, SQL*ReportWriter,
Discoverer 3, Oracle7, and Oracle8 are trademarks or registered trademarks of
Bryan Roberts Oracle Corporation.
Bert Salyga
All other products or company names are used for identification purposes only,
Jason Schiedemeyer and may be trademarks of their respective owners.
Hiroyuki Sugiyama
Kajornsak Sungcharoen
Pal Tarcsay
Bart van de Laar
Jack Walsh
Harry Wong
Publisher
Jade Arrington
Geraldine Freitas
Kelly Lee
Kimberly Lee
Contents
......................................................................................................................................................
Volume 1
Preface
Introduction
Overview I-3
Course Objectives I-5
Course Content I-7
Lesson 1: Introduction to Developer/2000
Overview 1-3
What Is Developer/2000? 1-5
Introducing the Developer/2000 Components 1-11
Common Builder Components 1-15
Getting Started in the Developer/2000 Interface 1-19
Navigating Around the Developer/2000 Main Menu 1-21
Customizing Your Developer/2000 Session 1-23
Developer/2000 Environment Variables 1-27
Invoking Online Help Facilities 1-29
Introducing the Course Application 1-31
Summary 1-33
Practice Session Overview: Lesson 1 1-35
Practice Session: Lesson 1 1-36
Lesson 2: Designing and Running Reports
Overview 2-3
Designing Reports 2-5
Design Considerations 2-7
Retrieving and Sharing Data 2-15
Running a Report 2-17
Viewing the Report Output 2-19
Summary 2-29
Practice Session Overview: Lesson 2 2-31
Practice Session: Lesson 2 2-32
......................................................................................................................................................
Developer/2000: Build Reports iii
Contents
......................................................................................................................................................
......................................................................................................................................................
iv Developer/2000: Build Reports
Contents
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports v
Contents
......................................................................................................................................................
......................................................................................................................................................
vi Developer/2000: Build Reports
Contents
......................................................................................................................................................
Volume 2
Lesson 12: Creating and Using Report Parameters
Overview 12-3
Creating User Parameters 12-5
Referencing Parameters in a Report Query 12-7
Hints and Tips for Referencing Parameters 12-13
Creating a List of Values 12-15
Referencing System Parameters 12-19
Building a Parameter Form 12-23
Summary 12-27
Practice Session Overview: Lesson 12 12-29
Practice Session: Lesson 12 12-30
Lesson 13: Embedding a Chart in a Report
Overview 13-3
Creating and Embedding a Graphics Chart in a Report 13-5
Embedding an Existing Chart in a Report 13-9
Summary 13-11
Practice Session Overview: Lesson 13 13-13
Practice Session 13-14
......................................................................................................................................................
Developer/2000: Build Reports vii
Contents
......................................................................................................................................................
......................................................................................................................................................
viii Developer/2000: Build Reports
Contents
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build 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-8
Practice Session Solutions: Lesson 2 A-9
Practice Session Overview: Lesson 3 A-15
Practice Session Solutions: Lesson 3 A-16
Practice Session Overview: Lesson 4 A-19
Practice Session Solutions: Lesson 4 A-20
Practice Session Overview: Lesson 5 A-25
Practice Session Solutions: Lesson 5 A-26
Practice Session Overview: Lesson 6 A-30
Practice Session Solutions: Lesson 6 A-31
Practice Session Overview: Lesson 7 A-34
Practice Session Solutions: Lesson 7 A-35
Practice Session Overview: Lesson 8 A-37
Practice Session Solutions: Lesson 8 A-38
Practice Session Overview: Lesson 9 A-43
Practice Session Solutions: Lesson 9 A-44
Practice Session Overview: Lesson 10 A-50
Practice Session Solutions: Lesson 10 A-51
Practice Session Overview: Lesson 11 A-56
Practice Session Solutions: Lesson 11 A-57
Practice Session Overview: Lesson 12 A-60
Practice Session Solutions: Lesson 12 A-61
Practice Session Overview: Lesson 13 A-65
Practice Session Solutions: Lesson 13 A-66
Practice Session Overview: Lesson 14 A-69
Practice Session Solutions: Lesson 14 A-70
Practice Session Overview: Lesson 15 A-75
Practice Session Solutions: Lesson 15 A-76
Practice Session Overview: Lesson 16 A-81
Practice Session Solutions: Lesson 16 A-82
Practice Session Overview: Lesson 17 A-91
Practice Session Solutions: Lesson 17 A-92
......................................................................................................................................................
x Developer/2000: Build Reports
Contents
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports xi
......................................................................................................................................................
xii Developer/2000: Build Reports
12
................................
Objectives
......................................................................................................................................................
12-2
Overview
......................................................................................................................................................
Overview
Introduction
Parameters allow you to develop dynamic report documents, that produce variable
report output depending on the parameter value that you enter at run time. This
lesson shows how to create and reference user and system parameters and how to
customize a parameter form to display parameters at run time.
Objectives
At the end of this lesson, you should be able to:
• Control report output by creating and referencing a parameter.
• Control parameter input, using a list of values.
• Manipulate reports at run time, using system parameters.
• Provide for user input of parameters by building a parameter form.
• Customize a parameter form layout.
......................................................................................................................................................
12-3
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
User Parameters
Can be used to:
• Restrict values in a WHERE clause
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
WHERE ID = <a value>
• Substitute any part of select statement
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
<a where clause>
• Substitute a single column or expression
SELECT <a column/expression>
FROM S_CUSTOMER
12-3 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
12-4
Creating User Parameters
......................................................................................................................................................
Parameter Properties
Property Description
Datatype Specify whether parameter value is character, number, or date;
default is Number when created in the Object Navigator.
Width Specify maximum allowable width of parameter value. Maximum
64KB.
Input Mask Allow users to enter a numeric or date value using a specific format.
Initial Value Specify the value to use. You can override this value at run time from
the command line or parameter form.
Validation Validate the parameter value. Enter a PL/SQL function.
Trigger
......................................................................................................................................................
12-5
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
Referencing Parameters in a
Report Query
Bind reference replaces a value
• :parameter_name
parameter object may be created by
default
Lexical reference replaces a clause
• ¶meter_name
parameter object is never created by
default
12-5 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
12-6
Referencing Parameters in a Report Query
......................................................................................................................................................
......................................................................................................................................................
12-7
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
......................................................................................................................................................
12-8
Referencing Parameters in a Report Query
......................................................................................................................................................
Example
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
WHERE ID = :P_CUST
The previous statement allows you to enter a specific customer number at run time.
So, if you enter 102, the WHERE clause uses the value 102 to restrict data fetched,
and fetch the one customer that has ID 102.
Example
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
ORDER BY DECODE(:SORT, 1, NAME, 2, STATE, COUNTRY)
The previous statement allows you to output different versions of the report:
• Enter 1 for the parameter SORT, to display the output ordered by customer
name.
• Enter 2, to display the output ordered by sales representative ID.
......................................................................................................................................................
12-9
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
......................................................................................................................................................
12-10
Referencing Parameters in a Report Query
......................................................................................................................................................
Examples
• The following statements use lexical references to substitute parts of the query
at run time.
• To specify a WHERE clause, ORDER BY clause, or both at run time (as two
separate parameters).
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
&P_WHERE_CLAUSE
&P_ORD_CLAUSE
• To specify a WHERE clause, ORDER BY, or both clause at run time (as one
parameter).
SELECT NAME, SALES_REP_ID
FROM S_CUSTOMER
&P_WHERE_ORD_CLAUSE
• To specify two column names and the table name(s) at run time:
SELECT &P_CUSTNAME CUST, &P_SALESREP REP
FROM &P_TABLE
Note: When you use lexical references in the SELECT list, you must, at run time,
specify the same number of items of the correct datatype, as defined in the Data
Model.
......................................................................................................................................................
12-11
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
......................................................................................................................................................
12-12
Hints and Tips for Referencing Parameters
......................................................................................................................................................
Example
The following statement does not cause a syntax error when P_ORDER_CLAUSE
is NULL.
SELECT...FROM...
&P_ORDER_CLAUSE
Remember to define an initial value for lexical parameters that affect validity of the
statement, and to validate those that you allow a user to enter at run time.
Note: Always use column aliases when substituting column names with lexical
references.
......................................................................................................................................................
12-13
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
2
3
4
5
......................................................................................................................................................
12-14
Creating a List of Values
......................................................................................................................................................
......................................................................................................................................................
12-15
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
1 3
4
2
......................................................................................................................................................
12-16
Creating a List of Values
......................................................................................................................................................
......................................................................................................................................................
12-17
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
System Parameters
......................................................................................................................................................
12-18
Referencing System Parameters
......................................................................................................................................................
......................................................................................................................................................
12-19
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
Initial Value £
......................................................................................................................................................
12-20
Referencing System Parameters
......................................................................................................................................................
......................................................................................................................................................
12-21
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
+ Report properties:
Width
Height
Number of Pages
12-13 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
12-22
Building a Parameter Form
......................................................................................................................................................
......................................................................................................................................................
12-23
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
PF_P_PAY_TYPE
P_PAY_TYPE
......................................................................................................................................................
12-24
Building a Parameter Form
......................................................................................................................................................
......................................................................................................................................................
12-25
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
Summary
• Parameter types
– User parameters: bind/lexical, LOVs
– System parameters
• Modifying values at runtime
– Command line arguments
– Runtime parameter form
• Creating a runtime parameter form
– Build: Parameter Form Builder
– Customize: Report Editor
12-15 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
12-26
Summary
......................................................................................................................................................
Summary
• Parameter types:
- User Parameters:
References: bind or lexical.
List of values: dynamic (bind only) or static.
- System Parameters.
• Modifying parameter values at run time:
- Pass the parameter on the R30RUN command line.
- Allow users to change values in the runtime parameter form.
• Creating a runtime parameter form:
a Build a parameter form with the Parameter Form Builder.
b Customize the parameter form layout in the Report editor.
......................................................................................................................................................
12-27
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
Practice 12 Overview
......................................................................................................................................................
12-28
Practice Session Overview: Lesson 12
......................................................................................................................................................
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.
......................................................................................................................................................
12-29
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
......................................................................................................................................................
12-30
Practice Session: Lesson 12
......................................................................................................................................................
......................................................................................................................................................
12-31
Lesson 12: Creating and Using Report Parameters
......................................................................................................................................................
......................................................................................................................................................
12-32
13
................................
Embedding a Chart in a
Report
Lesson 13: Embedding a Chart in a Report
......................................................................................................................................................
Objectives
......................................................................................................................................................
13-2
Overview
......................................................................................................................................................
Overview
Introduction
In this lesson you learn to display a Developer/2000 graphical chart in a report at
run time.
Objectives
At the end of this lesson, you should be able to:
• Create and display a simple Graphics chart in a report, using the Chart wizard.
• Display an existing Graphics chart in a report.
• Explain how to modify data dynamically in an existing chart.
......................................................................................................................................................
13-3
Lesson 13: Embedding a Chart in a Report
......................................................................................................................................................
Creating a Chart
......................................................................................................................................................
13-4
Creating and Embedding a Graphics Chart in a Report
......................................................................................................................................................
......................................................................................................................................................
13-5
Lesson 13: Embedding a Chart in a Report
......................................................................................................................................................
......................................................................................................................................................
13-6
Creating and Embedding a Graphics Chart in a Report
......................................................................................................................................................
......................................................................................................................................................
13-7
Lesson 13: Embedding a Chart in a Report
......................................................................................................................................................
1
2 D_empchart
3 disp1.ogd
......................................................................................................................................................
13-8
Embedding an Existing Chart in a Report
......................................................................................................................................................
......................................................................................................................................................
13-9
Lesson 13: Embedding a Chart in a Report
......................................................................................................................................................
Summary
• Build new chart:
– Invoke Chart wizard to build and
embed a chart.
– Enhance chart in Graphics Builder.
• Embed existing chart:
– Create display object.
– Link to chart filename.
– Pass parameters or column values.
......................................................................................................................................................
13-10
Summary
......................................................................................................................................................
Summary
• Use the Chart wizard to create and embed a simple chart in your report.
• Reenter the Chart wizard to make changes to the chart object, such as its
position in the report.
• Use Developer/2000 Graphics Builder to enhance and modify the chart
definition.
• Create a display object in the Layout Model, to embed a chart that already exists
in an .ogd file. Enter the chart (.ogd) filename.
• Pass parameters or column values from a report to a chart to restrict values or
data records, if the chart contains a separate SQL query.
......................................................................................................................................................
13-11
Lesson 13: Embedding a Chart in a Report
......................................................................................................................................................
Practice 13 Overview
......................................................................................................................................................
13-12
Practice Session Overview: Lesson 13
......................................................................................................................................................
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 for a chart.
......................................................................................................................................................
13-13
Lesson 13: Embedding a Chart in a Report
......................................................................................................................................................
Practice Session
1 Open report p12q1.rdf.
a Remove all reference to the parameter P_CUSTOMER from the
query.
b Rename SumLine_totalPerNAME to Total. (A shorter name looks
better in a chart.)
c Use the Chart wizard to create a line chart.
......................................................................................................................................................
13-14
Practice Session
......................................................................................................................................................
b In the Layout editor move the chart beneath the product group and
resize it to the same width as the product group.
c Run and test the report.
d Close the Graphics Batch.
e Create a second chart for the customer group
Chart Type Pie
Chart Subtype Plain
Data Group G_customer
Category CUSTOMER_ID
Value CUST_TOTAL
Chart Frequency Once per Name
File Name p13q3e.ogd
f In the Layout editor move the chart beneath the customer group.
Hint: Create a frame around both charts, so that they always display side by
side.
g Run and test the report.
h Close the Graphics Batch.
i Save the report to p13q3.rdf and close it.
......................................................................................................................................................
13-15
Lesson 13: Embedding a Chart in a Report
......................................................................................................................................................
......................................................................................................................................................
13-16
14
................................
Objectives
......................................................................................................................................................
14-2
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 and matrix with group report using
the Report wizard.
In this lesson, you modify the data model and layout objects to enhance your matrix
reports.
Objectives
At the end of this lesson, you should be able to:
• Design a matrix Data Model.
• Design a matrix Layout Model.
• Modify a matrix structure.
• Create additional matrix summaries.
• Display zeros in cells with no value.
......................................................................................................................................................
14-3
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
1 4
5
3
14-3 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
14-4
The Matrix Data Model
......................................................................................................................................................
......................................................................................................................................................
14-5
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
1 2 3 4
14-4 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
14-6
Matrix Layout
......................................................................................................................................................
Matrix Layout
Introduction
Although the supplied templates create good looking, professional report output,
they do not help to explain the layout objects in a classroom environment. The
number of objects and their interdependency are more complex in matrix reports
than in the other styles we have seen so far.
This section explains the objects by showing an ‘expanded’ layout where each outer
object is slightly larger than its contents.
......................................................................................................................................................
14-7
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
3
14-5 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
14-8
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.
......................................................................................................................................................
14-9
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
......................................................................................................................................................
14-10
Building a Nested Matrix
......................................................................................................................................................
What Is the Difference Between a Nested Matrix and a Matrix with Group?
• Matrix with Group Data Model: The cross product group is the child of a parent
break group at a level above and outside the cross product.
• Nested Matrix Data Model: The cross product contains three or more groups:
one or more levels of break group, and two dimensional groups to form rows
and columns.
Note: You can mix these styles. That is, you can create a Matrix with Group report,
where the matrix has several nested levels within it.
......................................................................................................................................................
14-11
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
......................................................................................................................................................
14-12
Building a Nested Matrix
......................................................................................................................................................
......................................................................................................................................................
14-13
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
F_SumSALARY F_SumSALPerDEPT
F_Sum_REG_NAME
F_SumSALPerTITLE
......................................................................................................................................................
14-14
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 table below shows the property settings.
......................................................................................................................................................
14-15
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
Displaying Zeros
......................................................................................................................................................
14-16
Building a Nested Matrix
......................................................................................................................................................
......................................................................................................................................................
14-17
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
Summary
• Create matrix with the wizard.
• Consider creating or modifying a
template with extra spacing.
• Data and layout reflect cross product
structure.
• Matrix-specific:
– Cross Product group
– Product Order property
– Matrix layout object
14-11 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
14-18
Summary
......................................................................................................................................................
Summary
Let 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: Remember, 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.
......................................................................................................................................................
14-19
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
Practice 14 Overview
• Opening and changing an existing
matrix report
• Building a nested matrix report
• Adding summaries to the nested matrix
report
• Displaying zeros for summary values
and restricting columns per page
• Displaying more meaningful column
information and rotating the text
......................................................................................................................................................
14-20
Practice Session Overview: Lesson 14
......................................................................................................................................................
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.
......................................................................................................................................................
14-21
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
......................................................................................................................................................
14-22
Practice Session: Lesson 14
......................................................................................................................................................
......................................................................................................................................................
14-23
Lesson 14: Enhancing Matrix Reports
......................................................................................................................................................
......................................................................................................................................................
14-24
15
................................
Objectives
......................................................................................................................................................
15-2
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
At the end of this lesson, you should be able to:
• Describe the different types of trigger.
• Describe sample uses of the different types of trigger.
• Write and reference common code.
• Create and reference a PL/SQL library.
......................................................................................................................................................
15-3
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
Trigger Code
Parameter
boolean
Boolean:
true
false
Column
Number Character
Number
Date
......................................................................................................................................................
15-4
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 datatype in the function declaration.
......................................................................................................................................................
15-5
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
1 2 if readonly=yes 3
F
if > 1 page
After Between After
Before page1 page2
Parameter Pages Report
Report
Form
F F
......................................................................................................................................................
15-6
Using Report Triggers
......................................................................................................................................................
......................................................................................................................................................
15-7
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
• Query syntax:
SELECT ID, NAME
FROM CUSTOMER
&p_where_clause
ORDER BY NAME
......................................................................................................................................................
15-8
Using Report Triggers
......................................................................................................................................................
......................................................................................................................................................
15-9
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
......................................................................................................................................................
15-10
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 Press the button for the PL/SQL Filter property to open the PL/SQL editor.
4 Enter the code. This filter code must return a boolean value, true or false.
Note: It is more efficient to use a WHERE clause in a query when possible. We
cannot use a WHERE clause in this case, because we want to process all records,
and call the function for some.
......................................................................................................................................................
15-11
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
......................................................................................................................................................
15-12
Using Data Model Triggers
......................................................................................................................................................
Example
To prevent report output being sent directly to a printer, test the value of the
DESTYPE system parameter.
1 Open the property palette for the DESTYPE parameter.
2 Choose Validation Trigger to open the PL/SQL editor.
3 Enter the code; ensure the value Printer has an initial capital.
......................................................................................................................................................
15-13
Lesson 15: 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
......................................................................................................................................................
15-14
Using Layout Model Triggers
......................................................................................................................................................
......................................................................................................................................................
15-15
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
......................................................................................................................................................
15-16
Using Layout Model Triggers
......................................................................................................................................................
Steps
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;
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: 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.
......................................................................................................................................................
15-17
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
1 3
15-11 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
15-18
Using Layout Model Triggers
......................................................................................................................................................
Steps
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):
function pay_clerks_see_this return boolean is
begin
if :user_type = ’PAY_CLERK’ then
return(true);
else
return(false);
end if;
......................................................................................................................................................
15-19
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
Employee Details
Employee Details
Ngao 08-MAR-90
Biri 07-APR-91
Magee14-MAY-90
2
15-12 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
15-20
Using Layout Model Triggers
......................................................................................................................................................
Steps
1 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;
In this example you do not need to create any additional layout object or code.
......................................................................................................................................................
15-21
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
......................................................................................................................................................
15-22
Using Layout Model Triggers
......................................................................................................................................................
Steps
1 Code a format trigger on the optional field to suppress the field when the value is
NULL.
2 Create an anchor from the field below, up to the optional field. Set the “Collapse
Vertically” property to Yes. Repeat for all fields below the optional field to avoid
any unwanted space in the label.
......................................................................................................................................................
15-23
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
1 2
3 4
FUNCTION spacing RETURN BOOLEAN IS
BEGIN
IF MOD(:count_column, 3) = 0 THEN
RETURN(TRUE);
ELSE
RETURN(FALSE);
END IF;
END;
15-14 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
15-24
Using Layout Model Triggers
......................................................................................................................................................
Steps
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.
......................................................................................................................................................
15-25
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
......................................................................................................................................................
15-26
Writing Common Code
......................................................................................................................................................
......................................................................................................................................................
15-27
Lesson 15: 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
15-16 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
15-28
Summary
......................................................................................................................................................
Summary
Using PL/SQL Triggers
Choose 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 or how they are
processed.
Layout triggers affect the way in which objects are formatted.
......................................................................................................................................................
15-29
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
Practice 15 Overview
......................................................................................................................................................
15-30
Practice Session Overview: Lesson 15
......................................................................................................................................................
Introduction
In this practice session, you create a format trigger 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.
......................................................................................................................................................
15-31
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
Group Column
G_CUSTOMER CUSTOMER_ID
G_ID ID
DATE_ORDERED
DATE_SHIPPED
PAYMENT_TYPE
TOTAL
c Create a Tabular layout using the following columns from the query:
Column
ID
DATE_ORDERED
DATE_SHIPPED
TOTAL
d Ensure that only the Group Above layout displays when you choose
a destination of Screen, and only the Tabular layout displays when
you choose a destination of Preview.
To test the result, display the DESTYPE parameter in the report.
Ensure that you can enter a parameter value at run time.
e Save the report as p15q1.rdf.
......................................................................................................................................................
15-32
Practice Session: Lesson 15
......................................................................................................................................................
......................................................................................................................................................
15-33
Lesson 15: Coding PL/SQL Triggers in Reports
......................................................................................................................................................
......................................................................................................................................................
15-34
16
................................
Objectives
......................................................................................................................................................
16-2
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
At the end of this lesson, you should be able to:
• 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.
......................................................................................................................................................
16-3
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
SRW.BREAK SRW.DO_SQL
SRW.SET_ATTR SRW.RUN_REPORT
SRW.REFERENCE SRW.MESSAGE
SRW.USER_EXIT SRW.TRACE
SRW.SET_MAXROW SRW.PROGRAM_ABORT
......................................................................................................................................................
16-4
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,
SRW.DO_SQL.
......................................................................................................................................................
16-5
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
Outputting Messages
Warning
WHEN <exception> THEN
SRW.MESSAGE(999,
'Warning: report continues');
Error
WHEN <exception> THEN
SRW.MESSAGE(999,
'Error: report terminated');
RAISE SRW.PROGRAM_ABORT;
Exceptions
SRW.INTEGER_ERROR
SRW.NULL_ARGUMENTS
16-4 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
16-6
Outputting Messages
......................................................................................................................................................
Outputting Messages
Introduction
The SRW.MESSAGE packaged procedure displays a message with a code and text
string, which you specify. The message displays in the following format:
MSG-code: text
The message displays 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 either the code number, or text message,
or both.
......................................................................................................................................................
16-7
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
Executing a Report
1 BLOGGS.LIS 2
BLOGGS xxx xxxxxxx
xxx xxxxxxx
SMITH
SMITH.LIS
......................................................................................................................................................
16-8
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.
......................................................................................................................................................
16-9
Lesson 16: 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_BATCHNO
Function:
SRW.GETERR_RUN
......................................................................................................................................................
16-10
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.
......................................................................................................................................................
16-11
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
41 Details 42
xxxxxxxxx
42 Details
SRW.RUN_REPORT xxxxxxxxx
xxxxxxxxx
43 Details
xxxxxxxxx
......................................................................................................................................................
16-12
Executing a Nested Report
......................................................................................................................................................
......................................................................................................................................................
16-13
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
Restricting Data
Before Report trigger
SRW.SET_MAXROW('Q_EMP',3);
Q_EMP ID LAST_NAME
G_EMP 1 BLOGGS
2 SMITH
ID 3 JONES
LAST_NAME
......................................................................................................................................................
16-14
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 runtime 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.
......................................................................................................................................................
16-15
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
Initializing Fields
Layout editor Output: logical
page no. = 2
Page: F_NEWPAGE
Page: 5
1
FUNCTION F_LOGICAL_PAGEFormatTrigger
RETURN BOOLEAN IS
my_page number;
BEGIN
SRW.GET_PAGE_NUM(my_page); 2
SRW.SET_FIELD_NUM(0,my_page+3);
RETURN(TRUE);
END;
16-9 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
16-16
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 only relevant 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 + 3 in a field called
F_NEWPAGE.
Because the logical page number variable is only available 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 function 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.
......................................................................................................................................................
16-17
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
Exception
SRW.DO_SQL_FAILURE
16-10 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
16-18
Performing DDL Statements
......................................................................................................................................................
......................................................................................................................................................
16-19
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
Values
Eyes = glasses
Nose = big
Mouth = mustache
Apply
Wear the mask
16-11 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
16-20
Setting Format Attributes
......................................................................................................................................................
......................................................................................................................................................
16-21
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
What attributes?
SRW.ATTR.MASK := SRW.GCOLOR_ATTR +
SRW.WEIGHT_ATTR;
What values?
SRW.GCOLOR_ATTR := 'magenta';
SRW.WEIGHT_ATTR := SRW.BOLD_WEIGHT;
Apply mask
SRW.SET_ATTR(0,SRW.ATTR);
......................................................................................................................................................
16-22
Setting Format Attributes
......................................................................................................................................................
Example
Conditionally set the following attributes if salary equals 2000:
Attribute Value
Text weight Bold
Text style Underline
Text color Magenta
Text justification Centered
......................................................................................................................................................
16-23
Lesson 16: 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
16-13 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
16-24
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 layout formatting and display using SRW.SET_ATTR and the
many SRW attributes
......................................................................................................................................................
16-25
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
Practice 16 Overview
......................................................................................................................................................
16-26
Practice Session Overview: Lesson 16
......................................................................................................................................................
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.
......................................................................................................................................................
16-27
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
......................................................................................................................................................
16-28
Practice Session: Lesson 16
......................................................................................................................................................
b The same trigger should also insert the current date, userid and
“Starting Report” into this table.
INSERT INTO RUNREPORT
(DATE_RUN, USER_RUN, COMMENTS)
VALUES (SYSDATE, USER, ’Starting Report’)
......................................................................................................................................................
16-29
Lesson 16: Using the Report Builder Built-In Package
......................................................................................................................................................
i Try running the report more than once. When you run the report a
second time, the table already exists and Report Builder raises an
exception. Make the necessary change to your code so that the report
runs even when the table exists.
j Write a trigger that inserts a record with the comment “Printing
another page” whenever it begins a new page.
k Write a trigger that inserts a record with the comment “Report
completed” when the report finishes.
l Save and run the report. Verify the results in SQL*Plus.
......................................................................................................................................................
16-30
17
................................
Maximizing Performance
Using the Reports Server
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
Objectives
......................................................................................................................................................
17-2
Overview
......................................................................................................................................................
Overview
Introduction
In this lesson you learn how to control and monitor a remote Reports Server
installation, and how to view and schedule reports sent from a client to the Reports
Server.
Objectives
At the end of this lesson, you should be able to:
• Distinguish between local client and remote server reporting.
• Describe the three-tiered architecture of Report Builder.
• View and schedule server-side reports using the Queue Manager.
......................................................................................................................................................
17-3
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
Client reporting
• All processing and
formatting is done on the
client.
– Suitable for small and
medium size reports.
DB
• Everyone runs the same
report again and again,
Developer/2000
no sharing.
Release 1
17-3 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
17-4
Why Use a Remote Server?
......................................................................................................................................................
......................................................................................................................................................
17-5
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
reports
DB DB
• Enhances scalability
and performance Developer/2000
Release 2
17-4 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
17-6
Why Use a Remote Server?
......................................................................................................................................................
......................................................................................................................................................
17-7
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
Application server
(Unix/NT) R30MTS
DB
server DB DB
17-5 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
17-8
Reports Server Architecture and Configuration
......................................................................................................................................................
Client Tier
The client tier is a front-end machine that sends commands to the remote Reports
Server.
• Invoke the executable R30CLI to schedule a report from the command line.
• Invoke the Queue Manager (R30RQM) to view and schedule reports.
• Start up the Reports Server manually from the Queue Manager, or start it from
the command line.
Application Tier
The middle application tier contains the remote Reports Server, which can consist
of multiple runtime engines.
• You can use multiple Reports Servers to execute reports.
• A Reports Server spawns extra runtime engines as necessary, depending on a
parameter in a server initiation file.
• Each runtime engine dies off when there are no jobs to run and when it has been
idle for a set time.
......................................................................................................................................................
17-9
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
......................................................................................................................................................
17-10
Reports Server Architecture and Configuration
......................................................................................................................................................
Example
1 Invoke the command line. In Windows NT, Choose Start—>Run.
2 Enter the command string, for example:
R30CLI32.EXE SERVER=repserver1 REPORT=my_rep.rdf DESTYPE=FILE
DESNAME=my_rep.pdf DESFORMAT=pdf
This command sends the report to the remote server, and the report runs
immediately.
......................................................................................................................................................
17-11
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
R30CLI...
SCHEDULE=hourly_from_09:00am_May_01,_1999
TIME
17-7 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
17-12
Reports Server Architecture and Configuration
......................................................................................................................................................
Syntax
The full syntax of the SCHED
ULE parameter is:
where:
TIME = CLOCK [DATE] [INCR]
CLOCK = <hh:mm>
DATE=<calendar date>
INCR = {+LEN} | {next SUFFIC}
LEN = {n} * SUFFIX
SUFFIX = <time, date, FREQ>
[FREQ from] TIME
Example
SCHEDULE=hourly_from_09:00am_May_01,_1999
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 we use
later in this course.
......................................................................................................................................................
17-13
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
Reports Caching
......................................................................................................................................................
17-14
Reports Server Architecture and Configuration
......................................................................................................................................................
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 the Reports Server 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
The Reports Server uses a parameter CACHEDIR to determine where to place the
cached output.
The default directory is <oracle_home>\report30\server\cache.
......................................................................................................................................................
17-15
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
......................................................................................................................................................
17-16
Reports Server Architecture and Configuration
......................................................................................................................................................
Parameter Description
NAME A server name that exists in tnsnames.ora file
INITENGINE Number of runtime engines running after you invoke Reports Server
MINENGINE Minimum number of engines running per server at any time; default = 0
MAXENGINE Maximum number of engines running per server at any time; default = 1
MAXIDLE Maximum time for an engine to remain idle before it is shut down;
default = 30 (minutes)
......................................................................................................................................................
17-17
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
......................................................................................................................................................
17-18
Reports Server Architecture and Configuration
......................................................................................................................................................
Parameter Description
INTERACTIVE Enable Reports Server to send output to screen/preview (Y or N)
MAXCONNECT Number of Reports Server connections and number of ISV connections
SOURCEDIR Directory that Reports Server initially searches for source (.rdf, .rep)
file
CACHEDIR Output directory of cached report
CACHESIZE Size determines how big cache can be
TEMPDIR Directory that Reports Server uses for temporary filespace; if not speci-
fied, default = REPORTS30_TMP path
SECURITY Level of access, 0 to 3, for accessing cached output files through Queue
Manager. 0 = anyone; 1 = same userid, 2 = same process, 3 = none;
default = 1
ENGLIFE Maximum number of reports run before engine shuts down and is
replaced; default = 200
......................................................................................................................................................
17-19
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
• TNSNAMES.ORA in
<oracle_home>\network\admin
my_server = (ADDRESS = (PROTOCOL = TCP) (Host =
144.25.87.137)(Port = 1949) )
......................................................................................................................................................
17-20
Reports Server Architecture and Configuration
......................................................................................................................................................
• R30CLI uses the alias name on the client machine to identify the server to which
you want to send your report:
R30CLI server=my_server report=my_report...
Technical Note
The Reports Server requires SQL*Net 2.3. When installing Report Builder, 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.
......................................................................................................................................................
17-21
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
......................................................................................................................................................
17-22
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 Server. At the
login prompt, choose any username and password to assign as Administrator.
......................................................................................................................................................
17-23
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
Queue Manager
Past jobs
Current jobs
Scheduled jobs
Queue Manager
All my jobs
All jobs
Refresh
......................................................................................................................................................
17-24
Viewing and Scheduling Reports in the Queue Manager
......................................................................................................................................................
......................................................................................................................................................
17-25
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
......................................................................................................................................................
17-26
Viewing and Scheduling Reports in the Queue Manager
......................................................................................................................................................
This option remains grayed out if you are not logged on as administrator.
......................................................................................................................................................
17-27
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
• <oracle_home>\bin\R30SXU32.OCX
• Embed in any ActiveX container
• Run report with a call to:
– R30RBE
– R30MTS
......................................................................................................................................................
17-28
Viewing and Scheduling Reports in the Queue Manager
......................................................................................................................................................
......................................................................................................................................................
17-29
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
Summary
Reports Server provides
• Increased efficiency
• Three-tiered architecture
• Reports client (R30CLI)
• Reports Server (R30MTS)
• Reports caching
• Status view and rescheduling (R30RQM)
• ActiveX control for other applications
......................................................................................................................................................
17-30
Summary
......................................................................................................................................................
Summary
The new remote Reports Server provides increased efficiency and scalability for
large reports.
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 Server ActiveX control in other Windows applications,
to run and schedule reports.
......................................................................................................................................................
17-31
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
Practice 17 Overview
......................................................................................................................................................
17-32
Practice Session Overview: Lesson 17
......................................................................................................................................................
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.
......................................................................................................................................................
17-33
Lesson 17: Maximizing Performance Using the Reports Server
......................................................................................................................................................
......................................................................................................................................................
17-34
18
................................
Objectives
......................................................................................................................................................
18-2
Overview
......................................................................................................................................................
Overview
Introduction
Developer/2000 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 learn how to build
reports to run on various platforms, and in different environments and languages.
Objectives
At the end of this lesson, you should be able to:
• Build and run reports in different environments, using the MODE parameter.
• Describe the considerations when building reports for different graphical user
interfaces (GUIs).
• Recognize the settings necessary to build character mode reports.
• Describe the facilities available for building reports to run in other languages.
......................................................................................................................................................
18-3
Lesson 18: Building Reports for Different Environments
......................................................................................................................................................
......................................................................................................................................................
18-4
Different Development and Runtime 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.
......................................................................................................................................................
18-5
Lesson 18: Building Reports for Different Environments
......................................................................................................................................................
......................................................................................................................................................
18-6
Developing Reports to Run in Different GUIs
......................................................................................................................................................
Example
In 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”
Beware of Dots-Per-Inch
The dots-per-inch (DPI) might differ between machines, even if they both use the
same GUI. This only affects how alphanumeric characters wordwrap on the screen.
Therefore, if you design a report that displays in the previewer, try to use the same
DPI as the users who will eventually run the report.
......................................................................................................................................................
18-7
Lesson 18: Building Reports for Different Environments
......................................................................................................................................................
......................................................................................................................................................
18-8
Building Character Mode Reports
......................................................................................................................................................
Avoid Borders
Border behavior differs between the environments. If you must use borders in
character mode reports, select the Convert Borders check box under the character
mode in the report property palette. This option displays borders in the Layout
editor more effectively.
......................................................................................................................................................
18-9
Lesson 18: Building Reports for Different Environments
......................................................................................................................................................
......................................................................................................................................................
18-10
Building Character Mode Reports
......................................................................................................................................................
Font
Choose a font, before creating any layout, which converts successfully to
ASCII/EBCDIC characters, such as Courier. The character template provides a
suitable font.
Text styles of Underline, Inverted, and Blink convert to character mode attributes
Underline, Reverse Video, and Blink, but only if you use a character mode terminal
definition that supports those attributes. Similarly, the text weight of Medium may
convert to bold.
Color
Avoid the use of color; Report Builder assigns colors to fill patterns.
Fill Patterns
Avoid the use of fill patterns; a transparent fill successfully converts to a character
mode transparent fill, but all other fill patterns convert to a solid fill.
Format Attributes
Only certain mask attributes apply in character mode when using the
SRW.SET_ATTR procedure. Report Builder ignores bitmapped codes when
running the report in character mode, and vice versa. You can therefore include both
bitmapped and character-mode attributes in the same report if you want it to run in
both environments.
Printer Codes
You can include printer codes in your reports in preparation for running in character
mode; Report Builder ignores the codes if you run the report in bitmapped mode.
......................................................................................................................................................
18-11
Lesson 18: Building Reports for Different Environments
......................................................................................................................................................
NLS_LANG=French_France.WE8DEC
• UNICODE
NLS_LANG=<lang>_<territory>.AL24UTFFSS
......................................................................................................................................................
18-12
Building Reports to Run in Different Languages
......................................................................................................................................................
Syntax
NLS_LANG = <language>_<territory>.character_set
• Language: language conventions for displaying messages, and day and month
names
• Territory: conventions for default date format, and for displaying currency,
decimal and thousands symbols
• Character_set: character set in which data is displayed
Example
NLS_LANG=French_France.WE8DEC
Syntax
NLS_LANG = <language>_<territory>.AL24UTFFSS
......................................................................................................................................................
18-13
Lesson 18: Building Reports for Different Environments
......................................................................................................................................................
Translating a Developer/2000
Application
Use Translation Builder to:
• Extract strings; import into repository
• Execute translation
• Merge back into original resource
Consider:
• Format masks
• Hardcoded strings
• Multiple character sets
18-8 Copyright Oracle Corporation, 1998. All rights reserved.
......................................................................................................................................................
18-14
Building Reports to Run in Different Languages
......................................................................................................................................................
......................................................................................................................................................
18-15
Lesson 18: Building Reports for Different Environments
......................................................................................................................................................
Summary
• GUIs:
– Colors, uifont.ali
• Character mode:
– Templates, report properties, MODE
parameter
• Languages:
– NLS, Unicode, Translation Builder
......................................................................................................................................................
18-16
Summary
......................................................................................................................................................
Summary
• Building reports to run on different GUIs
- If reports must run on different GUIs, remember to use common features,
such as the common color names.
- Use uifont.ali to map different fonts if necessary.
• Building character mode reports
- Use the character template.
- Copy the template and rename it to create several templates with different
settings, such as page sizes.
- The MODE parameter enables you to switch from bitmap to character mode.
• Building reports to run in different languages
- Developer/2000 provides National Language Support.
- Developer/2000 provides Unicode support to handle multiple character sets
in one application.
- Translation Builder supports and manages translations of extracted text
strings.
......................................................................................................................................................
18-17
Lesson 18: Building Reports for Different Environments
......................................................................................................................................................
......................................................................................................................................................
18-18
A
................................
Solutions
Appendix A: Solutions
......................................................................................................................................................
Instructor Note
This practice is intended to serve the following purposes:
• Make students familiar and at-ease with the interface and Help system
• Show them the level and extent of information that is available
• Encourage them to seek help in the product and not expect every small detail to
be taught in the next four days
Suggestion: To make this exercise more entertaining and enjoyable, as well as
encourage interaction among the class, use this exercise as a class fact-finding
mission.
Divide students into groups and ask each group to concentrate on one group of
questions, for question numbers 8 to 11. Encourage them to work together. Then
allow time for each group to present the answers to the rest of the class.
You need a Web browser to use the manuals and the Quick Tour. Advise students
which browser to use, when they initialize the Web browser in Question 10.
To ensure the reports used in the next section are compiled for your
environment there is an optional practice at the end to compile all necessary
reports from the Project Builder. Give students the project directory name
(one level above the \Demo directory) and the connect string. They must
enter these properties for the project, Dev/2000: Build Reports course,
before they compile the files. We recommend you do this question first, if
you want to, so that you can step the students through it.
......................................................................................................................................................
A-2 Developer/2000: Build Reports
Practice Session Solutions: Lesson 1
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-3
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-4 Developer/2000: Build Reports
Practice Session Solutions: Lesson 1
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-5
Appendix A: Solutions
......................................................................................................................................................
b In the Getting Started Manual, what are the five topics included in
Administrative Procedures?
Expand the node Developer/2000: Getting Started in the Oracle
Information Navigator.
Choose Developer/2000 -- Index
Go to Administrative Procedures
The five topics are:
Building Developer/2000 Database Tables
Using the Database Tables
Granting and Revoking User Access
Deleting the Developer/2000 Database Tables
Upgrading the Developer/2000 Database Tables
c In Designing Portable Applications, what is the purpose of section
5.3?
Expand the node Developer/2000: Guidelines for Building
Applications in the Oracle Information Navigator.
Choose Designing Portable Applications.
Section 5.3 discusses developing a report for maximum
portability.
d Name the three language environment variables available when
developing multilingual applications.
Choose Developer/2000 Index in the Oracle Information
Navigator.
Go to multilingual applications in the index.
The three environment variables are:
DEVELOPER_NLS_LANG
NLS_LANG
USER_NLS_LANG
......................................................................................................................................................
A-6 Developer/2000: Build Reports
Practice Session Solutions: Lesson 1
......................................................................................................................................................
11 Use Quick Tour to find out how to prepare a report for the World Wide
Web.
Choose Help—>Quick Tour from the menu.
In the Web browser, choose Report Builder, then choose Preparing a
Report for the World Wide Web.
a What changes do you have to make to your report to deploy it on the
Web?
Page 2 of 9: You can prepare an existing report for the World
Wide Web without making any changes to the report.
b What output formats can you choose from?
Page 4 of 9: You can choose from HTML or PDF output formats.
c What is the Web wizard?
Page 5 of 9: For reports that run infrequently, you can use the
Web wizard each time you run your report to post the updated
output on the Web.
d How can you dynamically deploy a report on The Web?
Page 5 of 9: For reports that run frequently, you should
implement dynamic Web reporting using the Reports Server and
the Reports Web Cartridge or Web CGI.
Optional Practice
12 Your instructor may ask you to do the following practice to prepare some
reports for the next practice session.
a In Project Builder, select the project “Developer/2000: Build Reports
course”. In the menu, choose Tools—>Property Palette, or use the
right mouse button.
b Under the General Information node, enter the Project directory
name that the instructor gives you.
c Under the Connection node, enter the username, password, and
database string that the instructor gives you.
d In the Object Navigator, select the node “Reports to be compiled”. It
is a subproject of the Reports course project that you opened.
e Choose Project—>Compile Selection from the menu. This creates
the runtime files that you need for the next practice session.
......................................................................................................................................................
Developer/2000: Build Reports A-7
Appendix A: Solutions
......................................................................................................................................................
Introduction
Before you learn to develop reports in the Builder, you should investigate the
runtime 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.
......................................................................................................................................................
A-8 Developer/2000: Build Reports
Practice Session Solutions: Lesson 2
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-9
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-10 Developer/2000: Build Reports
Practice Session Solutions: Lesson 2
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-11
Appendix A: Solutions
......................................................................................................................................................
e Close the Previewer window. You are now back in the Runtime
window.
In the Previewer choose Close Previewer.
f Run the report again, this time do not specify a customer ID.
From the menu choose File—>Run. The File Browse window
displays. Select p2q6.rep and choose Open, then immediately
Run Report without entering a value for customer ID.
i What is the result?
The result is that the report does run; however it does not display any
data. There are no NULL customer IDs.
ii In a production situation, what should happen in this instance?
The user should be prevented from entering a NULL value or a blank.
In later lessons you will see how this can be implemented.
g Close the Previewer window. You are now back in the Runtime
window.
In the Previewer choose Close Previewer.
h Run the report again, this time enter Customer Id 999.
From the menu choose File—>Run. The File Browse window
displays. Select p2q6.rep and choose Open. Enter the customer
ID 999, and choose Run Report.
i What is the result?
The result is that the report does run; however it does not display any
data. There is no customer ID 999.
ii In a production situation, what should happen in this instance?
The user should be prevented from entering an invalid value. In later
lessons you will see how this can be implemented.
i Close the Previewer window. You are now back in the Runtime
window
In the Previewer choose Close Previewer.
......................................................................................................................................................
A-12 Developer/2000: Build Reports
Practice Session Solutions: Lesson 2
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-13
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-14 Developer/2000: Build Reports
Practice Session Overview: Lesson 3
......................................................................................................................................................
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.
......................................................................................................................................................
Developer/2000: Build Reports A-15
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-16 Developer/2000: Build Reports
Practice Session Solutions: Lesson 3
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-17
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-18 Developer/2000: Build Reports
Practice Session Overview: Lesson 4
......................................................................................................................................................
Introduction
The questions in the practice session are intended to ensure that you have a good
understanding of how to create various styles of report using the Report wizard.
Note: When you are completing the practice sessions, please keep to file naming
conventions that the questions specify. You might need these files in later practices.
In addition, please 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, please ensure you
use Save As, not Save, so that you do not overwrite the existing file name.
......................................................................................................................................................
Developer/2000: Build Reports A-19
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-20 Developer/2000: Build Reports
Practice Session Solutions: Lesson 4
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-21
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-22 Developer/2000: Build Reports
Practice Session Solutions: Lesson 4
......................................................................................................................................................
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 choose Form Letter.
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>.
The order has a total value of &<TOTAL> dollars.
Copy the fields that you want to use to the Form Letter Text area,
and enter your free-flowing text.
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.
Choose the matrix report style.
On the first page choose Matrix.
For the query, import the contents of p4q6.sql.
Choose Import SQL Query and select p4q6.sql from the import
dialog.
Display customer names down the left side of the page.
Copy NAME to the Matrix Row Fields area.
Display product numbers across the top of the page.
Copy PRODUCT_ID to the Matrix Column Fields area.
Display the total value in the cells.
Choose Sum to copy the sum of TOTAL_VALUE to the Matrix Cell
Fields area.
Create a summary to give the total of the sum(salary) values.
Select Sum(TOTAL_VALUE) and choose Sum.
......................................................................................................................................................
Developer/2000: Build Reports A-23
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-24 Developer/2000: Build Reports
Practice Session Overview: Lesson 5
......................................................................................................................................................
Introduction
In this practice session you will reuse some of the reports that you created in the last
session.
......................................................................................................................................................
Developer/2000: Build Reports A-25
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-26 Developer/2000: Build Reports
Practice Session Solutions: Lesson 5
......................................................................................................................................................
eMake the Total at the end of the report right justified, add commas,
currency symbol and two decimal places as in the column SALARY.
Select the column, then choose End Justify from the style bar or
select Format—>Justify—>End from the menu.
While the column is selected choose Commas and then Add
decimal place from the style bar. Repeat the action for the second
decimal place.
f Change the label of the total to bold font.
Select the label, then choose Bold from the style bar or use
Format—>Font in the menu.
g Make whatever other changes you like.
No formal solution
h Save the report to a file named p5q1.rdf and close it.
2 Open report p4q3.rdf. Make the following changes in the Live
Previewer:
To open the file select File—>Open from the menu or choose Open
on the toolbar.
If the report was saved with the Previewer open, it will open and run
the report automatically. If the report was saved with another editor
window open, it will open that window. Run the report by selecting it
in the Object Navigator and then selecting Program—> Run Report
from the menu or choosing Run in the toolbar.
a Remove the border around the total for each department.
Select the column, and choose Line Color from the vertical
toolbar. Choose No Line to remove the line color.
b Add commas and two decimal places to the SALARY field and the
total and make them right justified.
Select the column, then choose End Justify from the style bar or
select Format—>Justify—>End from the menu.
While the column is selected choose Commas and then Add
decimal place from the style bar. Repeat the action for the second
decimal place. You can also select the options from the Format
menu.
......................................................................................................................................................
Developer/2000: Build Reports A-27
Appendix A: Solutions
......................................................................................................................................................
cMake the same changes to the total at the end of the report. Move the
grand total so that it aligns with the SALARY field. (You must do
this manually; use the ruler guides to help you.)
Select the column, then choose End Justify from the style bar or
select Format—>Justify—>End from the menu.
While the column is selected choose Commas and then Add
decimal place from the style bar. Repeat the action for the second
decimal place. You can also select the options from the Format
menu.
d Change the color of the heading to grey.
Select a label, and choose Select Parent Frame from the style bar.
Choose Fill Color from the vertical toolbar.
e Make whatever other changes you like.
No formal solution
f Save the report to a file named p5q2.rdf and close it.
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 choose Open
on the toolbar.
If the report was saved with the Previewer open, it will open and run
the report automatically. If the report was saved with another editor
window open, it will open that window. Run the report by selecting it
in the Object Navigator and then selecting Program—> Run Report
from the menu or choosing Run in 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.
Choose Insert Date and Time on 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.
......................................................................................................................................................
A-28 Developer/2000: Build Reports
Practice Session Solutions: Lesson 5
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-29
Appendix A: Solutions
......................................................................................................................................................
Introduction
In this practice session, you open an existing template, which is one of the standard
templates shipped with the Developer/2000 Release 2 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.
Instructor Note
The practice does not include modifying the preferences file to register a predefined
templates. You can suggest they do so, if you have time and if your class setup
allows students to modify the preference file and to write to the
<ORACLE_HOME>\REPORTS30\ADMIN\TEMPLATE directory.
......................................................................................................................................................
A-30 Developer/2000: Build Reports
Practice Session Solutions: Lesson 6
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-31
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-32 Developer/2000: Build Reports
Practice Session Solutions: Lesson 6
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-33
Appendix A: Solutions
......................................................................................................................................................
Instructor Note
In the production version of Developer/2000 Release 2.0 the executable is
R30CON(32.EXE), but in the Help system it is still called R30CONV. Just point this
out to students, if they have difficulty finding it in the Help system, since the
practice uses the correct name R30CON.
The if you have time question is optional, since some classes might not have the
database tables available.
The Report on Reports runtime parameter form cuts off the names of the
parameters.You should point out to students which is which.
The Destination ones are:
• Destination Type
• Destination Name
• Destination Format
Remember that these reports exist as .rdf files; therefore developers can modify
these in Report Builder if they want.
......................................................................................................................................................
A-34 Developer/2000: Build Reports
Practice Session Solutions: Lesson 7
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-35
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-36 Developer/2000: Build 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 a external query and link it to a report.
......................................................................................................................................................
Developer/2000: Build Reports A-37
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-38 Developer/2000: Build Reports
Practice Session Solutions: Lesson 8
......................................................................................................................................................
3 Open p8q1.rdf.
aIn the Data Model link the two queries together on the primary and
foreign keys.
Hint: To create the link, select the Link tool. Click and drag from the
primary key field in the Customer group to the foreign key field in
the Ord group.
b Redo the layout by opening the Report wizard. Choose Group Above
style. Do not display CUSTOMER_ID.
c Run to test.
d Save the report as p8q3.rdf.
4 Modify p8q3.rdf to show and restrict customers’ credit rating. You need
to modify the query properties.
a Include CREDIT_RATING in the query statement, though you need
not display it. Restrict the query statement to show those who have a
POOR credit rating.
In the Data Model select the query Q_1. Click the right mouse
button to open the SQL Query Statement or open it from the
property palette.
Either type 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. Type = ’POOR’
and press return.
b Run to test.
c Save the report as p8q4.rdf and close it.
......................................................................................................................................................
Developer/2000: Build Reports A-39
Appendix A: Solutions
......................................................................................................................................................
5 Create a new report that lists the sales representatives and the products
they have sold.
a Choose a Group Above report style.
b Import the query file p8q5_a.sql.
c Make NAME and ID the group fields. Ensure that these fields are in
one group, at Level 1, not two separate groups.
d Do not display ID but display all other fields in the order described in
the table below.
Hint: You can change the order of fields in the Report wizard on the
fields tab.
e Change the following field attributes:
......................................................................................................................................................
A-40 Developer/2000: Build Reports
Practice Session Solutions: Lesson 8
......................................................................................................................................................
Columns Table
id, name s_dept
id, first_name||’ ’||last_name, title, salary s_emp
a Remember to include a join condition:
b Give the columns meaningful names.
Write the following query:
......................................................................................................................................................
Developer/2000: Build Reports A-41
Appendix A: Solutions
......................................................................................................................................................
7 Use the Report wizard to create a Group Left report using the external
query created in question 5.
a Department information should be in the master group.
b Look at the Data Model. Notice 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, then up into its own
new group.
Click and drag TITLE to the department group, then up again
to make a separate group. Rename the group G_TITLE.
Note: Since this is a single-query report, you can also make the group
change using the Report wizard, Group tab. However, you have learned
that you can combine many queries and groups in your own reports and
this simple exercise helps you to practice moving columns in the data
model.
d Open the Report wizard and choose Finish, to update the layout and
run the report.
e Run and test the report.
f Save the report as p8q7.rdf and close it.
Do you still have any objects open in the Object Navigator? If you do close them all.
......................................................................................................................................................
A-42 Developer/2000: Build 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.
......................................................................................................................................................
Developer/2000: Build Reports A-43
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-44 Developer/2000: Build Reports
Practice Session Solutions: Lesson 9
......................................................................................................................................................
c Create the following summaries. Can you use the Report wizard to
create the summaries?
As this is a single query report you can use the Report wizard.
Column Summary
line_total sum
line_total % Total
......................................................................................................................................................
Developer/2000: Build Reports A-45
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-46 Developer/2000: Build Reports
Practice Session Solutions: Lesson 9
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-47
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-48 Developer/2000: Build Reports
Practice Session Solutions: Lesson 9
......................................................................................................................................................
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 (though it does not really matter what you
return if the formula column is a character type).
The PL/SQL Formula is the following:
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.
......................................................................................................................................................
Developer/2000: Build Reports A-49
Appendix A: Solutions
......................................................................................................................................................
Introduction
In this practice session you use reports created in earlier practice sessions.
The aim is to familiarize you with the different layout regions of a report.
You also add flexible lines to a frame and anchor one object to another.
......................................................................................................................................................
A-50 Developer/2000: Build Reports
Practice Session Solutions: Lesson 10
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-51
Appendix A: Solutions
......................................................................................................................................................
Add a trailer page which displays today’s date with the text “End of
c
report run on: ”. Choose a larger font.
Hint: Copy and paste the date from the Margin Area of the report.
Choose Trailer from the horizontal toolbar, or choose Layout
Section—>Trailer View from the menu.
Choose the text tool from the vertical toolbar, and click in the
layout area. Enter the text and click outside the text object.
While the text object is selected, choose font and size from the
stylebar.
Choose Margin from the horizontal toolbar, or choose Layout
Section—>Margin View from the menu.
Select the f_date1 field then choose Edit—>Copy from the menu.
Choose Trailer from the horizontal toolbar, or choose Layout
Section—>Trailer View from the menu.
Choose Edit—>Paste from the menu, and move the field to the
desired place.
d Run and test the report.
e Save the report as p10q1.rdf and close it.
2 Open report p9q3.rdf and modify it to display the product picture in a
separate window.
a Delete field F_PICTURE from the body of the Layout Model (not
the column from the Data Model!).
Open the Layout Model editor. Choose Body from the horizontal
toolbar or choose Layout Section—>Body View from the menu.
Select the f_filename field and press delete.
......................................................................................................................................................
A-52 Developer/2000: Build Reports
Practice Session Solutions: Lesson 10
......................................................................................................................................................
Property Value
Name PICTURE_BUTTON
Label Type Text
Text Picture
Type Multimedia Column
Multimedia Column Filename
......................................................................................................................................................
Developer/2000: Build Reports A-53
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-54 Developer/2000: Build Reports
Practice Session Solutions: Lesson 10
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-55
Appendix A: Solutions
......................................................................................................................................................
Introduction
Modify a mailing label report to ensure you fill the printed page with label
records. You then restrict the number of labels that print on each page.
You add a link file to display a company logo by dynamically referencing a
file at runtime.
......................................................................................................................................................
A-56 Developer/2000: Build Reports
Practice Session Solutions: Lesson 11
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-57
Appendix A: Solutions
......................................................................................................................................................
Property Value
Name B_logo
Source File Format Image
Source File Name logo.tif
......................................................................................................................................................
A-58 Developer/2000: Build Reports
Practice Session Solutions: Lesson 11
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-59
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-60 Developer/2000: Build Reports
Practice Session Solutions: Lesson 12
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-61
Appendix A: Solutions
......................................................................................................................................................
checked.
Check the Hide First Value check box.
Enter the following statement in the Enter Query area:
......................................................................................................................................................
A-62 Developer/2000: Build Reports
Practice Session Solutions: Lesson 12
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-63
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-64 Developer/2000: Build Reports
Practice Session Overview: Lesson 13
......................................................................................................................................................
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
for a chart.
Instructor Note
Due to a known problem in production release of Developer/2000 R2.0, the
Chart wizard may not work properly. Be sure to tell students to close the
Graphics Batch after each run of the report.
......................................................................................................................................................
Developer/2000: Build Reports A-65
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-66 Developer/2000: Build Reports
Practice Session Solutions: Lesson 13
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-67
Appendix A: Solutions
......................................................................................................................................................
b In the layout editor move the chart beneath the product group and
resize it to the same width as the product group.
Select the chart and drag it below the product group frame. You
will need to enable Flex Mode. Do not forget to tun it off again
when you have finished.
Select the group frame and the chart, and choose Arrange—>
Size Objects from the menu to resize the chart.
c Run and test the report.
d Close the Graphics Batch.
e Create a second chart for the customer group
Choose Chart Wizard from the horizontal toolbar or Tools—>
Chart Wizard from the menu, and enter the following properties
in the wizard pages:
Chart Type Pie
Chart Subtype Plain
Data Group G_customer
Category CUSTOMER_ID
Value CUST_TOTAL
Chart Frequency Once per Name
File Name p13q3e.ogd
f In the layout editor move the chart beneath the customer group.
Select the chart and drag it below the product group frame. You
will need to enable Flex Mode. Do not forget to tun it off again
when you have finished.
g Run and test the report.
h Close the Graphics Batch.
i Save the report to p13q3.rdf and close it.
......................................................................................................................................................
A-68 Developer/2000: Build Reports
Practice Session Overview: Lesson 14
......................................................................................................................................................
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.
......................................................................................................................................................
Developer/2000: Build Reports A-69
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-70 Developer/2000: Build Reports
Practice Session Solutions: Lesson 14
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-71
Appendix A: Solutions
......................................................................................................................................................
e Use the Data Model editor to create summaries for each month and
for the level month and product.
Create both summaries in the cross product group.
Use the following settings:
Property Value
Name SumMonth
Product Order G_MONTH
Function Sum
Source SumTOTAL_VALUE
Reset At G_MONTH
Property Value
Name SumMonthProduct
Product Order G_MONTH G_PRODUCT_ID
Function Sum
Source SumTOTAL_VALUE
Reset At G_PRODUCT_ID
f Use the Layout editor to create the fields. You will have to expand
the appropriate repeating frame.
Select and expand R_G_MONTH. You will need to enable Flex
Mode. Do not forget to disable it again when you have finished.
Choose 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-72 Developer/2000: Build Reports
Practice Session Solutions: Lesson 14
......................................................................................................................................................
Property Value
Name F_SumMonth
Source SumMonth
......................................................................................................................................................
Developer/2000: Build Reports A-73
Appendix A: Solutions
......................................................................................................................................................
Use the right mouse button to open the SQL Query Dialog.
The query should read:
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.
Select F_PRODUCT_ID and press delete.
Choose 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.
Choose the Rotate tool from the vertical toolbar.
Press shift and click on 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.
c Run and test the report.
d Save the report as p14q4.rdf, and close it.
......................................................................................................................................................
A-74 Developer/2000: Build Reports
Practice Session Overview: Lesson 15
......................................................................................................................................................
Introduction
In this practice session, you create a format trigger to conditionally 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.
......................................................................................................................................................
Developer/2000: Build Reports A-75
Appendix A: Solutions
......................................................................................................................................................
Group Column
G_CUSTOMER CUSTOMER_ID
G_ID ID
DATE_ORDERED
DATE_SHIPPED
PAYMENT_TYPE
TOTAL
c Create a Tabular layout using the following columns from the query:
In the Layout Model editor choose the Additional Default
Layout tool from the vertical toolbar.
Display the following fields. Choose Labels and other properties
as you wish.
Column
ID
DATE_ORDERED
DATE_SHIPPED
TOTAL
......................................................................................................................................................
A-76 Developer/2000: Build Reports
Practice Session Solutions: Lesson 15
......................................................................................................................................................
d Ensure that only the Group Above layout displays when you choose
a destination of Screen, and only the Tabular layout displays when
you choose a destination of Preview.
Create a format trigger on the M_G_CUSTOMER_ID_GRPFR
group frame in the first layout.
Create an anchor from the top edge of the second layout group frame up to the
bottom edge of the first layout group frame.
Open the anchor property palette, and set the Collapse Vertically property to Yes.
Alternatively, ensure there is almost no space between the two layouts, so that
there is no extra white space at the top of the report when the second layout is
output.
To test the result, display the DESTYPE parameter in the report.
Create a field to display the system parameter DESTYPE.
Ensure that you can enter a parameter value at runtime.
Choose Tools—>Parameter Form Builder from the menu to create a parameter
form.
Test the report by changing the Destination Type parameter on the
Runtime Parameter Form.
e Save the report as p15q1.rdf.
......................................................................................................................................................
Developer/2000: Build Reports A-77
Appendix A: Solutions
......................................................................................................................................................
In the Data Model editor, create a formula column in the detail group G_ORD.
Open the property palette, and alter the following properties for the column
CF_ASTERISK:
Click PL/SQL Formula, to open the PL/SQL editor, and call the ASTERISK function
from the formula.
In the Layout editor, increase the width of the R_G_ID1 repeating frame in the
second layout to allow room for another field.
Create a field inside the repeating frame, rename it F_CF_ASTERISK and
source it to CF_ASTERISK.
b Remember to change destination to Preview during testing!
Save the report, and test it.
......................................................................................................................................................
A-78 Developer/2000: Build Reports
Practice Session Solutions: Lesson 15
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-79
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-80 Developer/2000: Build Reports
Practice Session Overview: Lesson 16
......................................................................................................................................................
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.
......................................................................................................................................................
Developer/2000: Build Reports A-81
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-82 Developer/2000: Build Reports
Practice Session Solutions: Lesson 16
......................................................................................................................................................
b Alter the pattern and color of those records where the customer total
is 5000 or less.
Hint: Use the following attributes:
Mask Attribute Suggested Values
SRW.ATTR.FILLPATT (fill pattern) crisscross, sandpaper
blue, cyan, green, magenta, red,
SRW.ATTR.BFCOLOR (background fill) yellow
SRW.ATTR.FFCOLOR (foreground fill)
......................................................................................................................................................
Developer/2000: Build Reports A-83
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-84 Developer/2000: Build Reports
Practice Session Solutions: Lesson 16
......................................................................................................................................................
SELECT S_ORD.SALES_REP_ID
, S_CUSTOMER.NAME CUSTOMER
, SUM(S_ORD.TOTAL) CUST_TOTAL
, S_ORD.CUSTOMER_ID
FROM S_ORD, S_CUSTOMER
WHERE S_ORD.CUSTOMER_ID=S_CUSTOMER.ID
GROUP BY S_ORD.SALES_REP_ID
, S_CUSTOMER.NAME
, S_ORD.CUSTOMER_ID
Add a button to this report, to display a drill-down report when the button is
pressed at run time. The button should display 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.
c When the button is pressed, the detail report (p12q1.rdf) is called
with the customer ID as a parameter.
Hint: Have a look at report p12q1.rdf to check the name of the
parameter.
You can import the file p16q2d.txt.
Open the property palette for the button, and set the Type
property to PL/SQL.
Import the file p16q2d.txt into the PL/SQL code, or enter the
following code:
procedure U_1ButtonAction is
begin
srw.run_report('report=s12q1.rdf
p_customer='||to_char(:customer_id)||' paramform=no');
end;
......................................................................................................................................................
Developer/2000: Build Reports A-85
Appendix A: Solutions
......................................................................................................................................................
e Test the report using the runtime executable and the close the
runtime.
......................................................................................................................................................
A-86 Developer/2000: Build Reports
Practice Session Solutions: Lesson 16
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports A-87
Appendix A: Solutions
......................................................................................................................................................
b The same trigger should also insert the current date, userid, and
“Starting Report” into this table.
......................................................................................................................................................
A-88 Developer/2000: Build Reports
Practice Session Solutions: Lesson 16
......................................................................................................................................................
i Try running the report more than once. When you run the report a
second time, the table already exists and Report Builder raises an
exception. Make the necessary change to your code so that the report
runs even when the table exists.
You need two PL/SQL blocks so that, if the table already exists,
the record is inserted after the exception has been handled.
Add the following code:
......................................................................................................................................................
Developer/2000: Build Reports A-89
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-90 Developer/2000: Build Reports
Practice Session Overview: Lesson 17
......................................................................................................................................................
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.
Instructor Note
To run this practice session, a remote server called repserver1 must be set
up. The owner of the server must have access to a printer.
The tnsnames.ora file on each student PC must be configured to have access
to the remote server.
The reports longrun1.rdf and longrun2.rdf must be on the server as well as
on the client PCs.
......................................................................................................................................................
Developer/2000: Build Reports A-91
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-92 Developer/2000: Build Reports
Practice Session Solutions: Lesson 17
......................................................................................................................................................
dDisplay all jobs to see where your jobs are queued in relation to the
reports of other students.
Choose Show all Jobs from the toolbar if it is not selected.
e Display all your own jobs only.
Choose Show all My Jobs from the toolbar.
f Refresh the screen several times to see how quickly the report pages
are formatted.
Choose Refresh from the toolbar
g Cancel your own longrun2.rdf from the server queue.
Select the job and choose 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.
Choose 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 choose Save.
......................................................................................................................................................
Developer/2000: Build Reports A-93
Appendix A: Solutions
......................................................................................................................................................
......................................................................................................................................................
A-94 Developer/2000: Build Reports
B
................................
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 Developer/2000: Build 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)
......................................................................................................................................................
Developer/2000: Build Reports B-3
Appendix B: Table Descriptions and Data
......................................................................................................................................................
S_CUSTOMER Data
SQL> SELECT * FROM s_customer;
......................................................................................................................................................
B-4 Developer/2000: Build Reports
S_CUSTOMER Data (continued)
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports B-5
Appendix B: Table Descriptions and Data
......................................................................................................................................................
......................................................................................................................................................
B-6 Developer/2000: Build Reports
S_CUSTOMER Data (continued)
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build 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 Developer/2000: Build 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)
......................................................................................................................................................
Developer/2000: Build Reports B-9
Appendix B: Table Descriptions and Data
......................................................................................................................................................
S_EMP Data
SQL> SELECT * FROM s_emp;
......................................................................................................................................................
B-10 Developer/2000: Build Reports
S_EMP Data (continued)
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports B-11
Appendix B: Table Descriptions and Data
......................................................................................................................................................
......................................................................................................................................................
B-12 Developer/2000: Build 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)
......................................................................................................................................................
Developer/2000: Build Reports B-13
Appendix B: Table Descriptions and Data
......................................................................................................................................................
S_ITEM Data
SQL> SELECT * FROM s_item;
......................................................................................................................................................
B-14 Developer/2000: Build Reports
S_ITEM Data (continued)
......................................................................................................................................................
62 rows selected.
......................................................................................................................................................
Developer/2000: Build Reports B-15
Appendix B: Table Descriptions and Data
......................................................................................................................................................
16 rows selected.
......................................................................................................................................................
B-16 Developer/2000: Build Reports
S_PRODUCT Description
......................................................................................................................................................
S_PRODUCT Description
Column Name Null? Datatype
----------------------------------------- -------------------- -------------------------
ID NOT NULL NUMBER(7)
NAME NOT NULL VARCHAR2(50)
SHORT_DESC VARCHAR2(255)
LONGTEXT_ID NUMBER(7)
IMAGE_ID NUMBER(7)
SUGGESTED_WHLSL_PRICE‘ NUMBER(11,2)
WHLSL_UNITS VARCHAR2(25)
......................................................................................................................................................
Developer/2000: Build Reports B-17
Appendix B: Table Descriptions and Data
......................................................................................................................................................
S_PRODUCT Data
SQL> SELECT * FROM s_product;
......................................................................................................................................................
B-18 Developer/2000: Build Reports
S_PRODUCT Data (continued)
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports B-19
Appendix B: Table Descriptions and Data
......................................................................................................................................................
......................................................................................................................................................
B-20 Developer/2000: Build Reports
S_PRODUCT Data (continued)
......................................................................................................................................................
33 rows selected.
......................................................................................................................................................
Developer/2000: Build 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 Developer/2000: Build 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.
......................................................................................................................................................
Developer/2000: Build Reports B-23
Appendix B: Table Descriptions and Data
......................................................................................................................................................
......................................................................................................................................................
B-24 Developer/2000: Build Reports
C
................................
Frequently Asked
Questions
Appendix C: Frequently Asked Questions
......................................................................................................................................................
......................................................................................................................................................
C-2 Developer/2000: Build Reports
Frequently Asked Questions and Answers
......................................................................................................................................................
Answer
The Multitiered Reports Server, which is part of Developer/2000 Release 2,
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.
......................................................................................................................................................
Developer/2000: Build Reports C-3
Appendix C: Frequently Asked Questions
......................................................................................................................................................
Answer
In your Form application, use ORACLE_SHUTDOWN = Yes as a
parameter in a parameter list that you pass to the Form Builder built-in,
RUN_PRODUCT.
The parameter value, Yes, must be in initial capitals.
References
<PrSol:2067466.6>
3.How do I pass parameters with spaces from command line or from the
Form Builder built-ins RUN_REPORT_OBJECT or RUN_PRODUCT?
Answer
• Use a CMDFILE for passing parameters with spaces from command
line.
• Use extra quotes to delimit values to pass parameter values with spaces
when using RUN_REPORT_OBJECT or RUN_PRODUCT.
References
<PrSol:2056652.6>
Answer
Remove "CONTROL(L)" from "AFTER PAGE{S} CONTROL(L)" line in
dflt.prt or use DESFORMAT=no_ff (no_ff.prt printer definition file is
supplied as part of the Report Builder installation, in
<oracle_home>\report30\printers directory)
References
<PrSol:2058834.6>
......................................................................................................................................................
C-4 Developer/2000: Build Reports
Frequently Asked Questions and Answers
......................................................................................................................................................
Answer
On Windows, use the barcode font supplied as part of the Report Builder
installation, in <oracle_home>\tools\devdem20\bin directory, or any
third- party barcode font.
Alternatively, you can use Developer/2000 Graphics Builder.
References
<PrSol:2059321.6>
Answer
Manually edit escape sequences into a .prt file.
References
<Note:34318.1> Landscape Printing in Reports on Windows
Answer
Install a third-party software, for example Winfax, and make that a printer.
In order to programmatically fax a report without any user interaction
through Microsoft Exchange Fax driver, look up bulletin BUL 13000147.6
(CR 159472).
References
<PrSol:2083424.6>
......................................................................................................................................................
Developer/2000: Build Reports C-5
Appendix C: Frequently Asked Questions
......................................................................................................................................................
Answer
In Release 2.0 or earlier, create a summary column in the cross product
group to count the number of cells that hold a NOT NULL value. Use a
format trigger to suppress the row or column if this value is zero.
In Release 2.1, a nested matrix style creates a ënon-sparseí matrix by
default, which means it suppresses all blank rows or columns.
References
<PrSol:2065884.6>
9. How can I print to the second printer tray using Report Builder?
Answer
Use a Before Report, Between Pages, or other format trigger to switch to
different printer trays as your report formats. You can determine the names
of the printer trays defined for your printer in the Page Setup dialog.
In Release 2.0, use SRW.SET_ATTR (PRINTER_INTRAY attribute) to set
printer tray as desired.
In Release 2.1, use SRW.SET_PRINTER_TRAY, which provides easier
syntax similar to Form Builder.
References
<PrSol:2063840.4>
<Note:40507.1>
......................................................................................................................................................
C-6 Developer/2000: Build Reports
Frequently Asked Questions and Answers
......................................................................................................................................................
Answer
Report Builder uses REPORTS30_TMP parameter in the Registry. If this is
not set then it uses the working directory instead.
Answer
Running a report to a file from the runtime module does not delete the idx
files. The idx files must be deleted manually. This is a documented bug.
References
<BUG:332572>
12.Is there any way to programmatically disable the PRINT button in the
runtime Previewer?
Answer
Yes, but only from Release 2.1 onwards. Include the DISABLEPRINT=YES
argument in your command line. Release 2.1 also provides a
DISABLEMAIL argument.
......................................................................................................................................................
Developer/2000: Build Reports C-7
Appendix C: Frequently Asked Questions
......................................................................................................................................................
......................................................................................................................................................
C-8 Developer/2000: Build Reports
D
................................
Supported Platforms
Oracle Rdb is available on the following computing platforms:
• Digital OpenVMS VAX
• Digital OpenVMS Alpha
• Digital UNIX
• Microsoft Windows NT on Digital Alpha
• Microsoft Windows NT on Intel
......................................................................................................................................................
D-2 Developer/2000: Build Reports
Oracle Rdb Features
......................................................................................................................................................
......................................................................................................................................................
Developer/2000: Build Reports D-3
Appendix D: Oracle Rdb Overview
......................................................................................................................................................
......................................................................................................................................................
D-4 Developer/2000: Build Reports
Other Information
......................................................................................................................................................
Other Information
Oracle Rdb Education
Oracle Education offers a comprehensive series of Oracle Rdb courses. The
course titles are:
• Introduction to Oracle Rdb: Technical Overview and SQL Language
• Oracle Rdb for the Database Administrator
• Oracle Rdb for the Database Designer
• Oracle Rdb 3GL Programming
• Oracle Rdb Performance and Tuning
• Oracle Rdb Internals
To receive the Oracle Rdb education schedule and catalogue, which contains
complete course descriptions, pricing and enrollment information, call
1.800.633.0575 within the continental US or 650.506.6800 from outside the
US.
......................................................................................................................................................
Developer/2000: Build Reports D-5
Appendix D: Oracle Rdb Overview
......................................................................................................................................................
......................................................................................................................................................
D-6 Developer/2000: Build Reports