developer 2000 - build reports volume 1 instructor guide

386
Developer/2000: Build Reports ........................................................................................... Volume 1 • Instructor Guide 43211GC10 Production 1.0 January 1998 M06141

Upload: jeff1000

Post on 27-Nov-2014

207 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports

...........................................................................................Volume 1 • Instructor Guide

43211GC10

Production 1.0

January 1998

M06141

Page 2: Developer 2000 - Build Reports Volume 1 Instructor Guide

Author

Louise Barnfield

Technical Contributor

Ursula Hovy

Technical Reviewers

Gunnar Boehrs

Jacquelyn Bruce Crispell

Laurent Dereac

Gillian Elias

Pascal Gibert

Steve Gramman

Marti Koppelmans

Steve Lirette

Jean Loup Lespine

Rita Morin

Vittavas Rattanamethawong

Bryan Roberts

Bert Salyga

Jason Schiedemeyer

Hiroyuki Sugiyama

Kajornsak Sungcharoen

Pal Tarcsay

Bart van de Laar

Jack Walsh

Harry Wong

Publishers

Jade Arrington

Geraldine Freitas

Kelly Lee

Kimberly Lee

Copyright Oracle Corporation, 1997. All rights reserved.

This documentation contains proprietary information of Oracle Corporation. It isprovided under a license agreement containing restrictions on use and disclosureand is also protected by copyright law. Reverse engineering of the software isprohibited. If this documentation is delivered to a U.S. Government Agency of theDepartment of Defense, then it is delivered with Restricted Rights and thefollowing legend is applicable:

Restricted Rights LegendUse, duplication or disclosure by the Government is subject to restrictions forcommercial computer software and shall be deemed to be Restricted Rightssoftware under Federal law, as set forth in subparagraph (c) (1) (ii) of DFARS252.227-7013, Rights in Technical Data and Computer Software (October 1988).

This material or any portion of it may not be copied in any form or by any meanswithout the express prior written permission of the Worldwide Education Servicesgroup of Oracle Corporation. Any other copying is a violation of copyright law andmay result in civil and/or criminal penalties.

If this documentation is delivered to a U.S. Government Agency not within theDepartment of Defense, then it is delivered with “Restricted Right,” as defined inFAR 52.227-14, Rights in Data-General, including Alternate III (June 1987).

The information in this document is subject to change without notice. If you findany problems in the documentation, please report them in writing to EducationProducts, Oracle Corporation, 500 Oracle Parkway, Box 659806, RedwoodShores, CA 94065. Oracle Corporation does not warrant that this document iserror-free.

Developer/2000, Designer/2000, PL/SQL, SQL*Plus, SQL*ReportWriter,Discoverer 3, Oracle7, and Oracle8 are trademarks or registered trademarks ofOracle Corporation.

All other products or company names are used for identification purposes only,and may be trademarks of their respective owners.

Page 3: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports iii......................................................................................................................................................

......................................................................................................................................................Contents

Volume 1Preface

IntroductionOverview I-3Course Objectives I-5Course Content I-7

Lesson 1: Introduction to Developer/2000Overview 1-3What Is Developer/2000? 1-5Introducing the Developer/2000 Components 1-11Common Builder Components 1-15Getting Started in the Developer/2000 Interface 1-19Navigating Around the Developer/2000 Main Menu 1-21Customizing Your Developer/2000 Session 1-23Developer/2000 Environment Variables 1-27Invoking Online Help Facilities 1-29Introducing the Course Application 1-31Summary 1-33Practice Session Overview: Lesson 1 1-35Practice Session: Lesson 1 1-36

Lesson 2: Designing and Running ReportsOverview 2-3Designing Reports 2-5Design Considerations 2-7Retrieving and Sharing Data 2-15Running a Report 2-17Viewing the Report Output 2-19Summary 2-29Practice Session Overview: Lesson 2 2-31Practice Session: Lesson 2 2-32

Page 4: Developer 2000 - Build Reports Volume 1 Instructor Guide

iv Developer/2000: Build Reports......................................................................................................................................................

...................................................................................................................................................... Contents

Lesson 3: Report Builder ConceptsOverview 3-3Report Executables 3-5Report Builder Components 3-9Object Categories 3-13Summary 3-23Practice Session Overview: Lesson 3 3-25Practice Session: Lesson 3 3-26

Lesson 4: Creating Reports Using the Report WizardOverview 4-3Invoking Report Builder and the Report Wizard 4-5Creating a Tabular Report Using the Wizard 4-7Creating Other Report Styles 4-23Summary 4-33Practice Session Overview: Lesson 4 4-35Practice Session: Lesson 4 4-36

Lesson 5: Enhancing Reports in the Live PreviewerOverview 5-3What Is the Live Previewer? 5-5Modifying a Report in the Live Previewer 5-7Summary 5-19Practice Session Overview: Lesson 5 5-21Practice Session: Lesson 5 5-22

Lesson 6: Managing Report TemplatesOverview 6-3Using the Report Templates 6-5Modifying a Template 6-7Predefining Your Own Templates 6-13Summary 6-17Practice Session Overview: Lesson 6 6-19Practice Session: Lesson 6 6-20

Page 5: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports v......................................................................................................................................................

......................................................................................................................................................Contents

Lesson 7: Report Storage MethodsOverview 7-3Storage Methods and Requirements 7-5Documenting Your Reports 7-9File Portability 7-11Converting Report Definitions 7-15Migrating Developer/2000 Release 1 Reports 7-17Summary 7-19Practice Session Overview: Lesson 7 7-21Practice Session: Lesson 7 7-22

Lesson 8: Enhancing Reports Using the Data Model—CreatingQueries and Groups

Overview 8-3Describing the Report Data Model 8-5Modifying Properties of a Query 8-7Changing the Group Structure 8-13The Group Hierarchy 8-15Ordering Data in a Group Hierarchy 8-17Filtering Data in a Group 8-21Adding New Data 8-23Using Data Links to Structure Data 8-29Efficiency Issues: Multiple or Single-Query Hierarchy 8-35Summary 8-37Practice Session Overview: Lesson 8 8-39Practice Session: Lesson 8 8-40

Page 6: Developer 2000 - Build Reports Volume 1 Instructor Guide

vi Developer/2000: Build Reports......................................................................................................................................................

...................................................................................................................................................... Contents

Lesson 9: Enhancing Reports Using the Data Model—CreatingColumns

Overview 9-3The Data Model Column Types 9-5Maintaining Database Columns 9-7Using a Database Column to Output Contents of a File 9-9Creating a Column 9-11Creating Summary Columns 9-13Example Report Displaying Subtotals 9-15Example Report Displaying Percentages 9-17Creating Formula Columns 9-21Creating Placeholder Columns 9-23Example Report to Populate a Placeholder 9-25Summary 9-27Practice Session Overview: Lesson 9 9-29Practice Session: Lesson 9 9-30

Lesson 10: Enhancing Reports Using the Layout ModelOverview 10-3Viewing the Layout Model Regions 10-5Designing Multipanel Reports 10-7The Layout Model Layers 10-9Creating Layout Objects 10-15The Layout Model Tools 10-17Creating Additional Layouts in a Report 10-19Creating Variable Length Lines 10-21Displaying a Multimedia File from a Button 10-23Creating Explicit Anchors 10-25Summary 10-29Practice Session Overview: Lesson 10 10-31Practice Session: Lesson 10 10-32

Page 7: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports vii......................................................................................................................................................

......................................................................................................................................................Contents

Lesson 11: Modifying PropertiesOverview 11-3Modifying Layout Object Properties 11-5Displaying File Contents with a Link File 11-7Modifying Common Layout Properties 11-13Sizing Objects 11-15Layout Object Relationships 11-17Modifying Properties of a Field 11-29Modifying Properties of a Repeating Frame 11-37Summary 11-43Practice Session Overview: Lesson 11 11-45Practice Session: Lesson 11 11-46

Volume 2Lesson 12: Creating and Using Report Parameters

Overview 12-3Creating User Parameters 12-5Referencing Parameters in a Report Query 12-7Hints and Tips for Referencing Parameters 12-13Creating a List of Values 12-15Referencing System Parameters 12-19Building a Parameter Form 12-23Summary 12-27Practice Session Overview: Lesson 12 12-29Practice Session: Lesson 12 12-30

Lesson 13: Embedding a Chart in a ReportOverview 13-3Creating and Embedding a Graphics Chart in a Report 13-5Embedding an Existing Chart in a Report 13-9Summary 13-11Practice Session Overview: Lesson 13 13-13Practice Session 13-14

Page 8: Developer 2000 - Build Reports Volume 1 Instructor Guide

viii Developer/2000: Build Reports......................................................................................................................................................

...................................................................................................................................................... Contents

Lesson 14: Enhancing Matrix ReportsOverview 14-3The Matrix Data Model 14-5Matrix Layout 14-7Creating Matrix Summaries 14-9Building a Nested Matrix 14-11Summary 14-19Practice Session Overview: Lesson 14 14-21Practice Session: Lesson 14 14-22

Lesson 15: Coding PL/SQL Triggers in ReportsOverview 15-3Types of Triggers in Reports 15-5Using Report Triggers 15-7Using Data Model Triggers 15-11Using Layout Model Triggers 15-15Writing Common Code 15-27Summary 15-29Practice Session Overview: Lesson 15 15-31Practice Session: Lesson 15 15-32

Lesson 16: Using the Report Builder Built-In PackageOverview 16-3Contents of the Report Builder Built-in Package 16-5Outputting Messages 16-7Executing a Nested Report 16-9Restricting Data 16-15Initializing Fields 16-17Performing DDL Statements 16-19Setting Format Attributes 16-21Summary 16-25Practice Session Overview: Lesson 16 16-27Practice Session: Lesson 16 16-28

Page 9: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports ix......................................................................................................................................................

......................................................................................................................................................Contents

Lesson 17: Maximizing Performance Using the Reports ServerOverview 17-3Why Use a Remote Server? 17-5Reports Server Architecture and Configuration 17-9Viewing and Scheduling Reports in the Queue Manager 17-23Summary 17-31Practice Session Overview: Lesson 17 17-33Practice Session: Lesson 17 17-34

Lesson 18: Building Reports for Different EnvironmentsOverview 18-3Different Development and Runtime Environments 18-5Developing Reports to Run in Different GUIs 18-7Building Character Mode Reports 18-9Building Reports to Run in Different Languages 18-13Summary 18-17

Page 10: Developer 2000 - Build Reports Volume 1 Instructor Guide

x Developer/2000: Build Reports......................................................................................................................................................

...................................................................................................................................................... Contents

Appendix A: SolutionsPractice Session Overview: Lesson 1 A-2Practice Session Solutions: Lesson 1 A-3Practice Session Overview: Lesson 2 A-8Practice Session Solutions: Lesson 2 A-9Practice Session Overview: Lesson 3 A-15Practice Session Solutions: Lesson 3 A-16Practice Session Overview: Lesson 4 A-19Practice Session Solutions: Lesson 4 A-20Practice Session Overview: Lesson 5 A-25Practice Session Solutions: Lesson 5 A-26Practice Session Overview: Lesson 6 A-30Practice Session Solutions: Lesson 6 A-31Practice Session Overview: Lesson 7 A-34Practice Session Solutions: Lesson 7 A-35Practice Session Overview: Lesson 8 A-37Practice Session Solutions: Lesson 8 A-38Practice Session Overview: Lesson 9 A-43Practice Session Solutions: Lesson 9 A-44Practice Session Overview: Lesson 10 A-50Practice Session Solutions: Lesson 10 A-51Practice Session Overview: Lesson 11 A-56Practice Session Solutions: Lesson 11 A-57Practice Session Overview: Lesson 12 A-60Practice Session Solutions: Lesson 12 A-61Practice Session Overview: Lesson 13 A-65Practice Session Solutions: Lesson 13 A-66Practice Session Overview: Lesson 14 A-69Practice Session Solutions: Lesson 14 A-70Practice Session Overview: Lesson 15 A-75Practice Session Solutions: Lesson 15 A-76Practice Session Overview: Lesson 16 A-81Practice Session Solutions: Lesson 16 A-82Practice Session Overview: Lesson 17 A-91Practice Session Solutions: Lesson 17 A-92

Page 11: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports xi......................................................................................................................................................

......................................................................................................................................................Contents

Appendix B: Table Descriptions and DataSummit Sporting Goods Database Diagram B-2S_CUSTOMER Description B-3S_CUSTOMER Data B-4S_CUSTOMER Data (continued) B-5S_CUSTOMER Data (continued) B-6S_CUSTOMER Data (continued) B-7S_DEPT Description and Data B-8S_EMP Description B-9S_EMP Data B-10S_EMP Data (continued) B-11S_EMP Data (continued) B-12S_ITEM Description B-13S_ITEM Data B-14S_ITEM Data (continued) B-15S_ORD Description and Data B-16S_PRODUCT Description B-17S_PRODUCT Data B-18S_PRODUCT Data (continued) B-19S_PRODUCT Data (continued) B-20S_PRODUCT Data (continued) B-21S_REGION Description and Data B-22S_TITLE Description and Data B-23

Appendix C: Frequently Asked QuestionsFrequently Asked Questions C-2Frequently Asked Questions and Answers C-3

Appendix D: Oracle Rdb OverviewWhat Is Oracle Rdb? D-2Oracle Rdb Features D-3Standard User Interfaces D-4Other Information D-5

Page 12: Developer 2000 - Build Reports Volume 1 Instructor Guide

xii Developer/2000: Build Reports......................................................................................................................................................

Page 13: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

Preface

Page 14: Developer 2000 - Build Reports Volume 1 Instructor Guide

ii Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Preface

Instructor NoteGeneral course information for instructors:

PowerPoint SlidesThe slideshow provides manybuilds to enable you to step through yourexplanation. Of course, you can modify these builds if you prefer, and if youknow how to use PowerPoint.

All slides include a small arrow at the bottom of the screen that appears onthe final build, so that you know when one slide has finished and the nextslide will begin. On the last slide of a lesson the arrow points to the leftinstead of the right.

If you modify a build, make sure that this arrow is the last object in the buildorder.

DemonstrationsAdditional demonstration reports, that are not mentioned in the courseinstructor notes, are included in the DEMO directory. For example:

BARCODE.RDF (Windows only): uses3of9.ttfTrue Type Font, so you mustinstall this font before running the report, or open the report and change thefont to any third party barcode font that is already installed.

The3of9.ttffont file is included in the DEMO directory, but is also providedwith the product installation demonstration files:<oracle_home>\tools\devdem20\bin.

Practice SessionsStudents might want to view the report output that they are asked to producein each question. Solution files of all reports are available in the LAB_SOLdirectory.

Suggest that students invoke Reports Runtime and use this to run anysolution report file to see the desired result. Remind them that these are.rdffiles, so they must change the file type in the Runtime dialog box, becauseReports Runtime expects.rep as a default.

Page 15: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports iii......................................................................................................................................................

......................................................................................................................................................Profile

Profile

Before You Begin This CourseBefore you begin this course, you should have:

• Thorough knowledge of creating SQL query statements

• Working experience of:

- Creating PL/SQL constructs, including conditional statements,procedures and functions.

- Creating PL/SQL stored (server) procedures and functions

- Using a graphical user interface (GUI)

Prerequisites• The following Instructor-Led Training (ILT) courses:

- Introduction to Oracle: SQL & PL/SQL or Introduction to Oracle forExperienced SQL Users

- Develop PL/SQL Program Units

• Or, the following CBTs from our SQL * PL/SQL CBT Library:

- SQL and SQL*Plus: Basic SELECT Statements

- SQL and SQL*Plus: DDL and DML

- PL/SQL: Basics

- PL/SQL: Procedures, Functions sand Packages

- PL/SQL: Database Programming

Suggested:• Advanced SQL and SQL*Plus (ILT)

• Or, SQL and SQL*Plus: Advanced SELECT Statements (CBT)

Suggested Follow-up Courses• Developer/2000: Build Forms I

• Developer/2000: Deploy Web-Based Applications

• Designer/2000: Design and Generate Developer/2000 Applications

How This Course Is OrganizedDeveloper/2000: Build Reports is an instructor-led course featuring lectureand hands-on exercises. Online demonstrations and written practice sessionsreinforce the concepts and skills introduced.

Page 16: Developer 2000 - Build Reports Volume 1 Instructor Guide

iv Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Preface

Related Publications

Oracle Publications

Additional Publications• Release notes PDF format: <oracle_home>\tools\doc20\relnotes.pdf

• Release notes Text format: <oracle_home>\tools\doc20\relnotes.txt

Title Part Number

Developer/2000: Guidelines for Building ApplicationsRelease 2.0

A50994-1

Developer/2000 Getting Started Release 2.0 A50995-1

Page 17: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports v......................................................................................................................................................

......................................................................................................................................................Typographic Conventions

Typographic Conventions

Typographic Conventions Within TextThe following conventions are used within text:

Convention Object or Term Example

Uppercase Commands, func-tions,column names,table names,PL/SQL objects,schemas

Use the SELECT command to view informationstored in the LAST_NAME column of the EMPtable.

Lowercase, italic Filenamessyntax variables,usernames,passwords

roleis the name of the role to be created.

Initial cap Triggers and buttonnames

Assign a When—Validate—Item trigger to theORD block.

Press Cancel.

Italic Books, names ofcourses and manuals,and emphasizedwords or phrases

For further information on the subject see:Oracle7 Server SQL Language Reference Man-ual.

Do not save changes to the database.

Quotation marks Lesson module titlesreferenced within acourse

This subject is covered in Lesson 3, “Workingwith Objects.”

Italic bold The first time a glos-sary word is referredto in a section

Thealgorithm inserts the new key.

Page 18: Developer 2000 - Build Reports Volume 1 Instructor Guide

vi Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Preface

Typographic Conventions Within CodeThe following conventions are used within code:

Convention Object or Term Example

Uppercase Commands, func-tions

SELECT userid

FROM emp;

Lowercase,italic

Syntax variables CREATE ROLErole

Initial cap Oracle Forms trig-gers

Form module: ORD

Trigger level: S_ITEM.QUANTITY item

Trigger name When-Validate-Item

. . .

Lowercase Column names,table name, filena-mes, PL/SQLobjects

. . .

OG_ACTIVATE_LAYER

(OG_GET_LAYER (‘prod_pie_layer’))

. . .

SELECT last_name

FROM s_emp;

DROP USER scott

IDENTIFIED BY tiger;

Page 19: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

I

Introduction

Page 20: Developer 2000 - Build Reports Volume 1 Instructor Guide

I-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Introduction

Instructor NoteTopic TimingLecture 15 minutes

Practice 00 minutes

Total 15 minutes

I-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this section, you should beable to

• Identify the course objectives.

• Identify the course content andstructure.

Page 21: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports I-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionThis lesson introduces you to the course: the objectives that the course intends tomeet, the topics that it covers and how the topics are structured over the duration ofthe course.

ObjectivesAt the end of this lesson, you should be able to:

• Identify the course objectives.

• Describe the course content and structure.

Page 22: Developer 2000 - Build Reports Volume 1 Instructor Guide

I-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Introduction

I-3 Copyright Oracle Corporation, 1998. All rights reserved.

Developer/2000 Rel. 2Curriculum

Build ReportsReport Builder Library

ILT

CBT

Oracle Channel

Seminar

Deploy Web Apps

Deploy Web-Based Apps

Tuning Tips

Managing Projects in Dev/2KManaging Projects in Dev/2K

Tuning and Productivity

Rel.2 Top 10 Features Rel.2 Top 10 Features

Fundamentals

NLS in Dev/2K

Rel.2 New Features

Design Effective GUI AppsDeploy Web Apps

App. Developer Entry

Build Forms I

Build Forms II

Form Builder Library

Form Builder Library

I-4 Copyright Oracle Corporation, 1998. All rights reserved.

Course Objectives

At the end of this course, you should beable to

• Describe the capabilities ofDeveloper/2000 Reports.

• Develop and maintain different styles ofreport using Developer/2000 ReportBuilder.

• Lay out and format data to suit userreporting requirements.

• Incorporate text and graphics in reports.

Page 23: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports I-5......................................................................................................................................................

......................................................................................................................................................Course Objectives

Course Objectives

Course DescriptionThis course enables you to create reports in a variety of styles, customizing them tomeet specific business requirements by combining text and graphics withquantitative data.

During the course, you develop reports in a client-server environment using thepower and flexibility of the Developer/2000 graphical user interface (GUI).

Course ObjectivesBy the end of this course you should be able to

• Describe the capabilities of Developer/2000 Reports.

• Develop and maintain different styles of reports using Developer/2000 ReportBuilder.

• Lay out and format data to suit user reporting requirements.

• Incorporate text and graphics in reports.

Page 24: Developer 2000 - Build Reports Volume 1 Instructor Guide

I-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Introduction

I-5 Copyright Oracle Corporation, 1998. All rights reserved.

Course Content

Day 1—basic concepts

• Introducing Developer/2000

• Designing and running reports

• Creating and modifying reports usingthe wizard

Day 2—enhancements

• Managing Templates

• Enhancing report structure and layout

I-6 Copyright Oracle Corporation, 1998. All rights reserved.

Course Content

Day 3—more enhancements

• Customizing reports with parameters

• Embedding a chart

• Adding PL/SQL code

Day 4—additional features

• Using built-in packages

• Scheduling remote reports

• Building reports for different environments

Page 25: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports I-7......................................................................................................................................................

......................................................................................................................................................Course Content

Course ContentThe lesson titles show the topics we cover in this course, and the usual sequence oflessons. However, the daily schedule is an estimate, and may vary for eachindividual class.

Day 1Course Introduction

Introduction to Developer/2000

Designing and Running Reports

Report Builder Concepts

Creating Reports Using the Report Wizard

Modifying a Report in the Live Previewer

Day 2Managing Report Templates

Reports Storage Methods

Enhancing Reports Using the Data Model—Queries and Groups

Enhancing Reports Using the Data Model—Columns

Enhancing Reports Using the Layout Model

Day 3Modifying Properties

Using Report Parameters and Customizing a Parameter Form

Embedding a Chart in a Report

Creating Matrix Reports

Coding PL/SQL Triggers in Reports

Day 4Using the Report Builder Built-In Package

Maximizing Performance Using the Reports Server

Monitoring Report Performance

Building Reports for Different Environments

Page 26: Developer 2000 - Build Reports Volume 1 Instructor Guide

I-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Introduction

Page 27: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

1

Introduction toDeveloper/2000

Page 28: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteTopic TimingLecture 45 minutes

Practice 20 minutes

Total 65 minutes

1-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to

• Describe common features and benefitsof Developer/2000.

• Describe Developer/2000 components.• Describe common builder components.

• Navigate around the builder interface.• Customize the Developer/2000 session.

• Describe the course application.

Page 29: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionThis course teaches you to build effective and professional reports using Developer/2000 Report Builder. This is only one component of Developer/2000, and it isuseful for you to understand the whole suite of components and the capabilities ofDeveloper/2000 in building consistent, integrated applications.

This lesson identifies the key and common features of Developer/2000, theDeveloper/2000 components, and the course application model and contents.

ObjectivesAt the end of this lesson, you should be able to:

• Describe the common features and benefits of Developer/2000.

• Describe the Developer/2000 components.

• Describe the common builder components.

• Navigate around the Developer/2000 interface.

• Customize the Developer/2000 session by modifying builder preferences.

• Describe the course application.

Page 30: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

1-3 Copyright Oracle Corporation, 1998. All rights reserved.

What Is Developer/2000?

• A suite of Oracle components withcommon interfaces

• One of a family of products

1-4 Copyright Oracle Corporation, 1998. All rights reserved.

What Is Developer/2000?

Designer/2000

Developer/2000

Discoverer 3

DatabaseGUI

World WideWeb

Client-Server

Supportedtechnologies

Family ofproducts

Page 31: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-5......................................................................................................................................................

......................................................................................................................................................What Is Developer/2000?

What Is Developer/2000?

IntroductionDeveloper/2000 is a suite of Oracle components that you can integrate to buildcomprehensive applications.

Family of ProductsDeveloper/2000 is one group within a family of products that support the design,creation, and running of applications across a variety of platforms.

Oracle’s design, development, and data access tools are:

• Designer/2000

• Developer/2000

• Discoverer 3

Development FeaturesDeveloper/2000 lets you build high performance systems that take advantage ofGUI, database, client-server, and Web technologies.

The intuitive tools within Developer/2000 have common interfaces and features thatmake it easy to move between tools and to design elements that are both modularand reusable.

Page 32: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

1-5 Copyright Oracle Corporation, 1998. All rights reserved.

Key Features

• Comprehensive GUI support

• Distributed applications

• Productive and comprehensive tools

• Application partitioning

• Flexible source control

• Extended scalability

• Object orientation

Page 33: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-7......................................................................................................................................................

......................................................................................................................................................What Is Developer/2000?

Developer/2000 Key FeaturesDeveloper/2000 Release 2 provides a number of features that contribute to itsstrength and flexibility.

Comprehensive GUI SupportDeveloper/2000 supports the native features of Microsoft Windows95 and NT 4.0,and provides portability to Motif, Macintosh, and character-mode productionenvironments.

Distributed ApplicationsThe tools provide local, client-server, and Web support with multiple databaseconnections per application. As well as Oracle7 and Oracle8, your applications canaccess SQL databases through ODBC.

Productive and Comprehensive ToolsDeveloper/2000 provides the same design facilities across tools, for commonfunctions such as the Layout editor and the Object Navigator.

Application PartitioningYou can place individual PL/SQL program units on the database server, theapplication server, or in the client-side application, whichever is most suitable ineach case. You can copy and move objects between modules and database server,using convenient drag-and-drop techniques.

Flexible Source ControlYou can store the definitions of your application modules in flat files or in the Oracledatabase. You can perform version control on these modules and producedocumentation through Developer/2000 facilities.

Extended ScalabilityYou can scale applications from single users to tens of thousands, with no changesto the application. Scalability is inherent in the multitiered architecture of theproduct. There is support for server functionality, such as array DML, databasecursors, bind variables, and result sets.

Object OrientationDeveloper/2000 offers an inheritance model that facilitates the inheritance ofattributes and code from one object to another and from one application to another,through subclassing and object libraries.

Page 34: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteAPI = Application Programming Interface

MAPI = Microsoft Messaging Application Programming Interface

1-6 Copyright Oracle Corporation, 1998. All rights reserved.

Improved DeveloperProductivity

Release 2 provides:

• Wizards

• Visual query builder

• Templates

• MAPI support

• Open APIs

Page 35: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-9......................................................................................................................................................

......................................................................................................................................................What Is Developer/2000?

Improved Developer ProductivityRelease 2 has simplified many developer tasks. Features include:

• Wizards for many simple, repetitive tasks

• Visual query builder: both as a stand-alone executable and as a utility embeddedin Reports

• Gallery of predefined and user-extensible templates

• Support for MAPI-compliant clients, for easy report distribution

• Open APIs, allowing developers to write their own programs in C/C++ and callthe API to manipulate a file, providing a very fast program interface

Page 36: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteProject Builder is covered in detail inDeveloper/2000: Build Forms II.

CGI = Common Gateway Interface, the industry-standard technique for runningapplications on a Web server. CGI enables a program running on a Web server togenerate dynamic HTML documents.

1-7 Copyright Oracle Corporation, 1998. All rights reserved.

Developer/2000 Components

APIProjectBuilder

TranslationBuilder

FormBuilder

ReportBuilder

GraphicsBuilder

ProcedureBuilder

QueryBuilder

SchemaBuilder

Database Interface

Page 37: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-11......................................................................................................................................................

......................................................................................................................................................Introducing the Developer/2000 Components

Introducing the Developer/2000 Components

Release 2 Components

Project BuilderThis new component of Release 2 helps in the entire project life cycle. A navigator-style interface provides easy access to all your project files and the actionsassociated with them. The customizable launcher enables you to launch Oracle andnon-Oracle applications, such as Form Builder, Report Builder or MS-Word.

You can package your application and then deploy it on other machines usingutilities of your own choosing.

Form BuilderThis development interface helps you build sophisticated, interactive applications—screens and pull-down menus. Form Builder can present information throughtextual items, GUI objects, and bit-mapped images. Users can perform databasetransactions by interacting with these objects.

Wizards help you build simple, standard modules very quickly. You can then use thepowerful features of Form Builder to enhance the appearance and functionality ofyour application.

Report BuilderThis development interface helps you build both simple and extremely complexproduction-quality reports. The wizard offers a variety of styles. Templates help youdevelop professional, standard reports quickly and easily. Report Builder alsosupports many more complex and individual enhancements.

You can run a report as a stand-alone application, or invoke it from a Developer/2000 form, passing data to the report as required. You can deploy reports on theWeb using the Reports Server and Reports Web CGI.

Graphics BuilderThis development interface helps you build a variety of charts, including drill-downgraphics applications. Use the Graphics Builder to enhance and modify chartscreated by the Chart wizard in the Form and Report Builders.

Note: You can automatically generate Developer/2000 applications from designspecifications by using Designer/2000.

Page 38: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

1-8 Copyright Oracle Corporation, 1998. All rights reserved.

Developer/2000 Components

APIProjectBuilder

TranslationBuilder

FormBuilder

ReportBuilder

GraphicsBuilder

ProcedureBuilder

QueryBuilder

SchemaBuilder

Database Interface

Page 39: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-13......................................................................................................................................................

......................................................................................................................................................Introducing the Developer/2000 Components

Release 2 Components (continued)

Query BuilderWith this user-friendly graphical interface you can build queries, either in astand-alone executable or during development of a report using Report Builder.

Schema BuilderWith this user-friendly graphical tool you can define database objects and theirrelationships, in a stand-alone executable.

Procedure BuilderProcedure Builder provides the common PL/SQL and program unit managementfacilities contained within the Developer/2000 application builders (Form, Report,and Graphics). You can also invoke the stand-alone builder, which allows you tocreate and manage program units in a separate session, without invoking the otherapplication builders.

Procedure Builder allows you to:

• Create, modify, compile and save program units

• Manage stored subprograms and database triggers

• Move code between Developer/2000 applications and the database, usingconvenient drag-and-drop techniques

Translation BuilderThis user-friendly and powerful tool supports and manages translations of textextracted from Oracle resources. It is a cost effective solution to translate a givenapplication, and above all it helps Oracle developers to make a simultaneous releaseof native and multilingual applications.

Page 40: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteMention these briefly. Use the slide to point out that these are the same componentsin all the main builders (Form, Report, Graphics).

We will start the builders and see the interface in a demonstration very soon!

1-9 Copyright Oracle Corporation, 1998. All rights reserved.

Common Builder Components

Page 41: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-15......................................................................................................................................................

......................................................................................................................................................Common Builder Components

Common Builder Components

IntroductionThe Developer/2000 Form, Report, and Graphics builders share a number ofcommon interface components. These components may include options in one toolthat do not occur in another, but their basic functionality is the same throughout.These components help to provide the flexibility and productivity of the Developer/2000 development environment.

Object NavigatorThe Object Navigator is a hierarchical browsing and editing interface that enablesyou to locate and manipulate application objects easily and quickly. Featuresinclude:

• A hierarchy represented by indentation and expandable nodes. Top-level nodesshow module types, database objects, and built-in packages.

• Find: field and icons, enabling forward and backward searches for any level ofnode or for an individual item in a node.

• Icons in the vertical toolbar replicating common File menu functions.

Layout Editor (or Layout Model)The Layout editor lets you design the style, color, size, and arrangement of visualobjects in the application. These layouts can include graphical objects and bit-mapped images when running in a GUI environment.

Property PaletteAll objects in a module, including the module itself, have properties that you cansee and modify in the property palette. Features include:

• Copy and reuse properties from another object

• Find: field and icons, similar to Object Navigator

PL/SQL Development EnvironmentThe Development Environment is the integrated functionality of Procedure Builderthat exists within the application builders. It provides:

• Development of server-side database triggers and stored procedures, functions,and packages

• Development of libraries to hold PL/SQL program units

• Statement-level debugging of PL/SQL at run time

Page 42: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteActiveX is an open platform that combines desktop and Web technologies. AnActiveX control can be automatically downloaded and executed by a Web browser.ActiveX is a set of rules for how applications should share information.Programmers can develop ActiveX controls in a variety of languages, including C,C++, Visual Basic, and Java.

ActiveX represents Microsoft’s third generation of control architecture, the firstbeing VBX and the second OCX.

The Developer/2000: Build Forms II course discusses the use of ActiveX controls.They are not relevant in Report Builder, except that Developer/2000 provides anActiveX control to enable developers to call the remote Reports Server from anotherproduct.

1 Developer/2000 tools 3 Toolkit

2 Multimedia extension 4 Base functionality

1-10 Copyright Oracle Corporation, 1998. All rights reserved.

Oracle Toolkit and MultimediaApplications

Form, Report, Graphics

OSF/Motif

MicrosoftWindows 95Windows NT

Macintosh

Charactermode

1

2

3

4

Page 43: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-17......................................................................................................................................................

......................................................................................................................................................Common Builder Components

Oracle Toolkit and Oracle MultimediaOracle Toolkit is a library of functions that perform user interface events, such asscroll bar control and menu activation.

Together with Oracle Multimedia, which provides the integration of images, sounds,and other media facilities, Toolkit underlays the Developer/2000 development tools,bridging the gap between your Developer/2000 applications and the nativeenvironment in which you are working.

As your applications request facilities, such as to open a window or display a menu,Developer/2000 passes the requests to Toolkit, which communicates them to thenative platform.

Toolkit attempts to pass tasks to the native interface, if that interface can handlethem, so that your application utilizes the natural features of your environment,wherever possible. This means that a Developer/2000 application looks and behaveslike a Windows NT application when running on Windows NT, and like a Motif orMacintosh application if moved to those platforms.

Toolkit itself provides the functionality where certain functionalities are notavailable through the native interface; for example, on character-mode devices. Thisprovides an adaptable user interface for your Developer/2000 applications.

Note: You can see a list of these and other products that support the commoncomponents and integration of Developer/2000 tools by selecting Help—>About inthe builder menus.

Microsoft Windows95 and NT SupportIf you are designing your applications to run on Windows, Developer/2000 providesextensive support for its facilities.

In addition to basic Windows objects and features, Developer/2000 supports:

• Open DataBase Connectivity (ODBC)

• Object Linking and Embedding (OLE2)

• Dynamic Data Exchange (DDE)

• ActiveX controls

Page 44: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteInvoke Project Builder. Openreports.upd.

Invoke Report Builder from the launchpad.

Open an existing report. Use one of the reports from the existing prebuiltapplication.

We use an existing report in this lesson to familiarize students with the Developer/2000 interface. Later we create new reports using the wizard.

Report Builder will probably prompt you to connect to the database when it tries torun the report in the Live Previewer. Also show students the File—>Connect menuoption.

1-11 Copyright Oracle Corporation, 1998. All rights reserved.

Getting Started

• Starting the builders

– Invoke using Project Builderlaunchpad

– Invoke from individual builder icons

• What you see

– Project Builder: banner then wizard

– Other builders: wizard

• Connecting to the database

– File—>Connect

Page 45: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-19......................................................................................................................................................

......................................................................................................................................................Getting Started in the Developer/2000 Interface

Getting Started in the Developer/2000 Interface

Starting the BuildersThere are two suggested methods of invoking any of the builders:

• Invoke Project Builder and launch the builder you require from the ProjectBuilder launchpad.

• Invoke an individual builder from the Developer/2000 R2.0 group.

What You See in the BuildersWhen you invoke Project Builder, you first see a product banner, and then thewizard.

When you invoke the other builders, you first see the wizard.

Each builder wizard gives you several options, including:

• Create a new module using the wizard

• Create a new module manually

• Open an existing module

Database ConnectionIf you build applications that access database objects, you need to connect to adatabase account from the builder.

Connect to a database if you need:

• To compile code that contains SQL.

• To access database objects in the Object Navigator.

• To create Developer/2000 objects that are based on database objects.

Steps to Connect to Oracle1 Select File—>Connect from the menu.

2 Enter the database user and password, in the Connect dialog box. If notconnecting to the default database, also provide the necessary connect string ordatabase alias.

Note: Developer/2000 automatically displays the Connect dialog box if you try toperform a task that requires connection.

Page 46: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteShow the main menu options, and how they differ in context.

Switch between Object Navigator and Layout editor. Navigator and Insert optionsalternate.

Do not describe Help in detail, there are more details of these options later in thislesson.

1-12 Copyright Oracle Corporation, 1998. All rights reserved.

Main Menu Structure

Page 47: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-21......................................................................................................................................................

......................................................................................................................................................Navigating Around the Developer/2000 Main Menu

Navigating Around the Developer/2000 Main Menu

IntroductionThe main menu within each of the three main application builders is very similar.

The main menu contains options in one builder that do not always appear in another,but their basic functionality is the same throughout. The main menu also variesdepending on your current context in the builder.

Common Menu FeaturesThe following table describes some common features in GUI menus.

Native GUI InterfaceThe menu example here is shown in Windows NT. However, menus appear with thesame look and feel of your native GUI interface.

ExampleIn Motif, the Windows Print Dialog options appear as submenus of the Font menu.

The Builder Main Menu

Feature Description

Underline Shortcut key: [Alt]+letter

Ellipsis (...) Additional input, usually by dialog box

> Menu option has a submenu

Windows menu List of open windows; choose any window to make it active

Help List of help facilities, such as online help text, Cue Cards, Quick Tour

Menu Item Description

File Common file utilities, such as open, save, connect, administration

Edit Cut, copy, paste, and so on

View Switch view in current window; options vary greatly depending on context

Navigator Only appears in Object Navigator; includes expand and collapse, bookmark

Program Includes compilation and access to PL/SQL editors

Tools Includes wizards and preferences

Page 48: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteThe table opposite lists some specific Report Builder properties and some commonto all builders.

Report Builder only:

• Suppress Report Editor on Open

• Unit of Measurement

Common:

• Object Access: File, Database, or File/Database (radio buttons)

• Wizards: Welcome Dialog (show or suppress)

1-13 Copyright Oracle Corporation, 1998. All rights reserved.

Customizing yourDeveloper/2000 Session

Page 49: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-23......................................................................................................................................................

......................................................................................................................................................Customizing Your Developer/2000 Session

Customizing Your Developer/2000 Session

What Are Developer/2000 Tools Preferences?Tools preferences allow you to customize some aspects of yourDeveloper/2000 builder session.

Each Developer/2000 builder has its own set of preferences; however, there aresome that are common to all three.

Report PreferencesThere are five tab pages in the Report Preferences dialog box. Press the Help key([F1] for Windows NT/95) in the Preferences dialog to see a description of eachpreference.

As well as session preferences, Report Builder preferences enable you to setruntime settings when running your report within the builder.

The table describes a few example preferences. We introduce others whenapplicable throughout the course.

Steps to Modify Tools Preferences1 Select Tools—>Preferences.

2 Select the option you require.

3 Choose OK to save changes, or Cancel to cancel changes.

Tab Preference Name Description

General Suppress ReportEditor on Open

Do not display the Report editor when opening areport. This saves you time when opening severalreports to make changes in the Object Navigator.

Unit of Measurement Set the unit of measurement that you want to use fornew reports that you create. Altering this setting doesnot affect existing report definitions.

Objects Access Determines if report definitions are saved to (oropened from) the database or from files, or both. Ifaccess is set to both, Report Builder prompts youwhen you save or open each report.

Wizards Welcome Dialog Check box to suppress or display the first Welcomedialog box. There are several similar check boxes.

Page 50: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

1 Existing preferences file

2 Modified preferences

3 Updated, merged preferences file

1-14 Copyright Oracle Corporation, 1998. All rights reserved.

Saving Tools Preferences

1 2

3

Page 51: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-25......................................................................................................................................................

......................................................................................................................................................Customizing Your Developer/2000 Session

Saving Tools PreferencesWhen you choose OK in the Preferences dialog box, Developer/2000 updates yourcurrent session with the changes.

When you exit the builder, Developer/2000 writes the changes to a preference filefor future sessions.

If the preference file already exists, each Developer/2000 tool merges its changeswith the existing file. This means that preferences for other tools are not affected.

Each option in the preference file is prefixed by the Developer/2000 tool name towhich it belongs.

ExampleOracleGraphics.Rulers = YesReports.Object_Access = FileReports.Show_All = YesForms.welcome_dialog = on

Developer/2000 reads the preference file whenever you invoke the Form, Report, orGraphics builder.

The name of the preference file varies on different platforms:

Note: The preferences file is an editable text file. However, we recommend that,where possible, you alter the options in the Preferences dialog box.

Window Manager Preference Filename

Microsoft Windows cauprefs.ora

Motif prefs.ora

Page 52: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-26 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteWarn students to take care when modifying these variables, because theyimmediately affect the environment and mistakes can prevent applications fromrunning.

Whenever possible later in the course, point out when these variables are used, andremind students to avoid hardcoding pathnames in their applications.

Developer/2000 components also search the local working directory. TheDeveloper/2000: Build Reports course discusses the Report Builder file-searchingmethod in more detail later in the course.

1-15 Copyright Oracle Corporation, 1998. All rights reserved.

Developer/2000 EnvironmentVariables

• FORMS50_PATH

• REPORTS30_PATH

• GRAPHICS30_PATH

• TK25_ICON

• ORACLE_PATH

Windows NT/95: modify in Registry

Page 53: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-27......................................................................................................................................................

......................................................................................................................................................Developer/2000 Environment Variables

Developer/2000 Environment Variables

IntroductionDeveloper/2000 uses many environment variables. These have default values, all ofwhich you can modify in your own environment and for different applications.

In this section we discuss only those variables that relate to file searching at runtime.

Setting PathnamesThe main Developer/2000 builders—Form, Report, and Graphics—use someenvironment variables to search for files at run time. This enables you to buildapplications that are portable across platforms and directory structures by avoidinghardcoded paths in file references within a form, report, or chart.

Generic Oracle PathORACLE_PATH is an additional path that all components search if they cannot finda file in their own specific path.

Modifying Environment VariablesIn a Windows 32-bit environment, use the Windows Registry to modify these paths.Registry path: HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE.

Variable Description

FORMS50_PATH A path that Form Builder searches for files at run time

REPORTS30_PATH A path that Report Builder searches for files at run time

GRAPHICS30_PATH A path that Graphics Builder searches for files at run time

TK25_ICON A path that all builders search for icon files at run time

Page 54: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-28 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

1-16 Copyright Oracle Corporation, 1998. All rights reserved.

Using the Online Help System

• Quick Tour: built-in training package oftechnical information (HTML files)

• Cue Cards: simple step-by-stepinstructions

Page 55: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-29......................................................................................................................................................

......................................................................................................................................................Invoking Online Help Facilities

Invoking Online Help Facilities

Developer/2000 Help OptionsThe table describes the Help menu options in Report Builder.

Most of the Help features are optional extras during product installation, whichrequire additional resources.

Help Menu Option Description

Help Topics This is the Contents Page for comprehensive online help.Includes Index and Find tabs.

The Help key ([F1] for Windows NT/95) displays context-sensitive online help at any place in the builder.

Quick Tour This built-in training package of HTML files is moredetailed than the Cue Cards, including technical explana-tions of the Reports components.

Cue Cards These appear as separate windows that give simple step-by-step instructions and examples to help novice userslearn basic functionality.

Manuals This provides an index to installed online manuals, whichare HTML files that you can view with any browser.

About the Report Builder Appears as two panels:The upper panel shows a server-side connection, when youare connected to a database server. If there is no connec-tion, this panel is blank.The lower panel shows client-side components and theirversion numbers.

Page 56: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-30 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Instructor NoteDemonstration:

Run the prebuilt application to show how all parts of Developer/2000 come togetherin a complete project for this schema. The customer form contains a tab page ofreports. Do not demonstrate too much; you can do more in Lesson 2. The Form stylereport needs the “Demo” tables ACCTS and ACCTS_ADDR.

Explain that the forms application was built with Form Builder (the subject ofanother course). Run a report from a button. This is the kind of report we buildduring this course.

1-17 Copyright Oracle Corporation, 1998. All rights reserved.

Summit Sporting GoodsSchema

s_item s_ord s_customer

s_emps_inventory

s_product s_warehouse s_dept

s_image s_region

Page 57: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-31......................................................................................................................................................

......................................................................................................................................................Introducing the Course Application

Introducing the Course Application

The Summit Sporting Goods SchemaThe simplified table diagram shows the tables that we use throughout this course, tobuild our reports. Some of you will be familiar with these tables from other Oraclecourses.

Summit Sporting Goods is a Company supplying sports goods to customers.Summit has a number of employees in several departments. Some employees aresales representatives who have a relationship to specific customers.

Customers place orders. Each order consists of one or more line items. Each lineitem represents a product.

Each product has an image associated with it, in the form of an image file.

The company products are stored in a number of warehouses. The contents of thewarehouses are managed in the inventory.

Prebuilt Course ApplicationThe prebuilt application consists of forms, reports, and charts, all of which refer tothese tables.

In this course you build similar reports to those that form part of this Developer/2000 application.

Page 58: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-32 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

1-18 Copyright Oracle Corporation, 1998. All rights reserved.

Summary

• Developer/2000 common features

• Common builder interface

• Builder preferences

• The SUMMIT course application

Page 59: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-33......................................................................................................................................................

......................................................................................................................................................Summary

Summary• Developer/2000 provides a suite of components with common features and a

common builder interface for forms, reports, and graphic charts.

• The product provides a common builder interface, including Object Navigator,Layout editor, PL/SQL editor and Property Palette components, and offers acomprehensive online Help system.

• Each Developer/2000 component has a set of preferences that you can alter forthe current and subsequent builder sessions.

• Finally, in this lesson we described the SUMMIT application tables that we usethroughout the course to build our reports.

Page 60: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-34 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

1-19 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 1 Overview

• Navigating through the Developer/2000interface

• Investigating Help topics

• Compiling reports using Project Builder(optional)

Page 61: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-35......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 1

Practice Session Overview: Lesson 1

IntroductionThis practice familiarizes you with Developer/2000 by asking you a number ofquestions that you answer by navigating through the interface and by investigatingHelp Topics.

After each question, space is provided for you to write the answer. Or, if you prefer,use a separate sheet of paper.

Depending on the size of your group, the instructor might ask you to answer someof the questions and share your answers with the rest of the class.

Depending on the environment you are using in this course, the instructor might askyou to compile some reports from the Project Builder.

Instructor NoteThis 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 tobe taught in the next four days

Suggestion: To make this exercise more entertaining and enjoyable, as well asencourage interaction among the class, use this exercise as a class fact-findingmission.

Divide students into groups and ask each group to concentrate on one group ofquestions, for Questions 8 to 11. Encourage them to work together. Then allow timefor 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 studentswhich 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 environmentthere is an optional practice at the end to compile all necessary reports from theProject Builder. Give students the project directory name (one level above the\Demo directory) and the connect string. They must enter these properties for theproject,Dev/2000: Build Reports course, before they compile the files. Werecommend you do this question first, if you want to, so that you can step thestudents through it.

Page 62: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-36 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

Practice Session: Lesson 11 Invoke Project Builder, and open a project reports.upd.

2 Launch Report Builder, and choose Cancel in the wizard.

3 Change your preferences so that a newly opened report is not immediatelyexecuted. To do this you must suppress the Report editor on Open.

4 Open the report named p2q2.rdf.

5 Change your preferences so that you can work with a report definition either in afile or the database. Ensure that the default list shows only reports.

6 Open another report:p2q3.rdf. Notice the additional dialog box.

7 Reset your preferences to work with files only. Enable a report to be runautomatically on open.

8 Use the context-sensitive Help to discover more about preferences.

General:

a What setting must you choose for color mode if you want to alter thecolor palette for a specific report?

b What menu option do you use to alter the color palette?

Runtime values:

c What is the purpose of the Runtime Values?

d When do they take effect?

e What must you do to change the default setting in your report?

f What are the names of the three runtime values that affect the reportdestination, and what are the three related report parameters?

Page 63: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 1-37......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 1

9 Use Help Topics to discover more about the functionality of Developer/2000Report Builder:

a What is MAPI?

b What are the prerequisites for sending a report as an e-mailattachment?

c The report is sent as what type of attachment format?

d What are the three steps to install Developer/2000 demonstrations?

10 Use Help on Manuals to answer the following questions in the OracleInformation Navigator:

Note: In the Information Navigator, choose Tools—>Preferences to initializeyour Web browser. Your instructor will tell you which browser to use.

a What are the three top-level folder names for the online manuals?

b In theGetting Started manual, what are the five topics included inAdministrative Procedures?

c In Designing Portable Applications, what is the purpose of section5.3?

d Name the three language environment variables available whendeveloping multilingual applications.

e What is the Web wizard?

f How can you dynamically deploy a report on the Web?

Page 64: Developer 2000 - Build Reports Volume 1 Instructor Guide

1-38 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 1: Introduction to Developer/2000

11 Use Quick Tour to find out how to prepare a report for the World Wide Web.

a What changes do you have to make to your report to deploy it on theWeb?

b What output formats can you choose from?

Optional Practice12 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 Reportscourse”. In the menu, choose Tools—>Property Palette, or use theright mouse button.

b Under the General Information node, enter the Project directoryname that the instructor gives you.

c Under the Connection node, enter the username, password, anddatabase string that the instructor gives you.

d In the Object Navigator, select the node “Reports to be compiled”. Itis a subproject of the Reports course project that you opened.

e Choose Project—>Compile Selection from the menu. This createsthe runtime files that you need for the next practice session.

Page 65: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

2

Designing and RunningReports

Page 66: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

Instructor NoteTopic TimingLecture 30 minutes

Practice 20 minutes

Total 50 minutes

2-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to

• Name the common report styles.

• Describe the structure of each style.

• Run prebuilt reports using the Runtimeexecutable.

• Distinguish between the various reportoutput destinations.

• View report output in the Previewer.

Page 67: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionYour reports need to satisfy the requirements of your business. To help you beginthe process of translating report requirements into Reports solutions, you need tounderstand the potential range of report styles and gain an appreciation of theunderlying structure. This helps you to make the right decision about which style touse for the report.

This lesson discusses examples of standard report design styles, and describes howto run existing reports to various output destinations.

ObjectivesAt the end of this lesson, you should be able to:

• Name the common report styles required in a business report.

• Describe the structure of common report styles.

• Run prebuilt reports using the Reports Runtime executable.

• Distinguish between the various report destinations.

• View report output in the Previewer.

Page 68: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

Instructor NoteThis is a high-level description to introduce students to the concept of the groupstructure:

• Tabular: One group

• Master-detail: Master-detail hierarchy (maybe several levels)

• Master and multiple details: Two or more detail groups at the same level

• Matrix: Two masters, one detail

We do not mention Form, Form Letter, and Mailing Label styles at this stage, sincethese are all variations of a single-group report.

2-3 Copyright Oracle Corporation, 1998. All rights reserved.

Specification

Structure

Designing Reports

Before you start development, consider:

Data retrieval

Common features

Style

Page 69: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-5......................................................................................................................................................

......................................................................................................................................................Designing Reports

Designing Reports

IntroductionBefore you create a report using any report writing software, you must first considerthe type of reports that you are being asked to produce.

You will have a specification of the required output, but you also need to know thestructure that is required, and the most efficient way to retrieve data.

Also, consider whether this is a one-time requirement, or whether this specificationshares common features with other reports, especially where multiple reports arerequired within the same application.

There are a few standard styles of reports that form the majority of all reportingrequirements.

This section teaches you to recognize the common styles, to enable you to interpretyour report requirements and choose the correct style when developing reportdefinitions.

The Common Report StylesThe majority of report requirements fall into the following categories:

• Tabular

• Master-detail

• Master and multiple details

• Matrix

Page 70: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

2-4 Copyright Oracle Corporation, 1998. All rights reserved.

Tabular

ProductNumber Description Price

List of Products

Page 71: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-7......................................................................................................................................................

......................................................................................................................................................Design Considerations

Design Considerations

IntroductionDefine the report structure by identifying the number of times each piece of dataprints. Separate the data into groups based on this frequency. You may also need toidentify any relationships that exist between groups, so that you can create ahierarchyin the internal report structure.

This section describes the four main styles of report and the group structure foreach.

Tabular Report StyleIn the List of Products report displayed opposite, all fields for each product number,product description, and price, print with the same frequency. They each repeat avalue for every product record.

This report structure contains a single group.

In Tabular reports, the headings or labels, appear once above each field.

Page 72: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

2-5 Copyright Oracle Corporation, 1998. All rights reserved.

Master-Detail

Customer NameProduct Number Price

Customer NameProduct Number Price

Outstanding Customer Items

Page 73: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-9......................................................................................................................................................

......................................................................................................................................................Design Considerations

Master-Detail Report StyleThe Outstanding Customer Items report displays one customer name, followed byseveral records containing the products and prices of items ordered but not yetreceived. This structure is repeated for every customer who has unfulfilled orders.The customer name does not repeat for every outstanding product; the frequency isdifferent.

This report structure contains two groups.

Each list of products is directly related to the preceding customer name, whichmeans that there is a master-detail hierarchy. Customer information is in one group,called themaster, and the product information is in a second group, called thedetail.

Note: In this Master-Detail report, the headings or labels appear as follows:

Group Label Placement

Master Labels appear to the left of fields.

Detail Labels appear above fields (as for a tabular report).

Page 74: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

2-6 Copyright Oracle Corporation, 1998. All rights reserved.

Master with Two Details

Customer

Outstanding Items Orders in Last Six Months

Total ValueProduct Number Price

Order No. Date

Customer Statistics

Page 75: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-11......................................................................................................................................................

......................................................................................................................................................Design Considerations

Master with Two Details StyleMore than one group may appear at the same level in a hierarchy.

Consider the Customer Statistics report. This report has the same information as theOutstanding Customer Items report, with the addition of another group displayingorders placed in the last six months.

Both groups, Outstanding Items and Orders in Last Six Months, relate to eachcustomer, but not directly to each other.

This report has three groups, one master and two detail groups. The two detailgroups are related to the master at the same lower level.

Page 76: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

2-7 Copyright Oracle Corporation, 1998. All rights reserved.

Matrix

Product ID

Customer

Customer Matrix

Page 77: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-13......................................................................................................................................................

......................................................................................................................................................Design Considerations

Matrix Report StyleThe Customer Matrix report displays a group of master customer records down thepage, a group of master product records across the page, and a group of detailsummary calculations.

The detail group is related to both of the master groups.

In this report structure, the master groups are on the same level, with the detailgroup below.

This is an example of a simple matrix. Later you see that matrix reports can havemultiple levels of nesting.

Two MastersThe matrix style is the only style in which a detail group is related to two differentmaster groups at the same level.

Page 78: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

2-8 Copyright Oracle Corporation, 1998. All rights reserved.

Retrieving and Sharing Data

• Keep database access to a minimum.

• Consider report structure and numberof queries.

• Make effective use of common code andobjects.

Page 79: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-15......................................................................................................................................................

......................................................................................................................................................Retrieving and Sharing Data

Retrieving and Sharing Data

IntroductionOne of the primary considerations of any report is to ensure that it runs efficiently.The points below provide guidance for future reference.

SQL and Database AccessData for the report is retrieved from the databaseusingSQL SELECTstatements.Aim to keep database access to a minimum. The fewer queries your report contains,the faster it retrieves data.

With hierarchical reports that contain more than one group, you can either use onequery and create additional groups, or use many queries and manually link thegroups. The one-query approach is usually preferable.

Report StructuresThe report style also affects the number of queries required. A master with multipledetail groups requires an additional query for each extra “sibling” group. Matrixreports can contain one or several queries.

The table below shows the number of queries you can use to create the reports inthis lesson.

Using Common CodeIn Reports, you can create queries, PL/SQL libraries, and stored program units thatare accessible to more than one report. Consider which code is common and ensurethat all developers have access to it.

Using Common ObjectsMany reports have a standard layout for features such as page size, margin widths,company logo image, font size, and style. Consider creating onetemplatecontaining these common features, that can be the basis of all reports. You can alsoenhance individual reports with specific changes. Good template designstandardizes the appearance of your reports and helps to ensure that, as a developer,you maintain documented standards.

Report Name Number of QueriesList of Products 1Outstanding Customer Items 1 or 2Customer Statistics 2 or 3Customer Matrix 1, 2 or 3

Page 80: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

Instructor NoteNow that students understand the basic report examples, they can run somepreexisting reports, to see the output and identify the output options (destinations).This familiarizes them with the appearance of the report styles we have discussedand with the runtime previewer, which is different from the Live Previewer that theyuse later in Report Builder.

Demonstrate the Report Runtime option in the Developer 2000 R2.0 menu, usingone of the prebuilt .rep files in your directory, since this is the simplest method forthem to use in the practice.

You might also want to demonstrate invoking the R30RUN command from thecommand line.

Demonstrate a report that has parameters(paramfrm.rdf). Show the parameter formwhich only appears if user parameters exist or if you create your own parameterform. We discuss the parameter form in a separate lesson. Theparamfrm reportshows Destination Type, which leads to the topic on the next page.

2-9 Copyright Oracle Corporation, 1998. All rights reserved.

Running a Report

Use the R30RUN executable from:

• Front end menu

• Menu integrated with a Formsapplication

• Button in a Forms application

• Command line (Start—>Run)

• Runtime option in your Windows menu

– Connect to database

– Enter parameters

Page 81: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-17......................................................................................................................................................

......................................................................................................................................................Running a Report

Running a Report

IntroductionTo run a report created with Developer/2000 Reports, you use the executableprogram called R30RUN.

Invoking a ReportThere can be many ways of invoking a report, depending on the application design.You can call a report from:

• A front end menu.

• A customized menu in a Forms application.

• A button in a Forms application.

• The command line, using the Start—>Run option in Windows NT.

• The Reports Runtime item in your Windows menu.

Whichever method you use, R30RUN is the command that is executed behind thescenes.

Steps to Run a Report from the Microsoft Windows NT Menu1 Choose the Reports Runtime item in the Developer/2000 R2.0 menu.

2 You must connect to the database. In the File—>Connect dialog box enter yourusername, password and database alias. ChooseConnect.

Note: If you are connecting to your default database, you do not need to specifythe alias.

3 Choose File—>Run. In the file selection dialog box search through the list ofreports, select the report you wish to run and chooseOK. You may need tochange your drive or directory. If so, amend the Drives list.

The Runtime Parameter Form is displayed for some reports. This allows you toenter different runtime values, such as the report destination.

4 Enter the parameter values required and choose Run Report. You can cancel thereport by choosing Cancel.

Page 82: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

Instructor NoteDescribe the destination types briefly. Mention different file types, including PDF/HTML.

We do not discuss deploying reports on the Web in detail in this course; there is aseparateDeveloper/2000: Deploy Web-based Applicationscourse.

MailYou can e-mail bitmap or character reports. If bitmap, the report becomes a file oftype.eps. You need some kind of postscript viewer to display it on the screen. Thereare several shareware postscript viewers on the market, such as Ghostview.

Planned for Release 2.1: DESTYPE=InterOffice, to push report output to theInterOffice repository.

The rest of this lesson concentrates on using the runtime Previewer.

2-10 Copyright Oracle Corporation, 1998. All rights reserved.

Report Destinations

Screen: format with screen fonts

Preview: format with printer fonts

File: choose file format

Mail: MAPI-compliant

Printer: output direct to printer

Page 83: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-19......................................................................................................................................................

......................................................................................................................................................Viewing the Report Output

Viewing the Report Output

IntroductionYou use the Destination Type parameter to control whether you see the report on thescreen, send it to a printer, or output it to a file.

Report Destination OptionsThere are a number of options available to the user.

Destination Type Actual DestinationScreen Routes the output to the Previewer for interactive viewing. Useful

when viewing output on the screen only.Preview Routes the output to the Previewer, for interactive viewing when

users require subsequent printing of the output.However, Previewer causes the output to be formatted using aprinter font. The Previewer uses Destination Name to determinewhich printer’s fonts to use to display the output.

File Saves the output to a file named in Destination Name. The formatdepends on Destination Format; this can be a printer definition or abrowser format, such as PDF and HTML.

Printer Routes all output directly to the printer named inDestination Name.

Mail Sends the output to a user of Oracle Mail, Oracle Office, OracleInterOffice (or any MAPI-compliant mail system). Username isspecified in Destination Name.

Page 84: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

1 Page options: First, Previ-ous, Next, Last

3 Print, Mail, and Print Setupoptions

2 Go to specific page number 4 Help: Previewer

2-11 Copyright Oracle Corporation, 1998. All rights reserved.

Previewing Reports

1 2

3 4

Page 85: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-21......................................................................................................................................................

......................................................................................................................................................Viewing the Report Output

Previewing ReportsWhen you specify a destination of Screen or Preview, your formatted report outputappears in the Report Previewer.

You can navigate the screen, view each page, and even split the screen and scrollseparately through each portion.

The Previewer WindowThe Previewer has three components:

Navigating Through the Previewer WindowYou can navigate through the Previewer using the scrollbars and the iconic buttonsin the toolbar at the top of the Previewer window. The toolbar includes buttons toperform the following actions:

Component Description

Main Menu Contains a subset of menu options, such as Quit and Help

Title Default isreport_name: Previewer; you can modify the title inTools—>Tools Options

ViewingRegion

The area where you browse through each page of your report, using buttonsto navigate, split screens, or open a new Previewer window

Button Description

First Page Go to first page

Previous Page Go to previous page

Next Page Go to next page

Last Page Go to last page

Page: Go to the page number that you enter in the field

Print Print the report (to file or printer)

Mail Send report to MAPI-compliant mail system

Print Setup Display the Print Setup dialog, to change printer settings

Help Display the Previewer page in the online Help system

Page 86: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

Instructor NoteDemonstration:

Show these features, especially how to split the screen. This is a good feature todemonstrate; the way to split the screen is not obvious to students if you do notshow it.

For your own information: this is different from the way in which you split thescreen in the builder’s Live Previewer. We show the Live Previewer later.

1 New Previewer, Close Pre-viewer options

3 Choose this rectangle to splitPreviewer horizontally

2 Zoom in, zoom out tools 4 Choose this rectangle to splitPreviewer vertically

2-12 Copyright Oracle Corporation, 1998. All rights reserved.

Previewing Reports1 2

3

4

Page 87: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-23......................................................................................................................................................

......................................................................................................................................................Viewing the Report Output

Viewing Multiple PagesTo view the contents of more than one page at the same time, choose New Previewerto open another Previewer window. The window menu item shows the number ofPreviewer windows open at any time. Close each Previewer window individually.

Viewing Large PagesWhen viewing large report pages, you can split the Previewer window eitherhorizontally or vertically, to show the extreme left and right, or top and bottomportions of a page.

• Horizontal split: Click and drag the gray rectangle above the vertical scrollbar.

• Vertical split: Click and drag the gray rectangle to the left of the horizontalscrollbar.

Release the mouse button at the position you want to split the viewing region.

Magnifying and Reducing the Report ViewZoom in and zoom out buttons are available on the toolbar. Select the large plus signto zoom in, and the small minus sign to zoom out.

Page 88: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

2-13 Copyright Oracle Corporation, 1998. All rights reserved.

Viewing Options

• Screen and Preview use different fontsfor formatting

– Screen: screen fonts

– Preview: printer fonts

• Preview avoids truncation warningwhen printing report from Previewer

Page 89: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-25......................................................................................................................................................

......................................................................................................................................................Viewing the Report Output

Viewing Options: Screen or PreviewIt is important to understand the difference between Preview and Screen. Bothdisplay the output in the Previewer window; however, they format the output usingdifferent fonts:

Using Preview gives you a better impression of how the printed result will appear. Ifusers are likely to print reports after viewing in the Previewer, ensure that thedestination is always Preview, to avoid the warning message.

Destination Type DescriptionScreen Formats the output using the screen font that you specify in the

Layout. It does not consider printer fonts. Printing the report fromthe Previewer results in a warning message; the output might betruncated if the printer font is larger.

Preview Formats the output as if it were being sent to the printer. It usesprinter fonts to format, but uses the screen fonts to display. Printingthe report from the Previewer does not result in any warning mes-sage; the output prints correctly because the format has allowed forthe size of printer font.

Page 90: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-26 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

Instructor NoteDemonstration:

Uselongrun1.rdf if you want to demonstrate this feature. The query is a cartesianproduct, which produces many pages of output.

2-14 Copyright Oracle Corporation, 1998. All rights reserved.

Canceling or Pausing ReportExecution

Available in Microsoft Windowsenvironment only.

Page 91: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-27......................................................................................................................................................

......................................................................................................................................................Viewing the Report Output

Canceling or Pausing Report ExecutionYou can cancel or pause report execution while a report is running using the ReportProgress dialog box. To halt execution of a running report:

• Select “Cancel report” to immediately cancel processing. You cannot continueformatting the report if you cancel processing, but you can still browsepreviously formatted pages.

• Select “Break at next page” to format to the end of the current page beforecanceling processing. This button appears in the dialog box only if you select (toformat the last page) or type a page number (two more pages after the currentpage) in the Previewer window. You can browse previously formatted pages,and then continue processing the report.

Note: This feature is only available in the Microsoft Windows environment.

Page 92: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-28 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

2-15 Copyright Oracle Corporation, 1998. All rights reserved.

Summary

• Designing reports

– Design structure

– Database access

– Common objects and code

• Executing reports

– Output destinations

– Screen or printer fonts

Page 93: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-29......................................................................................................................................................

......................................................................................................................................................Summary

Summary

Designing ReportsBy discussing in some depth the report styles and structures, you should now beable to:

• Appreciate the principle of groups and frequencies of data.

• Describe simple report styles and their underlying structure.

• Realize the importance of database access and report performance, and considerthis for every report you design.

• Consider at the very early stages of development usage of common code andobjects.

Executing ReportsYou have seen that there are a number of different ways to execute a report.Whatever the method, each uses the R30RUN executable.

• A report can have a runtime parameter form, allowing user input to controlreport data and output.

• Output can be to one of a number of different destinations, such as screen, file,or printer.

• If you choose a destination of Screen or Preview, you view the output in thePreviewer window, where you can control many options including what page toview, magnify text, split screen, and the number of Previewer windows open.

Page 94: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-30 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

2-16 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 2 Overview

• Invoking the Reports Runtimeexecutable

• Executing existing reports

Page 95: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-31......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 2

Practice Session Overview: Lesson 2This practice session contains:

• Invoking the Reports Runtime executable from the Program Manager

• Executing a number of different reports. For each report, answer some questions

IntroductionBefore you learn to develop reports in the Builder, you should investigate theruntime executable that you use constantly in the production environment and fortesting your reports prior to production.

This practice session consists of a combination of practical and paper basedquestions.

Page 96: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-32 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

Practice Session: Lesson 21 Invoke the Reports Runtime executable.

2 Run the report called p2q2.rep.

a Examine the report in the Previewer window. Using the stylesdiscussed in this lesson as a reference, what style of report is it?

b How many groups of data are there in this report?

c In the Previewer window use the scrollbars to move up and down thereport to see all of the data.

d Close the previewer window. You are now back in the Runtimewindow.

3 From the Runtime window, run report p2q3.rep.

a In the Previewer window, move to the next page. Notice this reporthas a header page with text. Notice that the Previewer also has manymore buttons highlighted. This is because there are more availableactions, such as Next Page, Previous Page, Last Page, First Page.

b What style of report is this?

c In the Previewer window, experiment with the horizontal and verticalsplit screen features.

d Close the Previewer window. You are now back in the Runtimewindow.

4 From the Runtime window, run report p2q4.rep.

a The first thing you will notice is the size of the Previewer window.The reason it is so small is that the page size specification is inheritedby the Previewer screen.

b What style of report is this?

c How many groups of data are in this report?

d How many pages are there in this report?

e Close the Previewer window. You are now back in the Runtimewindow.

5 From the Runtime window, run reportp2q5.rep.

a What style of report is this?

b How many groups of data are in this report?

c Close the Previewer window. You are now back in the Runtimewindow.

Page 97: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 2-33......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 2

6 From the Runtime window, run reportp2q6.rep.

a Notice the Parameter Form. Choose the Destination Type: “Screen”.

b In the Parameter Form you are requested to input a customer ID. Thereport will display order information based on your input.

c Specify a valid customer ID and run the report. Valid values include:201, 210 or 213; choose one of these. Having entered a valid numberchoose Run Report.

d What do you think would be a better method of providing validvalues to a user?

e Close the Previewer window. You are now back in the Runtimewindow.

f Run the report again, this time do not specify a customer ID.

i What is the result?

ii In a production situation, what should happen in this instance?

g Close the Previewer window. You are now back in the Runtimewindow.

h Run the report again, this time enter Customer Id 999.

i What is the result?

ii In a production situation, what should happen in this instance?

i Close the Previewer window. You are now back in the Runtimewindow.

7 From the Runtime window, run reportp2q7.rep.

a In the Parameter Form notice the list of values for the Customerinformation. The report will display order information based on yourinput.

b Select a valid customer name and run the report. In the Previewer,choose Print. What is the result?

c Do not print the report.

d Close the Previewer window. You are now back in the Runtimewindow.

e Run the report again, this time choose Preview as destination type.

f In the Previewer, choose Print. What is the result?

g Do not print the report.

h Close the Previewer window. You are now back in the Runtimewindow.

Page 98: Developer 2000 - Build Reports Volume 1 Instructor Guide

2-34 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 2: Designing and Running Reports

8 From the Runtime window, run reportp2q8.rep.

a What do you notice that is different about this report?

b Choose Details. Another report is called to display information aboutthe orders the customer has placed with the company. This is called aDrill-Down report.

c Close the Orders report Previewer window, and then close theCustomer report Previewer window. You are now back in theRuntime window.

d Exit Reports Runtime.

Page 99: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

3

Report Builder Concepts

Page 100: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

Instructor NoteTopic TimingLecture 30 minutes

Practice 15 minutes

Total 45 minutes

3-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to

• Describe the main Report executables.

• Describe the main components ofReport Builder.

• Describe the main objects in a report.

Page 101: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionThis lesson describes the Report executables and gives an overview of the ReportBuilder, including a high-level description of its components and object hierarchy.

ObjectivesAt the end of this lesson, you should be able to:

• Describe the main Report executables.

• Describe the main components of Report Builder.

• Describe the main objects in a report.

Page 102: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

Instructor NoteFor Motif platforms, append an “m” to the 6-character executable name: r30desm,r30mtsm, and so on.

R30ISV is only applicable and available on Microsoft Windows platforms.

For your information, if you are teaching soon after release date:R30MTS and R30RQM will be available on Windows NT (and 95) or Solaris. Thefirst port for Developer/2000 releases is Microsoft Windows; therefore, release onSolaris is usually several weeks later. This is particularly significant for the remoteReport Server: even if development takes place on Windows NT, deployment of theServer might be on a high-volume back-end machine such as Solaris.

3-3 Copyright Oracle Corporation, 1998. All rights reserved.

Executables

Report BuilderR30DES

Report ServerR30MTS

Report RuntimeR30RUN

Report ConverterR30CON

Queue Manager R30RQM

Background EngineR30RBE

run reportR30ISV

run reportR30CLI

• Report background engine

• Remote report server

• Development and runtime

Page 103: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-5......................................................................................................................................................

......................................................................................................................................................Report Executables

Report Executables

IntroductionReport executable filenames are operating system specific.

In Windows, all Reports executables follow a similar pattern: R30<?>32.EXE.

For simplicity, we ignore the 32 suffix and.exe file extension in the table below.

What Are the Main Reports Executables?

WindowsFilename

ExecutableTitle Description

R30DES Report Builder Create, develop and maintain report definitions.

R30RUN Report Runtime Runtime environment for production or testing.

R30CON Report Converter Converts a report definition to alternate storageformats.

R30MTS Report Server Install/invoke a multi-threaded remote server.

R30CLI Report Client Send a report to a remote server.

R30RQM Report Queue Manager View/schedule reports on a remote server.

R30RBE Report BackgroundEngine

Invoke the local report background engine.

R30ISV Interactive Server Send a report to the local report backgroundengine. (Microsoft Windows only)

Page 104: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

Instructor NoteIf you invoke Report Builder at this stage, do not choose the wizard, choose theoption “Open an existing report”, and choose a simple report, such astabular.rdf, todemonstrate the components and objects in the builder.

3-4 Copyright Oracle Corporation, 1998. All rights reserved.

Invoking Report Builder

Page 105: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-7......................................................................................................................................................

......................................................................................................................................................Report Executables

Invoking Report BuilderIn the previous lesson you used the runtime executable, R30RUN, to run somereports. Now we invoke Report Builder, the R30DES executable, and look at thedefinitions of some reports, to describe the components and objects in the builder.

The Welcome Dialog BoxWhen you invoke Report Builder, the initial Welcome dialog box provides a checkbox “Display at start-up” that you clear if you want to suppress this screen.

If you clear this option, and then later want to see the Welcome dialog box, youmust change the relevant option in the Preferences dialog box.

Steps to Display the Welcome Dialog Box1 Choose Tools—>Preferences.

2 Select the Wizard tab.

3 Select the Welcome Dialog check box.

Page 106: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

Instructor NoteBriefly explain the different module types, but point out that the rest of this lessondiscusses the report definition. We discuss the other three objects later in the course.

3-5 Copyright Oracle Corporation, 1998. All rights reserved.

Modules

Report Query

PL/SQL LibraryTemplate

SELECT...

FROM...

Page 107: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-9......................................................................................................................................................

......................................................................................................................................................Report Builder Components

Report Builder Components

IntroductionThe Report Builder interface enables you to create a number of different types ofmodule, and it provides a Report editor in which you can view the structure andobjects in a report module.

This section gives an overview of the module types and explains the different viewsin the Report editor.

Types of Report Builder ModulesThe Report Builder allows you to create a number of different module types.

Module Type Description

Report A report definition

Query An external query stored in a text file, or on the database, that you canreference from or copy into a report definition

Template A skeleton definition containing common style and standards; can includegraphics; provides a standard format to enable quick and easy developmentof professional standard look-and-feel reports

PL/SQLLibrary

A stand-alone library containing PL/SQL program units: procedures,functions, packages, that can be called from multiple Developer/2000applications

Page 108: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

3-6 Copyright Oracle Corporation, 1998. All rights reserved.

Data and Layout

3-7 Copyright Oracle Corporation, 1998. All rights reserved.

Report Editor

Page 109: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-11......................................................................................................................................................

......................................................................................................................................................Report Builder Components

Report Data and LayoutA Developer/2000 report definition defines two main parts of a report and bringsthem together in the output.

• Data: Data structure and values to be displayed.

• Layout: Formatting information about how the values appear in the output.

The Report EditorThe Report editor contains two views to handle the data objects and layout objectsseparately:

The Report editor also contains the following two views:

The Live Previewer displays the report output, as it appears when printed. The otherthree views contain their own specific objects.

You can create many fully-functional reports simply by using the wizard andmodifying the report in the Live Previewer. However, this course also teaches you inlater lessons how to use the Data Model, Layout Model, and Parameter Form so thatyou can create more complex reports if necessary.

View Description

Data Model Displays a structural representation of the data in a report. Theobjects do not appear in the report output, but the structuredetermines the layout style and the data objects provide the valuesthat appear in the layout objects.

Layout Model Displays the layout objects in a report, and allows you to make manymodifications to any layout object. All layout objects have propertyproperties that you can modify in a property palette.The hierarchy of the layout objects is determined by the Data Model.

View Description

Live Previewer Displays report output and allows you to make many commonlyrequired, simple modifications to the layout, such as spacing, format-ting fields, color, and editing text, without having to open the LayoutModel.

Parameter Form Displays the layout of the parameter form that, at run time, allowsuser-input of parameter values.

Page 110: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

3-8 Copyright Oracle Corporation, 1998. All rights reserved.

Report Level Objects

ParameterForm

DataModel

LayoutModel

Properties TriggersPL/SQL

program units

Report

Page 111: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-13......................................................................................................................................................

......................................................................................................................................................Object Categories

Object Categories

IntroductionThe Report Module consists of many objects that fall into the following fourcategories:

• Report level

• Data Model

• Layout Model

• Parameter Form

This section gives an overview of the objects in each category.

Note: All the objects mentioned in this section are discussed in greater detailduring later lessons.

Report Level ObjectsThe report objects define the measurements, dimensions, triggers, and the PL/SQLprogram units of a report. The report object itself consists of the following:

Object DescriptionProperties Define page dimensions and Previewer settings, for exampleTriggers Allow PL/SQL to be executed at different stages of the report

executionPL/SQL Program UnitsContain functions and procedures that can be called from

report-level objects in the same report

Page 112: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

Instructor NoteMention that you can only modify existing objects in the Object Navigator; use therelevant editor to create the objects (parameters are the only exception). If studentshave attended the Forms class, you should stress this point, as this is different fromthe functionality of the Object Navigator in Form Builder.

3-9 Copyright Oracle Corporation, 1998. All rights reserved.

Data Model Objects

DataModel

QueriesDatalinks

Groups

ParametersColumns

Columns

Page 113: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-15......................................................................................................................................................

......................................................................................................................................................Object Categories

Data Model ObjectsThe Data Model objects for a report define the data used in the report and the datastructure. Data Model objects appear in the Data Model editor and the ObjectNavigator. Data Model objects can be of the following types:

With the exception of parameters, you create all objects in the relevant editor, not inthe Object Navigator.

Parameters do not appear in the editor. You create and modify parameters in theObject Navigator only.

Object DescriptionQuery Select the data for your reportGroup Organize the data to form the required hierarchical structureColumns Contain individual data values; database columns exist by default

and contain data from the database columns or expressions definedin the query; you can also create Formula, Summary, andPlaceholder column types

Data Link Join queries for complex data relationshipsParameter Provide for runtime defaults or user input; system parameters exist

by default; you can also create User Parameters

Page 114: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

3-10 Copyright Oracle Corporation, 1998. All rights reserved.

Layout Model Objects

Frames BoilerplateRepeating

framesFields

OLE2

LayoutModel

Page 115: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-17......................................................................................................................................................

......................................................................................................................................................Object Categories

Layout ObjectsThe Layout Model objects define the format of the report including the positioningand appearance ofdata, text,andgraphics. The main layout objects fall into thefollowing categories:

We discuss these and other layout objects in a later lesson.

OLE2 SupportReport Builder supports the use of OLE2. The Layout Model includes an OLE2 toolthat allows you to create an OLE2 container and define the contents.

Object DescriptionRepeating Frame Contains other objects and prints once for each record of the

associated groupFrame Contains other objects and prints only onceField Contains data and other variable values and their formatsBoilerplate Contains text or graphics that may appear anywhere in the

report

Page 116: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

3-11 Copyright Oracle Corporation, 1998. All rights reserved.

Parameter Form Objects

ParameterForm

Fields Boilerplate

Page 117: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-19......................................................................................................................................................

......................................................................................................................................................Object Categories

Parameter Form ObjectsThe Parameter Form objects define the appearance of the runtime parameter form.You create and modify runtime parameter form objects.

Note: The Parameter Form controls the layout of the runtime parameter form. Theobjects are similar to layout objects. The source of a parameter field comes from aparameter that is a Data Model object. Parameters appear in the Object Navigator,not in the Data Model view.

Object DescriptionField Contains parameter valuesBoilerplate Contains constant text or graphics that appear on the runtime

parameter form

Page 118: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

1 Each query fetches data records, and structures them in the grouphierarchy.

2 Each group is the source of a repeating frame.

3 Each column is a source of a field.

3-12 Copyright Oracle Corporation, 1998. All rights reserved.

Object Interrelationship

Select...

1

2

3

Page 119: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-21......................................................................................................................................................

......................................................................................................................................................Object Categories

Object InterrelationshipNow that you know the different categories of objects, it is also important tounderstand the relationship between these objects.

The diagram opposite shows the interrelationship between some of the mostcommon objects, explained in terms of a simple tabular report:

Data Model Objects• A query fetches records from the database.

• Each fetched record becomes an instance of the relatedgroup.

• Each database value is fetched into the relatedcolumn.

Layout Objects• A column provides the value that is displayed in one or more layoutfields.

• A fieldmust display all instances of its related column value; therefore, eachrecord instance of a group is represented by arepeating framethat contains allthe relevant fields.

Page 120: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

3-13 Copyright Oracle Corporation, 1998. All rights reserved.

Summary• Executables for development and

deployment

• Report Builder modules:

– Report, Template, External Query,PL/SQL Library

• Report editor: switch views

– Live Previewer, Data Model, LayoutModel, Parameter Form

• Object categories:

– Report, Data, Layout, Parameter

Page 121: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-23......................................................................................................................................................

......................................................................................................................................................Summary

SummaryDeveloper/2000 provides a number of executables for developing and deployingreports, including Report Builder.

The Report Builder interface allows you to develop four types of module, includingreport definitions.

Report Builder provides a Report editor in which you can view and modify theobjects that the wizard creates. You can also create your own objects to enhanceyour report structure and layout.

The Report editor allows you to switch views, depending on the objects that youwish to modify.

Objects in a Report module falls into four categories: Report, Data Model, LayoutModel, and Parameter Form.

Page 122: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

3-14 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 3 Overview

• Invoking Report Builder

• Opening an existing report

• Switching views in the Report Editor

• Accessing the Help System

Page 123: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 3-25......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 3

Practice Session Overview: Lesson 3This practice session contains:

• Invoking Report Builder

• Opening an existing report

• Switching views in the Report editor

• Accessing the Help System

IntroductionThe questions in the practice session provide an introduction to the Report Builderinterface. You open and navigate through an existing report definition and use theHelp system to obtain information about some of the Report executables.

Page 124: Developer 2000 - Build Reports Volume 1 Instructor Guide

3-26 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 3: Report Builder Concepts

Practice Session: Lesson 31 If you closed Project Builder in Practice 1, invoke Project Builder, and then

invoke Report Builder from the Project Builder launchpad toolbar. If it is stillopen, go to Report Builder.

2 Open an existing report: p3q2.rdf.

3 In the Report editor, switch to the Data Model view.In the Object Navigator, select Q_1.Hint: Use the Find field at the top of the Object Navigator.Notice the object that is selected in the Data Model view.

4 In the Report editor, switch to the Layout Model.In the Object Navigator, select F_ID.Hint: Use the Find field at the top of the Object Navigator.Notice the object that is selected in the Layout Model view.Fully expand the Layout Model node, and select R_G_ORD_ID.Notice the object that is selected in the Layout Model view.

5 In the Report editor, switch to the Parameter Form view.In the Object Navigator, expand the Parameter Form node. SelectPF_DESTYPE. Notice the object that is selected in the Parameter Form.Use the Find field at the top of the Object Navigator to select P_CUSTID. Is anyobject selected in the Parameter Form? What is the reason?

6 Use Help Topics to answer the following questions:

a What is R30MTS?

b What is R30CLI?

c Close the Help system.

Page 125: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

4

Creating Reports Usingthe Report Wizard

Page 126: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Instructor NoteTopic TimingLecture 50 minutes

Practice 60 minutes

Total 110 minutes

4-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to• Create a simple tabular report.• Describe the different methods of

building the report query.• Summarize report values.• Modify the style and content of a report.• Create other report styles available in

the wizard.

Page 127: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionIn this lesson you learn how to create a simple tabular report and modify the reportby adding data and altering the report style. This lesson also shows you how tocreate other styles of report that are available from the Report wizard.

ObjectivesAt the end of this lesson, you should be able to:

• Create a simple tabular report using the Report wizard.

• Describe the different methods of building the report query.

• Summarize report values.

• Modify the style and content of a report by reentering the wizard.

• Create other report styles available in the wizard.

Page 128: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Instructor NoteFrom the Project Builder launchpad, invoke Report Builder to show the wizard atthis stage. This might mean that you must close Report Builder at the end of theprevious lesson.

Later you show them how to create a new report using the wizard when ReportBuilder is already open.

4-3 Copyright Oracle Corporation, 1998. All rights reserved.

Invoking Report Wizard

Page 129: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-5......................................................................................................................................................

......................................................................................................................................................Invoking Report Builder and the Report Wizard

Invoking Report Builder and the Report Wizard

IntroductionRemember, from a previous lesson, that you can invoke Report Builder eitherdirectly from the Developer/2000 menu, or launch Report Builder from withinProject Builder.

In both cases, when you open Report Builder, the Welcome screen gives you theoption of using the wizard to build a new report.

The Report WizardThe Report wizard provides an easy step-by-step interface to create a new report.

The Report wizard has a Welcome page. To suppress this page, clear the check box“Show this page next time”.

You can reinstate this page in the same way as the Welcome dialog box in ReportBuilder; select the Wizard tab of the Preferences dialog box, and select ReportWizard Welcome Page.

Each page of the Report wizard asks you for information, to help you create yourinitial report. Step through the wizard pages choosing Next and Back, until you aresatisfied with the initial information that you have entered. On the last page, chooseFinish.

Page 130: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Instructor Note(If you used Rel.1, note that Master/Detail is now Group Left or Above.)

Demonstration:

1 Create a tabular report.

2 Use Query Builder, base query on S_EMP table: LAST_NAME,FIRST_NAME, TITLE, DEPT_ID, SALARY, COMMISSION_PCT.

3 Display all fields, and re-order some: such as FIRST_NAME beforeLAST_NAME.

4 Create a total for SALARY.

5 Change some column labels and reduce widths, such asDEPT_ID: Label=Dept, Width=2SALARY: Width=6TOTAL: Width=6 (if you do not reduce TOTAL, you will not see a change in thesalary column width).

Explain how you create the report as you step through the demonstration. Thefollowing pages display more screenshots of the Report wizard pages, for thestudents’ information. Do not show them all in detail if you have already explainedthe pages during your demonstration.

However, remember there are more Instructor Notes on the following pages.

4-4 Copyright Oracle Corporation, 1998. All rights reserved.

Creating a Tabular Report

Wizard Pages

• Report Style

• Data Query

• Fields

• Totals

• Labels

• Template

Page 131: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-7......................................................................................................................................................

......................................................................................................................................................Creating a Tabular Report Using the Wizard

Creating a Tabular Report Using the Wizard

IntroductionYou can use the wizard to build eight styles of report. In this section, we stepthrough the wizard pages to create a tabular report. Later in this lesson, we createsome other report styles.

Report StylesThe first wizard page, after the Wizard Welcome, shows the various styles of report.Select Tabular, and choose Next.

Wizard PagesWhen you choose the Tabular style of report, the wizard steps you through thefollowing pages:

Page Name Description

Data Enter a select statement to retrieve the report data.

Fields Select the fields that you want to display in the output.

Totals Select the fields that you want to summarize.

Labels Alter the labels that appear for each field, and the width of each field.

Template Select the template that you want to use for this report. A template containsstandard information such as company logo, date, and so on.

Page 132: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

4-5 Copyright Oracle Corporation, 1998. All rights reserved.

Using the Query Builder

4-6 Copyright Oracle Corporation, 1998. All rights reserved.

Building a Query

Page 133: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-9......................................................................................................................................................

......................................................................................................................................................Creating a Tabular Report Using the Wizard

Using the Query BuilderBuild your query using the Query Builder GUI. This saves you time and increasesthe ease-of-use for developers not familiar with building SQL statements, or withthe application tables.

Steps to Use the Query Builder1 Choose Query Builder from the query page in the Report wizard.

2 Enter your username, password, and alias in the Connect dialog box that appearsif you have not already connected to the database.

3 Select the data tables to build the query.

4 Choose Include, and the tables appear in the selection area.

5 Choose Close, to close the Select Data Tables window.

6 In each table, double-click the column names that you want in the query, ordouble-click the Table title bar to select all columns.

7 Choose OK.

Query Builder copies the query syntax into the Report wizard. You can modify thequery by reentering the Query Builder, or modifying the SQL query statement text.

Note: If you prefer to write your own SQL statement, enter the syntax directly inthe SQL query statement area of the Query page. Alternatively, you can import thecontents of a file, by choosing Import SQL Query.

Instructor NotePoint out that Query Builder prefixes the schema name to the tables. If you developa report under a different schema name from the user that runs the report, you mustdelete the schema name in the query statement, or ensure that users have selectaccess to the schema, otherwise the report fails at run time.

Page 134: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Instructor NoteRemind students that Query Builder is available as a separate executable withinDeveloper/2000. You can use it to build queries that you save in a file or in thedatabase.

Direct them to the Help system for detailed usage of Query Builder.

Query Builder can buildalmost any query, but perhaps not more complex structures,such as tree walks or set operations.

1 Column sequence 4 Logical operators forconditions

2 Define column 5 Conditions box for Where andHaving clauses

3 Sort 6 Object type (T: Table, V:View, S: Synonym, A: Alias)

4-7 Copyright Oracle Corporation, 1998. All rights reserved.

Query Builder Functions

• Query Builder functionality embedded inReport Builder

• Easy User Interface: alternative towriting SQL syntax

2 3

5 6

41

Page 135: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-11......................................................................................................................................................

......................................................................................................................................................Creating a Tabular Report Using the Wizard

Query Builder FunctionsThis course does not teach the detailed functionality of Query Builder. You can findcomprehensive help in the Report Builder online Help system: Help—>Contents—>Building and Running a Report—>Defining a Query—>Using QueryBuilder.

You can use Query Builder to build almost any query that you can write as a SQLselect statement.

You can select from a table, view, or synonym. The letter T, V, or S appears in theobject title bar to indicate which it is. If you define the same table more than once,Query Builder creates an alias (A).

Below is a brief description of some Query Builder toolbar buttons and functions.

Function Description

Column Sequence Defines the sequence of column names in the select clause

Define Column Defines a new, derived or calculated column to be included in theselect clause; use this definition to calculate and retrieve derivedvalues from the server

Sort Defines the Order By clause; select the columns that you want to besorted, and choose Ascending or Descending sorting order

Where and Havingclauses

Place the cursor in the Conditions box on the left side of the QueryBuilder window. Type a condition. Use the AND, OR, and NOTbuttons to create compound conditions.

Page 136: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

4-8 Copyright Oracle Corporation, 1998. All rights reserved.

Choosing Displayed Fields

Page 137: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-13......................................................................................................................................................

......................................................................................................................................................Creating a Tabular Report Using the Wizard

Choosing Displayed FieldsIn the Field page, select each field from the list of Available Fields and choose >.The selected fields move to the Displayed Fields list.

To display all fields, choose >>.

Sequencing Displayed FieldsYou can alter the sequence of displayed fields by dragging one field above, or below,another in the list. The sequence of fields in this list determines how the fieldsappear in the report output. In a tabular report, the fields appear in sequence fromleft to right across the report.

Referencing Nondisplayed FieldsFields that remain in the Available Fields list are available for you to reference inyour report definition as hidden fields or in PL/SQL trigger code.

In the report output, the user sees only those fields that you transfer to the DisplayedFields list.

Page 138: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

4-9 Copyright Oracle Corporation, 1998. All rights reserved.

Summaries and Labels

Page 139: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-15......................................................................................................................................................

......................................................................................................................................................Creating a Tabular Report Using the Wizard

Summaries and LabelsThe next two pages of the Report wizard allow you to create summaries based onany of the displayed fields and to modify the labels and width of the displayedfields.

SummariesIf you choose a summary, the wizard creates the summary at each level of thereport; that is, at report level and also at each break level, if your report containsbreak groups.

You can deselect some of these summaries later (by reentering the wizard) if, forexample, you want a report-level summary only.

LabelsThe field label displays on one or more lines in the report output. In a tabular report,the labels appear above the field values.

• If the initial label is wider than the field, Report Builder allows enough space forthe label, or displays it on multiple lines.

• If you increase the number of characters in the label text within the reentrantwizard, the label may appear truncated in the report output.

Page 140: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

4-10 Copyright Oracle Corporation, 1998. All rights reserved.

Choosing a Report Template• Enforce corporate standards.

• Create professional looking reportseasily.

Page 141: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-17......................................................................................................................................................

......................................................................................................................................................Creating a Tabular Report Using the Wizard

Choosing a Report TemplateChoose a template from the list of predefined template names.

In a template, fonts, styles, and colors are already selected for designated objects.

A variety of templates are available with the standard Reports installation.

Steps to Select a Predefined Template1 Select the Predefined Template option button, if not already selected.

2 Select a template in the Template list.

3 Choose Finish.

Note: We describe how to modify and use your own user-defined templates later inthe course.

Page 142: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

1 Zoom buttons

2 Magnify tool

3 Page buttons

4-11 Copyright Oracle Corporation, 1998. All rights reserved.

Viewing the Report Output1

2

3

Page 143: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-19......................................................................................................................................................

......................................................................................................................................................Creating a Tabular Report Using the Wizard

Viewing the Report OutputWhen you finish creating your report in the Report wizard, the output appears in theLive Previewer.

Magnifying the OutputLike the runtime previewer, the Live Previewer toolbar contains Zoom In and ZoomOut buttons to allow you to magnify or reduce the size of the output.

The Live Previewer also provides a Magnify tool in the vertical toolbar. Thisprovides a view of the area of layout you wish to see.

• To increase the view size, select the Magnify tool and click in the layout area.

• To reduce the view size, select the Magnify tool, hold down the shift key, andclick in the layout area.

Viewing Different PagesLike the runtime previewer, the Live Previewer toolbar contains four buttons, andthe specific page option, to allow you to scroll through the pages of your report.

We discuss other functions of the Live Previewer in the next lesson.

Page 144: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

4-12 Copyright Oracle Corporation, 1998. All rights reserved.

Saving the Report Definition

Save changes frequently!

File—>Save

xxx.rdf

File—>Save As...

yyy.rdf

Page 145: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-21......................................................................................................................................................

......................................................................................................................................................Creating a Tabular Report Using the Wizard

Saving the Report DefinitionRemember to save the report frequently by choosing Save in the toolbar, or theFile—>Save menu option.

The file is saved with a.rdf extension. We discuss storage methods in detail in a laterlesson.

Copying the Report DefinitionIf you want to make a copy of the report definition in a different filename, use themenu option File—>Save as.

There is no toolbar button for the Save as option.

Page 146: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Instructor NoteDemonstration:

Choose the Report wizard button (show the menu option also).

On the Style Tab, choose Form-like.

Choose Finish, and explain the output that you see in the Live Previewer: labels toleft; each record on a new page.

In the Live Previewer, also show the page buttons are now available for the multiplepage report. You might also want to demonstrate opening a New Previewer windowand displaying different pages in each.

WARNING: When you demonstrate the Form-like report, you must create a newreport before demonstrating the other styles later, because Reports retains the pagebreak for each record and you should avoid confusing students with property sheetsat this stage.

The bulleted points opposite might provide useful review questions later in thecourse.

4-13 Copyright Oracle Corporation, 1998. All rights reserved.

Reentering the Wizard• Choose Tools—>Report Wizard.

• Tabs are different for each report style.

• Wizard preserves all previous settings.

Page 147: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-23......................................................................................................................................................

......................................................................................................................................................Creating Other Report Styles

Creating Other Report Styles

IntroductionIn this section you discover the other report styles available in the wizard and thepages that the wizard displays. There are two methods of creating additional reportdefinitions with the Report wizard:

• Modifying an existing report definition, by reentering the wizard

• Creating a new report definition, by restarting the step-by-step wizard

Modifying a Report by Reentering the WizardThe reentrant Report wizard preserves your current settings and query. You canmake changes to these or other settings, and choose Finish when you are ready toreapply all the wizard settings to your report.

To reenter the wizard in an existing report definition:

• Choose Report Wizard from the horizontal toolbar of the Report editor.

• Choose Tools—>Report Wizard from the menu.

• In the Object Navigator, choose Report Wizard from theright-mouse-button menu.

Tabbed PagesWhen you reenter the wizard, you see a tab for each page. You can navigate directlyto the page you want to modify, instead of choosing Next to step through each pagein turn.

Choose Finish at any time to apply the changes.

Creating a Form-Like ReportThere are three significant features in the Form-like style that differ from theTabular style.

• Labels appear to the left of each field.

• Each field appears to the left of the previous field, across the page.

• Each record appears on a new page.

Page 148: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Instructor NoteDemonstration—Create a new report and show the group styles:Select the Report node; choose Create in the vertical toolbar.Select Group Left style.In Query Builder, include S_DEPT and S_EMP. Select columns:S_DEPT: NAMES_EMP: LAST_NAME, TITLE, SALARY

In the Groups page, choose NAME.In the Fields page, re-order TITLE above SALARY.Include a summary of SALARY. Complete the wizard pages.Reenter the wizard and change style to Group Above.Choose the Groups Tab. Choose TITLE, to create a Level 2 group.Choose the Fields Tab, and show how summary fields have been automaticallycreated for subtotals as well as report total.

Choose Finish. Point out the differences in the output: position of groups and labels.

1 Report node

2 Create object button

4-14 Copyright Oracle Corporation, 1998. All rights reserved.

Creating a New Report

1

2

Page 149: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-25......................................................................................................................................................

......................................................................................................................................................Creating Other Report Styles

Creating a New ReportTo create a new report with the wizard when you are already in the Report Builder:

1 Select the Report node in the Object Navigator.

2 Choose Create, the green plus sign in the vertical toolbar.

3 Choose Use the Report Wizard.

Page 150: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-26 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

4-15 Copyright Oracle Corporation, 1998. All rights reserved.

Creating Break Reports

• Break report styles:

– Group Left, Group Above

• Additionalwizard page:

– Groups

4-16 Copyright Oracle Corporation, 1998. All rights reserved.

Break Report Labels

Region Department Last Name Title

xxxxx xxxxxx xxxxxx xxxxx

xxxxxxx xxx

Group Above

Group Left

Region xxxxxxxx

Department xxxxxLast Name Titlexxxx xxxxxxxxxxxxxxxx xxxx

Page 151: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-27......................................................................................................................................................

......................................................................................................................................................Creating Other Report Styles

Creating Break ReportsWhen you select one of the report break (or master-detail) styles—Group Left orGroup Above—the wizard displays an extra page, the groups page, in which youchoose the columns that should be in each break group of the report. You canchoose multiple levels of breaks.

Group LeftThe output displays as columns across the page, with each group next to each other.

All labels appear above the fields.

Group AboveThe output displays with each group below each other.

The labels for all master groups appear to the side of the fields.

Labels for the bottom-most detail groups appear above the fields, as in a tabularreport.

Page 152: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-28 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Instructor NoteDemonstration:

Reenter wizard. Change style to Mailing Label.

Modify the query, add an order by clause: ORDER BY S_EMP.LAST_NAME. Thisallows you to show the print direction of the records (across, then down). Do not tryto change the direction here, we will discuss this later when modifying layoutobjects.

In the Text tab, choose LAST_NAME, NAME and SALARY.Do not choose TITLE. This shows you do not have to display all columns in yourmailing label text. Also, if you choose TITLE, you might find the label does notallow enough room for the TITLE width, and it is better to avoid discussing changesin the Live Previewer at this stage.

Finish and Run. Reenter wizard and change style to Form Letter.

Modify the Text to include constant text, for example:

The employee &<LAST_NAME> works for &<NAME> and earns a salary of&<SALARY> dollars.

Choose Finish and show the output: one record per page.

WARNING: Demonstrate Mailing Labels before Form Letter, otherwise eachmailing label displays on a separate page!

4-17 Copyright Oracle Corporation, 1998. All rights reserved.

Creating Mailing Labels andLetters

Wizard pages

• Style

• Data

• Text

• Template

Page 153: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-29......................................................................................................................................................

......................................................................................................................................................Creating Other Report Styles

Creating Mailing Labels and LettersWhen you choose the Mailing Label or Form Letter report styles, the wizarddisplays only four tab pages: Style, Data, and Template pages as before, and theText page.

Steps to Create Text1 Select a field in the Available Field list.

2 Choose > to display in the Text area.

3 Type new lines, and punctuation as required, or use the punctuation buttonssupplied: New Line, Space, Dash, Comma, Period.

4 Select additional fields from the Available Field list.

What Appears in the Text Area?The selected field name appears in the text area, enclosed in optional angledbrackets (<>) and prefixed by an ampersand (&). This indicates that the field nameis a variable. Each variable is replaced by a specific value at run time.

You can type directly into the text area, instead of selecting from the AvailableFields list. However, remember to prefix each field name (variable) with anampersand.

Any word that you type without an ampersand appears as a text string in yourmailing label output. For example:

The optional angled brackets allow you to display 2 variables side-by-side with noseparating space.

What Is the Difference Between Mailing Labels and Form Letters?

Text Area Output

LAST_NAME&<LAST_NAME>

LAST_NAMEVelasquez

LAST_NAMENgao

Mailing Label Form Letter

Multiple records on one page One record on each page

Page 154: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-30 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Instructor NoteDemonstration:

Create a new report, using the wizard. Choose Matrix style.Query: In Query Builder, choose Import SQL Query. SelectLES04.SQL.Rows: REG_NAME. Columns: TITLE. Cell: SALARY - choose Sum >.

Totals: SUMSALARY - choose Sum >. (Warning: select SUMSALARY).Template: Choose Corporate 1 Landscape.Choose Finish and show output. Note there are two physical page widths.

Reenter wizard. Choose Rows tab. Add DEPT_NAME as Level 2. Choose Finishand show output. Note that all four departments display for every region even ifthere is no applicable value. This is a nested matrix.

Reenter wizard. Change report style to Matrix with Group.Choose Rows. Select REG_NAME, and return it to Available Fields list.Choose Groups. Move REG_NAME to Matrix Group Fields.

Choose Finish and show difference in output. Note that only the relevantdepartments and titles display for each region, for example: Administration withinAfrica/Middle East.

Plans for Release 2.1: A nested matrix will create anon-sparse matrix by default:blank rows will be suppressed.

4-18 Copyright Oracle Corporation, 1998. All rights reserved.

Creating a Matrix Report

Three additional Wizard pages

• Matrix rows

• Matrix columns

• Matrix cells

Page 155: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-31......................................................................................................................................................

......................................................................................................................................................Creating Other Report Styles

Creating Matrix ReportsWhen you choose the Matrix report style, the wizard displays three new tab pages.

Creating Matrix SummariesWhen you choose a summary in the Summary page, the wizard creates threesummaries in the matrix.

Creating a Matrix for Each Group RecordChoose the Matrix with Group report style. This provides a similar group structureto the Group Above report.

In our Regional report, we can select REG_NAME in the Group page, so that thewizard structures the Department/Title matrix for each record.

The differences from a nested matrix are:

• Only the relevant Departments and Titles display for each region.

• If you create summaries for a Matrix with Group style, the wizard calculates anddisplays summaries for each group as well as the report total. The report totaldisplays at the end of the report, in the bottomleft-hand corner.

Tab Page Description

Rows The field to display vertically down the left side of the matrix: you canchoose multiple levels of rows to create a vertically nested matrix

Columns The field values to display horizontally across the top of the matrix: youcan choose multiple levels of columns to create a horizontally nestedmatrix

Cell The field value that becomes the cell, or cross-product, of the matrix

Summary Description Position in Output

Row One value for each row Right-hand side of matrix, at end of row

Column One value for each column Bottom of matrix, below column

Report One value for the report Right-hand, bottom corner of matrix

Page 156: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-32 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

4-19 Copyright Oracle Corporation, 1998. All rights reserved.

Summary

• Rapidly create reports with the ReportWizard.

• Build queries using the Query Builder.

• Apply templates to reports.

• Modify reports by reentering the wizard.

• Create new reports of different styles.

Page 157: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-33......................................................................................................................................................

......................................................................................................................................................Summary

Summary

Report StylesThere are eight common styles of report that you can create by using the Reportwizard. The wizard steps you through a variety of pages, depending on your chosenreport style.

Query BuilderThe built-in Query Builder provides a user-friendly graphical interface for you tobuild the SQL queries to retrieve your report data. Alternatively, you can write theSQL statement yourself, or import the contents of a file.

Predefined TemplatesPredefined templates offer standard fonts, colors, formats, and images that enableyou to create many reports with a professional appearance and a standard look andfeel very quickly and easily.

Reentrant WizardThe wizard is reentrant; it retains all your previous setting, and allows you tomodify any settings by selecting the relevant tabbed page.

Page 158: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-34 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

4-20 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 4 Overview

• Creating a Tabular report

• Modifying the report, to create a GroupAbove break report

• Creating a Form Letter

• Creating a Matrix report

• Creating a Matrix with Group report

Page 159: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-35......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 4

Practice Session Overview: Lesson 4This practice session contains:

• Creating and saving a Tabular report

• Modifying the report, to create and save a Group Above break report

• Creating and saving a Form Letter

• Creating and saving a Matrix report

• Creating and saving a Matrix with Group report

IntroductionThe questions in the practice session are intended to ensure that you have a goodunderstanding of how to create various styles of report using the Report wizard.

Note: When you are completing the practice sessions, please keep to file namingconventions 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 needto change these to achieve the desired result.

Many of the practice sessions ask you to rename files beforehand, please ensure youuse Save As, not Save, so that you do not overwrite the existing file name.

Page 160: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-36 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Practice Session: Lesson 4

Invoking Report Builder and the WizardIf Report Builder is not open, launch it from Project Builder and create a new reportusing the Report wizard.

If Report Builder is open after the previous practice session:

• Close any reports currently in the Object Navigator.

• Create a new report by selecting the Report node and choosing Create Object.

Note: there is an alternative method, if no reports are open in the Object Navigator,you can double-click the Report node.

1 Create a tabular report containing the following data. Use Query Builder to buildthe query.

Display all fields. Do not make any changes to the other wizard pages.

2 Using the reentrant Report wizard, make the following modifications:(Test your report frequently.)

Modify the query to sort the data in descending order of salary.

Add a summary to show the total salary value.

Reduce the width of SALARY and TOTAL to 6.

Change the COMMISSION_PCT label to Comm and reduce the width to 4.

Save the report to a file namedp4q2.rdf.

3 Using the reentrant wizard, modify the report to create a break report.

Choose report style Group Above.

Group the report by the department name.

Choose the template called Bright 1.

Save the report asp4q3.rdf.

S_DEPT: NAME

S_EMP: FIRST_NAME, LAST_NAME, TITLE, SALARY, COMMISSION_PCT

Page 161: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 4-37......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 4

4 Create a new report containing the following data.Choose Mailing Labels style.Use Query Builder to build the query.

In the text area, include all four customer fields, with each field on a new line.Select the template Draft.Save the report to a file namedp4q4.rdf.

5 Using the reentrant wizard, modify the report to create a Form Letter style.

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.

Save the report asp4q5.rdf.

6 Create a new report.Choose the matrix report style.For the query, import the contents ofp4q6.sql.Display customer names down the left side of the page.Display product numbers across the top of the page.Display the sum of total value in the cells.Create a summary to give the total of the sum(salary) values.Reduce the widths of PRODUCT_ID and all four summaries to 5.Change the PRODUCT_ID label to Product.Choose a template that gives Landscape output.Save the report to a file namedp4q6.rdf.

If You Have Time7 Modify the matrix report, to create a Matrix with Group.

Choose Month as the group and check that all totals have a width of 5.

Save the report asp4q7.rdf.

Note: The query for the matrix reports above has been restricted to display onlyproducts beginning with 4, so that you can see and understand the complete matrixmore easily.

S_CUSTOMER: NAME, CITY, ADDRESS, STATE

S_ORD: ID, DATE_SHIPPED, TOTAL

Page 162: Developer 2000 - Build Reports Volume 1 Instructor Guide

4-38 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 4: Creating Reports Using the Report Wizard

Page 163: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

5

Enhancing Reports in theLive Previewer

Page 164: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

Instructor NoteTopic TimingLecture 45 minutes

Practice 30 minutes

Total 75 minutes

5-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to

• Describe the report Live Previewer.

• Modify the display of report data in theLive Previewer.

• Modify the positioning of report data.

• Add page numbering and current date.

Page 165: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionIn this lesson you learn to enhance your reports with the most commonly requiredchanges, while viewing the live runtime output in the new Live Previewer withinReport Builder.

ObjectivesAt the end of this lesson, you should be able to:

• Describe the report Live Previewer.

• Modify the display of report data in the Live Previewer.

• Modify the positioning of report data in the Live Previewer.

• Add page numbering and the current date to a report.

Page 166: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

1 Toolbar 3 Tool palette

2 Stylebar 4 Status bar

5-3 Copyright Oracle Corporation, 1998. All rights reserved.

What Is the Live Previewer?

A view of report output that allows liveediting of text and layout attributes

• True WYSIWYG report editing

• Easy editing: See it! Click it! Change it!

• Cached report data

5-4 Copyright Oracle Corporation, 1998. All rights reserved.

The Live Previewer Window

1

2

3

4

Save report with open Live Previewer:report runs automatically next time.

Page 167: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-5......................................................................................................................................................

......................................................................................................................................................What Is the Live Previewer?

What Is the Live Previewer?

IntroductionThe report Live Previewer is a WYSIWYG editor. All edits that you perform in theLive Previewer are on live data.

Cached Report DataDeveloper/2000 caches the data the first time that you run the report, then reuses thecached data each time you run the report during the session, unless you modify thereport in any way that requires refreshed data.

The Live Previewer WindowThe Live Previewer has a horizontal toolbar and stylebar that contain commonfunctions, also available from the pull-down menu.

The vertical tool palette provides tools that allow you to create simple boilerplateobjects and text to enhance your report, as well as color palettes to modify the colorfill and borders of objects.

You can suppress the tool palette and status bar from the pull-down menu.

Saving ReportsSave your report definition often, using the Save icon in the toolbar or the Save orSave As options in the File menu, to preserve the changes that you make in the LivePreviewer.

When you open an existing report, it retains its last saved state. If you save a reportwhile the Live Previewer is active, it automatically runs and displays the currentdata when you next open the report.

If you do not wish the report to run at the time you open it, close the Report editor,or change the view to Data Model or Layout Model before saving the reportdefinition.

Page 168: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

5-5 Copyright Oracle Corporation, 1998. All rights reserved.

Modifying a Report

Common modifications

• Align columns

• Set format masks

• Manipulate objects

• Edit text

• Modify visual attributes

• Insert page numbers and current date

Page 169: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-7......................................................................................................................................................

......................................................................................................................................................Modifying a Report in the Live Previewer

Modifying a Report in the Live Previewer

IntroductionThis section discusses some of the most commonly required changes that you needto make to reports, after creating the initial definition with the wizard:

• Aligning columns

• Setting format masks

• Manipulating objects

• Editing text

• Modifying visual attributes

• Inserting page numbering

• Inserting current date and time

Page 170: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

Instructor NoteDemonstration:

Use an existing report from a previous demonstration. A tabular report that includesseveral columns and includes a numeric value is suitable, such asL4TAB.RDF.

If you do not have a suitable report, create a tabular report:Use the S_EMP table. Choose columns LAST_NAME, TITLE, and SALARY.Include TITLE so that you have an extra column to clear (delete) later.

5-6 Copyright Oracle Corporation, 1998. All rights reserved.

Aligning Columns

Point and select

Choose “ end justify ”

Page 171: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-9......................................................................................................................................................

......................................................................................................................................................Modifying a Report in the Live Previewer

Aligning ColumnsIn the sample report output, in the left-hand panel, the salary values are aligned tothe left. You often need to align numbers to the right.

1 Select the column that you want to align.

2 Choose the “end justify” icon in the stylebar.

Aligning Multiple ObjectsYou can align each object separately, so that you can center the labels if you want.However, if you want to align the values and the labels to the right, use shift-click toselect more than one object at one time.

Page 172: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

Instructor NoteDemonstration:

Continue with the report used previously. Add currency sign, thousand separator,and two decimal places to the salary column.

If students know about number format masks and ask for specific information, thentell them: Report Builder formats the number using the L, G, and D local currencyelements in the format mask. You can discuss this in more detail in a later lessonwhen you demonstrate modifying properties in the property palette.

1 Currency symbol 4 Add decimal places

2 Percentage symbol 5 Remove decimal places

3 Thousand separator

5-7 Copyright Oracle Corporation, 1998. All rights reserved.

Setting a Format Mask

Change format masks from the stylebar

1 2 3 4 5

Page 173: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-11......................................................................................................................................................

......................................................................................................................................................Modifying a Report in the Live Previewer

Setting a Format MaskThe most commonly used numeric format symbols are available on the stylebar.

• Currency

• Percentage

• Thousand separator

• Decimal places—add and remove

Steps to Alter a Numeric Format1 Select the numeric field to which you want to apply a format mask.

2 Choose the corresponding format mask button on the stylebar.

The format mask is applied.

Note: Developer/2000 applies the format mask only to fields whose datatype isNUMBER.

NLS Support for Format MasksThe stylebar always shows “$” for the currency button, “,0” for thousands and “.0”for decimal places, but the output currency symbols are language-specific, and candiffer at runtime.

If you use National Language Support, the symbols that appear in the report outputdepend on the setting of the NLS_LANG parameter.

Page 174: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

Instructor NoteDemonstration:

Continue with the same report.

Resize, move, and clear one of the columns displayed.

Show the Flex Mode tool. With flex mode enabled, try to move a column. Disableflex mode and now try to move a column.

5-8 Copyright Oracle Corporation, 1998. All rights reserved.

Manipulating Objects

• Clear fields.

• Move fields.

• Resize fields.

• Flex mode adjusts layout duringchanges.

Page 175: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-13......................................................................................................................................................

......................................................................................................................................................Modifying a Report in the Live Previewer

Manipulating ObjectsYou can alter the position of objects, such as fields and labels, by selecting theobject you want to move and dragging it to a new position.

Alter the size of an object by selecting one of the square handles and dragging to therequired size, either smaller or larger.

Flex ModeWhen you move or resize an object, the rest of the report adjusts as necessary. Thisis controlled by the flex mode option, which is a button in the stylebar. The default isthat flex mode is enabled, so that all report objectsflex, or adjust, to make room foryour modifications.

Page 176: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

Instructor NoteDemonstration: Continue with the same report.

Change the font of one field.

Change the text of a label: for example, change Last Name to Name.

Show how you use the icons to set fill, patterns, and colors. Add a fill, pattern, andcolor to the label area, showing how to use the Parent Frame tool.

5-9 Copyright Oracle Corporation, 1998. All rights reserved.

Modifying Visual Attributes

• Modify text colors and fonts.• Edit text.• Set fill, patterns, and colors.• Use the Parent Frame tool

to select an enclosing object.

-Sales Report -

Year Region Sales1993 Americas 2001993 Europe 4001993 Asia Pacific 770

Year Region Sales1994 Americas 2101994 Europe 390

Sales Report by Area

Year Region Sales1993 Americas 2001993 Europe 4001993 Asia Pacific 770

Year Region Sales1994 Americas 2101994 Europe 390

Sales Report by Area

1993 Americas 2001993 Europe 4001993 Asia Pacific 770

1994 Americas 2101994 Europe 390

Year Region Sales

Year Region Sales

Page 177: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-15......................................................................................................................................................

......................................................................................................................................................Modifying a Report in the Live Previewer

Changing Field and Boilerplate Font1 Select one or more objects.

2 Use the font pop-up lists in the stylebar to change font face and size.

Editing Boilerplate Text1 Select the text you want to edit

The text object is highlighted.

2 Click in the text to position the cursor in the text editor.

3 Edit the text as required.

4 Select any area outside the text object to accept the change.

Modifying Color Fills and Lines1 Select the object that you want to modify.

2 Use the color palettes in the toolbar to change the fill, line, or text colors.

The stylebar includes a Parent Frame tool, that allows you to select the outer objectsurrounding the currently selected object.

To color the area surrounding all the labels, select one label, click Parent Frame,then select the color and pattern you require from the first color palette.

Page 178: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

Instructor NoteUsing the same report, add page numbers and the date. Point out that many of thepredefined templates already add these features to your reports.

Mention that you can add extra date format masks to your preferences.

Show how to customize date extensions to include the time. However, it is mucheasier to use the list of examples that shows the current date. The defaultpreferences file (cagprefs.ora) provides a large list.

We avoid using the property palette in this lesson, as there is so much basicfunctionality to discuss in the Live Previewer, but if students ask, you can modifythe date after you create it. Double-click on the date object to open the propertypalette. The format mask property is in the Field section.

5-10 Copyright Oracle Corporation, 1998. All rights reserved.

Inserting Page Numbers, Dates,and Times

• Inserted easily

• Customizable extensions

Before After

Page 179: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-17......................................................................................................................................................

......................................................................................................................................................Modifying a Report in the Live Previewer

Inserting Page Numbers, Current Date, and Time

Date and Time Format MasksThe Insert Date and Time dialog box displays the current date in many differentformats. You simply choose the style that you want. The underlying format mask iscomposed of tokens representing each element.

The list of formats depends on the entries in your preferences file. To modify thepreferences list, choose Tools—>Preferences—>Edit Masks.

Customizing the Date and Time FormatIf the mask that you want does not exist, and you do not want to add it to yourpreferences, choose Custom. This dialog box provides a read-only list of tokensavailable for you to build your own style, if you understand the Oracle formattokens.

Note: The Help system fully describes the format mask syntax: choose Help—>Find—>Date Syntax, and choose Date Format Mask Syntax from the list of topics.

PreviewerButton Description

Insert PageNumber

Use this button to add a page number to the margin of a report.

Insert Date/Time

Use this button to add the current date and time to the margin of a report.You can define your own date and time format masks.

Page 180: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

5-11 Copyright Oracle Corporation, 1998. All rights reserved.

Summary

• Enhance report output using live data.

– Move, resize, delete objects.

– Edit text.

– Alter fonts, colors, and patterns.

– Apply format masks, easily andquickly.

– Add page numbering and current date

• Save report to preserve changes.

Page 181: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-19......................................................................................................................................................

......................................................................................................................................................Summary

Summary

Features of the Live PreviewerThe Live Previewer is a WYSIWYG editor that allows you to enhance your reportoutput using the live data.

You can manipulate objects and edit text content. You can also alter the font, colors,and patterns of individual objects.

The format mask buttons provide quick and easy currency formatting.

Page and date buttons allow you to add page numbering and the current date,selecting predefined formats, or customizing your own.

Saving ChangesRemember to save your report definition often during editing, in order to preservethe changes you make in the Live Previewer.

When you save the report, all changes become part of your report definition andalways appear at run time in the future.

Page 182: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

5-12 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 5 Overview

• Modifying reports by applying changesin the Live Previewer

Page 183: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-21......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 5

Practice Session Overview: Lesson 5This practice session contains:

• Modifying reports by applying changes in the Live Previewer

IntroductionIn this practice session you will reuse some of the reports that you created in the lastsession.

Page 184: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

Practice Session: Lesson 51 Open reportp4q2.rdf. Make the following changes in the Live Previewer:

a Make the columns SALARY and COMM right justified. Do notforget to justify the column header accordingly.

b Add commas and a currency symbol to SALARY. Add two decimalplaces.

c Add one decimal place and a percent sign to COMM.

d Edit the heading of the COMM column. Change the text to CommPct.

e Make the Total at the end of the report right justified, add commas,currency symbol and two decimal places as in the column SALARY.

f Change the label of the total to bold font.

g Make whatever other changes you like.

h Save the report to a file namedp5q1.rdf and close it.

2 Open reportp4q3.rdf. Make the following changes in the Live Previewer:

a Remove the border around the total for each department.

b Add commas and two decimal places to the SALARY field and thetotal and make them right justified

c Make the same changes to the total at the end of the report. Move thegrand total so that it aligns with the SALARY field. (You must dothis manually; use the ruler guides to help you.)

d Change the color of the heading to grey.

e Make whatever other changes you like.

f Save the report to a file namedp5q2.rdf and close it.

3 Open reportp5q3_a.rdf. Make the following changes in the Live Previewer:

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 insertingthe date.

b Make whatever other changes you like.

c Save the report to a file namedp5q3.rdf and close it.

Page 185: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 5-23......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 5

4 Open reportp4q6.rdf. Make the following changes in the Live Previewer:

a Right justify the PRODUCT ID field.

b Remove the border around the cell values and the parent frame.

c Add commas and two decimal places to the cells and summaries andmake them right justified.

d Add a gray line color to the parent frames of NAME and PRODUCTID.

e Save the report to a file namedp5q4.rdf and close it.

If You Have Time5 Make any changes you want to reportp4q7.rdf. Save it as p5q5.rdf.

Page 186: Developer 2000 - Build Reports Volume 1 Instructor Guide

5-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 5: Enhancing Reports in the Live Previewer

Page 187: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

6

Managing ReportTemplates

Page 188: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

Instructor NoteTopic TimingLecture 40 minutes

Practice 30 minutes

Total 70 minutes

6-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to

• Describe the template regions.

• Describe the difference between defaultand override template sections.

• Modify a predefined report template.

• Register a customized template in thepredefined template list.

Page 189: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionIn this lesson you learn how to open and modify predefined Developer/2000 reporttemplates, and how to register a customized template in the predefined template list.

ObjectivesAt the end of this lesson, you should be able to:

• Describe the template regions.

• Describe the difference between default and override template sections.

• Modify a predefined report template.

• Register a customized template in the predefined template list.

Page 190: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

6-3 Copyright Oracle Corporation, 1998. All rights reserved.

Using Report TemplatesThree template options:

• Predefined

• User-defined

• No template

Installation templates in<oracle_home>\report30\admin\template

Page 191: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-5......................................................................................................................................................

......................................................................................................................................................Using the Report Templates

Using the Report Templates

IntroductionThe template page of the wizard has three options for choosing a template:

Creating a User-Defined TemplateYou can create your own templates from scratch, but this is not necessary, becausemany prebuilt templates exist in the installation.

Create your own templates by modifying one or more installed templates with yourown standards, logos, and so on, as described on the following pages.

Several templates are included in the installation. They are inoracle_home\report30\admin\template. The file extension for templates is.tdf.

One template definition can contain template information for all styles of reports.

Option Description

Predefined Shows a static descriptive list of available templates

Template File A user defined template file that you specify by entering a filename orbrowsing the file system

No Template Uses the report default settings, instead of a template file

Page 192: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

Instructor NoteOpen a predefined template file from the template directory:<oracle_home>\report30\admin\template. Save it as another name in your homedirectory.

Show the nodes in the Object Navigator: Header, Trailer, Body, Margin. Show thecorresponding buttons in the template editor layout model, and change to Body.

Point out that, when modifying a template, you work in the Object Navigator andproperty palette, not in the layout model.

However, in the layout model, you can switch the style in the pop-up list, GroupLeft, Matrix, and so on, to show the different layout for different styles.

Expand the Body node to show Default and Override. (There is a demonstration ona later page).

Note: Release 2.1has an improved Template editor that allows you to modifyobjects in the layout model.

6-4 Copyright Oracle Corporation, 1998. All rights reserved.

Modifying a Template

Body Margin

Page 193: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-7......................................................................................................................................................

......................................................................................................................................................Modifying a Template

Modifying a Template

IntroductionA report template is not the same as a report definition. A template is divided intoregions which the Report wizard references while creating the report definition.

The Template RegionsThe Template editor allows you to modify existing objects in the template’s header,trailer, margin, and body regions. You can also customize or add other reportsobjects: parameters, report-level triggers, program units, and attached PL/SQLlibraries.

Making Modifications to Template ObjectsModify template objects in the Object Navigator, not in the Template editor.

Use the Template editor as a reference, to view the changes you have made to thetemplate objects.

Default and Override SectionsMake general modifications to the default section. These modifications affect allreport styles. However, you can override attributes for one or more styles, to providea flexible inheritance model.

Each report inherits attributes from the template’s default section unless there is anoverride value. The override section overrides specific attributes for each style.There is a reinherit button in the property palette, to return to the default value.

Region Description

Header A separate front page that appears at the beginning of each report

Trailer A separate back page that appears at the end of each report

Body Contains default section to apply changes to all report styles and overridesections to apply individual changes to different report styles

Margin Defines objects that appear in the margin of all pages, except the headerand trailer

Page 194: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

Instructor NoteDemonstration:

1 Make sure you are not in the Live Previewer of a report, otherwise you cannotedit the template margin region.

2 In the Template editor, change to the margin region and import an image into thetemplate margin.

3 Add a report title, or modify the existing one.

Note: If you create a report using a template, CORP1, then modify CORP1, thereport does not automatically inherit the changes, unless you reapply the templatethrough the Report wizard.

6-5 Copyright Oracle Corporation, 1998. All rights reserved.

Customizing Template Margin

Includeobjectssuch as:

• Images

• Text

• PageNumbers

• Date

Page 195: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-9......................................................................................................................................................

......................................................................................................................................................Modifying a Template

Customizing Template MarginYou can copy, create, or import various objects into the margin of the template.

• Images: File—>Import—>Image

• Text: Text tool in vertical toolbar

• Page Numbers: Toolbar button

• Date: Toolbar button

Page 196: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

Instructor NoteDemonstration:

Using the same template:

1 In the Default Section, change the solid color fill on the labels on the template.

2 For Group Left only, change the font style to italic in the repeating frame.

3 Save the template.

4 In the Report wizard create a simple report that provides a break:SELECT TITLE, LAST_NAME, SALARY FROM S_EMP.

5 Choose Group Above, group by TITLE, and apply your new template. Showhow to browse the directory for the template file.

6 Reenter the wizard and change the style to Group Left. Show the different colorlabels.

7 If you have time, apply this new template to an existing report. Only somechanges occur.

6-6 Copyright Oracle Corporation, 1998. All rights reserved.

Customizing Template Body

Page 197: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-11......................................................................................................................................................

......................................................................................................................................................Modifying a Template

Customizing Template BodyIn the template body you can modify fonts, colors, and fills of the field and frameobjects. You make changes by using the property palette and pop-up listscorresponding to the object selected.

Reapplying a TemplateIf you reenter the Report wizard and reapply the template in the Template tab,Report Builder reapplies the template background and margin objects to yourreport.

The report retains any live changes you made to the body, such as modifying thefont or color of text or fields.

Page 198: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

Instructor NoteDemonstration:

Open thecauprefs.ora file and show the entries that define different template filesand the descriptions that appear in the predefined list.

Modify one or more entries to include your modified template file.

If your setup allows you to modify the installation directories, copy your template tothe template directory.

6-7 Copyright Oracle Corporation, 1998. All rights reserved.

Predefining Your Own Templates

• Modify and save template file ( mytemp.tdf ).

• Move file to template directory:<oracle_home>\report30\admin\template .

• Register name, description in cauprefs.ora .Reports.Tabular_Template_File =

(corp1,

corp10,

mytemp,

brit1,

draft,

char1)

Reports.Tabular_Template_Desc =

("Corporate 1",

"Corporate 1 Landscape",

"My Template Description",

"Bright 1",

Draft,

"Character Mode")

Page 199: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-13......................................................................................................................................................

......................................................................................................................................................Predefining Your Own Templates

Predefining Your Own Templates

IntroductionWhen you create your own templates, you might want to include some in thepredefined template list that appears when creating a report using the wizard.

You can then select the template from the descriptive list for all similar reports thatyou create, instead of searching through your file system to find the template filethat you want.

This section describes how to register the template file as a predefined template, byinserting an entry in the preferences file and storing the template and (optional)image in the correct template directory.

Editing the Preferences FileThe Report Builder builds the list of predefined templates, and their images, byreading template names from the Developer/2000 preferences file and mapping tosimilar named.bmp files (with a one-letter suffix to identify each report style).

Steps to Register a Customized Template in the Wizard’s Predefined List1 Open an existing template, modify the template objects as required, and save the

template as a .tdf file.

2 Move the template and the image files to the template directory:<oracle_home>\report30\admin\template.

3 Add the template file name (excluding the suffix) to the entries in the Developer/2000 preferences file,cauprefs.ora. Add the file name to each style of report forwhich your template is applicable, for example:Reports.Tabular_Template_File,Reports.Matrix_Template_File.

4 Add a short template description to the relevantReports.xxx_Template_Desc entry in cauprefs.ora, making sure thatthe description is listed in the same position as the relevant file. These are thedescriptions that you see in the predefined list when you apply a template in theReport wizard.

Page 200: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

Instructor NoteDemonstration:

Show the .bmp files in the template directory and point out the different characterextensions for each report style within a template.

The.bmp files in the installed templates show data from the simple Oracledemonstration tables EMP and DEPT, in the SCOTT/TIGER schema.

6-8 Copyright Oracle Corporation, 1998. All rights reserved.

Adding a Template Image

• Image area is 200 x 150 pixels.

• Move .bmp files to template directory.

• Image file names = template name + oneletter.

• Example: template = corp1

– tabular image = corp1t.bmp– matrix image = corp1x.bmp

Page 201: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-15......................................................................................................................................................

......................................................................................................................................................Predefining Your Own Templates

Adding a Template ImageEach predefined template has a small image associated with it that displays on theleft side of the template page of the wizard. The image is optional but is a usefulgraphical example of how the report looks if you apply that template.

To display your own image, use the template to create a simple report and create animage of the report output.

Steps to Create a Template Image1 Create a simple report using your new template. For example, use the tables

EMP and DEPT.

2 Create a bitmap image (screenshot) of the top left corner, including enough datato make the style clear to the user.

Note: The bitmaps supplied are 200 x 150 pixels.

3 Name the file*.bmp and store in the same directory as the template:<oracle_home>\report30\admin\template.

Template Image Naming ConventionYour image file names must have the correct name for each style that you create.The image file name is the same as your template file plus one letter depending onthe report style.

Template Name Image Name Report Style

corp1 corp1a.bmp Group Above

corp1f.bmp Form

corp1g.bmp Matrix with Group

corp1l.bmp Group Left

corp1m.bmp Mailing Label

corp1r.bmp Form Letter

corp1t.bmp Tabular

corp1x.bmp Matrix

Page 202: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

6-9 Copyright Oracle Corporation, 1998. All rights reserved.

Summary

• Modify existing templates to create yourown user-defined template.

• Modify the Default section for all stylesor Override for individual style changes.

• Add your templates to the predefinedlist.

• Display an image for each predefinedtemplate.

Page 203: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-17......................................................................................................................................................

......................................................................................................................................................Summary

Summary

Modifying a TemplateIn this lesson you learned to open an existing template definition in the Templateeditor, and make modifications to create your own customized templates.

You can use any customized template when creating a report in the Report wizard.

The template contains default and override sections.

• Default section: modify objects to affect all styles of report created with thistemplate.

• Override sections: modify objects to make individual changes to one or morestyles, Tabular, Group Above, and so on.

Registering a TemplateYou learned how to register your templates so that they appear in the predefined listin the Report wizard. Optionally, you can include a small bitmap image for eachstyle of report, which displays when you select a predefined template.

Page 204: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

6-10 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 6 Overview

• Customizing an existing template

• Applying the modified template to anexisting report

Page 205: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-19......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 6

Practice Session Overview: Lesson 6This practice session contains:

• Customizing an existing template

• Applying the modified template to an existing report

IntroductionIn this practice session, you open an existing template, which is one of the standardtemplates shipped with the Developer/2000 Release 2 installation.

You modify objects in the margin and body regions and save the template to a newfilename. Then you apply the modified template to an existing report and note thedifferences.

Instructor NoteThe practice does not include modifying the preferences file to register a predefinedtemplates. You can suggest they do so, if you have time and if your class setupallows students to modify the preference file and to write to the<ORACLE_HOME>\REPORTS30\ADMIN\TEMPLATE directory.

Page 206: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

Practice Session: Lesson 61 Customize an existing template, adding a company logo and report title to the

report margin, and modify the report body.

a Opencorp1.tdf.This file should exist in your home directory; it is acopy of the Corporate 1 predefined template.

b Display the margin region. (This usually appears by default whenyou open a template.)

c Delete the Oracle buildings logo. Importsummitlo.tif and place inthe top left corner of the margin; this file should exist in your homedirectory.

d Modify the report title line: change 21st Century Products to SummitReport.

e Display the body region to view the changes you make in thispractice. Make the changes general, not specific to a particularlayout.

f Change the foreground color of the body to white.

g Change the justification of number fields to Right. Do not forget tochange the justification of labels for number fields to Right.

h Change the justification of number summary fields to Right.

i Save the template assummit.tdf.

2 Apply the modified template to an existing report.

Hint: You must search for the template file, it does not appear in the list ofpredefined templates.

a Openp4q3.rdf.

b Apply summit.tdf to the report.

c The report shows some changes but not all. Which template changeshave been applied, and which have not?

d To apply all changes to your report you will have to create the layoutagain. From the menu choose Edit—>Select all to select all layoutobjects. Now delete them. Invoke the Report wizard and reapplyyour template.

e Save the report as p6q2.rdf.

Page 207: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 6-21......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 6

3 Continue to modify the template and test it using a new report.

a Change the text color of the master group fields to red for the GroupLeft style only.

Hint: In the Template editor, use the Report Style list to switch to a Group Leftstyle. This way you can select the correct group in the Object Navigator. Youmay also want to use the Zoom Out tool, so that you can see the entire templatelayout structure, and recognize the difference between the master group fieldsand the detail group fields.

b Save your template assummit2.tdfand close it.

c Create a new report, using the Report wizard.Use the layout style Group Left.Import the queryp6q3.sql from your working directory.Make NAME the group field.Display all other columns.Do not create summaries.Change the width of SALARY to 6 and COMM to 4.Apply the Template filesummit2.tdf.Save the report asp6q3.rdfand close it.

Page 208: Developer 2000 - Build Reports Volume 1 Instructor Guide

6-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 6: Managing Report Templates

Page 209: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

7

Report Storage Methods

Page 210: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

Instructor NoteTopic TimingLecture 30 minutes

Practice 10 minutes

Total 40 minutes

7-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to

• Distinguish between different storagemethods of report definitions.

• Compare report file types and theirportability.

• Convert reports to different storagetypes.

• Upgrade report and printer definitionfiles from Developer/2000 Release 1.

Page 211: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionWhen you save a report definition, you have the choice of storing it in the filesystem or in the database. In this course we use the file system.

This lesson identifies the various methods of storing report definitions. We discussthe different file types associated with report building, and portability issues thatapply in cross-platform deployment.

ObjectivesAt the end of this lesson, you should be able to:

• Distinguish the different storage methods of report definitions.

• Compare report file types and their portability.

• Convert reports to different storage types.

• Upgrade report and printer definition files from Release 1.

Page 212: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

7-3 Copyright Oracle Corporation, 1998. All rights reserved.

Storage Methods

• Options:

– File system

– Database

• Considerations:

– Application management

– Storage restrictions

7-4 Copyright Oracle Corporation, 1998. All rights reserved.

Report File Types

Type

.rdf

.rep

.rex

Description

Full report definition(includes source code and comments)modifiable through Builderbinary, executable

No source code or commentsnot modifiablebinary, executable

Full report definitionnot modifiableASCII text, not executable

Page 213: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-5......................................................................................................................................................

......................................................................................................................................................Storage Methods and Requirements

Storage Methods and Requirements

IntroductionYou can store any Report Builder module, report, external query, or externalPL/SQL library, in either an operating system file or in the Report Builder databasetables.

The most common method, and often the most efficient depending on your networkspeed, is in a system file. However, your choice depends on your own system ofapplication management (how you handle file security and version control) and anyrestrictions, in terms of database size and file storage allocations.

Note: You can store template modules in an operating sytem file only, not in thedatabase tables.

Operating System Report File TypesAny report you save to a file has the file extensions and properties listed in the tablebelow.

For a full list of supported files, in addition to report files, see:Online Help:Contents—>Report Builder Reference—>Storage—>Supported files.

FileType Contents Creation Format Features.rdf Single report

definition,includingsource codeand comments

File—>SaveFile—>Save asFile—>Administration—>Convert

Binary executable,modifiable in ReportBuilder

Full reportdefinition,and executable inone file

.rep Singlerunnablereport, nocomments orsource code

File—>Administration—>Compile ReportFile—>Administration—>Convert

Binary executable, notmodifiable

Reduced size ofexecutable,prevents usermodification

.rex Single reportdefinition,includingsource codeand comments

File—>Administration—>Convert

Text (ASCII orEBCDIC), notexecutable, not directlymodifiable (convert to.rdf and modify inReport Builder)

Source control andcan be used fordebugging

Page 214: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

Instructor NoteYou might mention that the Report Builder tables and views have the prefix SRW2(If students ask, SRW stands for SQL*ReportWriter, which was a predecessor ofDeveloper/2000 Reports.)

Developer/2000 Reports also uses generic Developer/2000 tables and views thathave the prefix TOOL.

To create the tables and views,you must be a system administrator. Use theDeveloper 2000 R2.0 Admin menu (on Windows NT) which provides Build, Drop,Grant, and Revoke menu items. Invoke Developer 2000 Build. This script promptsfor the system password and invokes a series of scripts to build all the requiredobjects for Developer/2000 (including Reports, Forms, Graphics, Translation andQuery builders).

To give access to a new developer, DO NOT rerun the Build script. From the sameDeveloper 2000 R2.0 Admin menu, invoke Developer 2000 Grant for each userid.

The scripts to build and drop the tables are in<oracle_home>\tools\dbtab20, but itis safer to use the menu option because there are many scripts, and they must run inthe correct sequence.

The script for Developer/2000 Build is calledd2kbild.sql.

7-5 Copyright Oracle Corporation, 1998. All rights reserved.

Database Storage

SaveFileor

database? Report Builder?

Database

Product tables

• Full exportabledefinition

• Report on reports

• Central repository

Page 215: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-7......................................................................................................................................................

......................................................................................................................................................Storage Methods and Requirements

Database Table StorageWhen you save a module to the database, its definition is stored in theReportBuilder tables. These tables hold a combination of report specific and integratedOracle product information. As with SQL*Plus and accessing the data dictionary,you see the data through views.

Why Save to the Database?You may want to save reports to the database for these reasons:

• Export from one database to another

• Document your reports

• Modify the Report on Reports.rdf files, which run against the Report Builderproduct tables

• Use as a central repository during the build process

Installing Database TablesIn order to save definitions to the database, the Report Builder product tables mustexist in the database, userid SYSTEM. Usually a system administrator installs thesetables for the development team.

These product-specific tables form a repository to store all the information aboutyour report definitions.

ReferenceFor further information on the subject see:

Online Help:Manuals—>Developer/2000: Getting Started—>Administrative Procedures.Help Topics—>Report Builder Reference—>Administration.

Page 216: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

7-6 Copyright Oracle Corporation, 1998. All rights reserved.

Documenting Reports

• Run Report Builder utility.

– File—>Administration—>Report onReports

• Document multiple reports usingwildcards: % and _.

• Modify installation reports.

– <oracle_home>\report30\srwdoclb.rdf

– <oracle_home>\report30\srwdocpb.rdf

• Run batch mode: R30RUN...BATCH=YES.

Page 217: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-9......................................................................................................................................................

......................................................................................................................................................Documenting Your Reports

Documenting Your Reports

IntroductionThe most common reason for storing your reports in the database is so that you candocument your report definitions for maintenance or debugging purposes.

• Use the Developer/2000 facility in Report Builder to produce documentationdescribing your report definition.

• Write your own reports to query the Report Builder tables.

Steps to Create Documentation in Report Builder1 Save one or more reports to the database.

2 Select File—>Administration—>Report on Reports.

3 Choose Portrait or Landscape orientation for your report.

4 Fill in the runtime parameter form and choose OK.

Note: If the Report Builder tables do not exist, Developer/2000 displays an errormessage after Step 2.

Documenting More than One ReportYou can document more than one report by using wildcards, % and _, in the reportname. You can also choose to omit all comments and/or PL/SQL code, and specifythe level of detail you require, for example document the Data information orLayout information only.

Invoking the Documentation ReportsThe Report on Reports menu item runs two reports calledsrwdoclb.rdf, forlandscape orientation, andsrwdocpb.rdf for portrait orientation. They exist in theReport30 product directory, usually<oracle_home>\report30.

These reports are Report Builder definitions. You can modify them by opening themin Report Builder.

You can choose to document a number of reports in batch, by invoking either ofthese reports with the R30RUN command, including the runtime parameterBATCH=YES.

Page 218: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

7-7 Copyright Oracle Corporation, 1998. All rights reserved.

File Portability

.rex

.rdf

.rep

Portable as text

Portable as binary

Sometimes portable asbinary (if no PL/SQL)

Page 219: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-11......................................................................................................................................................

......................................................................................................................................................File Portability

File Portability

IntroductionYou may need to move report definition files from one machine to another, eitherduring development or when installing the production application.

PortabilityEach file created has different characteristics that determine how portable it is acrossplatforms. The table below lists the portable files, with any limitations they may have.

Although .rep files are considered portable when they do not contain PL/SQL, it israre to have a report that does not contain any PL/SQL code. We recommend thatyou always consider using either .rdf or .rex files when porting, and recompile.repfiles for each operating system.

File Type Portability

.rex (text) 100% portable

.rdf (binary + text) Portable if transferred as binary(PL/SQL recompiles on open and run)

.rep (binary) Portable as binary if no PL/SQL is present

Page 220: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

Instructor NoteNote that SOURCEDIR is only searched when the report runs on the remoteReports Server.

7-8 Copyright Oracle Corporation, 1998. All rights reserved.

File Searching Method

Hardcoded path that prefixes file nameor

1. Path that the operating systemconsiders the current path

2. Path specified in SOURCEDIR(R30MTS only)

3. Path specified in REPORTS30_PATH

4. Path specified in ORACLE_PATH

5. Location when Report Builder orReport Runtime was invoked

Page 221: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-13......................................................................................................................................................

......................................................................................................................................................File Portability

File Searching MethodWhen you reference a file in Reports, Developer/2000 searches for the file asfollows, depending on whether you include the pathname in the reference:

• The hardcoded path prefixing the filename (if specified)

• The following variable paths in sequence:

1 The path that your operating system considers the current path

2 The path specified in the environment variable SOURCEDIR (searched byReports Server, R30MTS, only)

3 The path specified in the environment variableREPORTS30_PATH

4 The path specified in the environment variableORACLE_PATH

5 Your location when you invoked Report Builder or Report Runtime

Note: Developer/2000 uses the variable paths to locate reports and external filessuch as PL/SQL libraries, external queries, and external boilerplate, only if the pathis nothardcoded.

For further information on the subject see the online Help system.

Page 222: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

Instructor NoteRemind students that full details of executables and arguments are available in theonline Help system.

7-9 Copyright Oracle Corporation, 1998. All rights reserved.

Converting Report Definitions

Database

Invoke R30CON from Report Buildermenu, Windows menu, or command line.

.rdf .rex.rep

Page 223: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-15......................................................................................................................................................

......................................................................................................................................................Converting Report Definitions

Converting Report Definitions

IntroductionYou can convert your report definitions from one storage type to another by usingthe R30CON executable.

Invoking the Conversion UtilityYou can invoke this conversion in one of three ways:

• From Report Builder:

- File—>Administration—>Convert

• From the Windows menu:

- Start—>Programs—>Developer/2000 R2.0—>Report Compiler

• From the command line:

- R30CON + arguments

Conversion OptionsThe following report conversions can be performed using R30CON:

• Convert a report stored in the database into a .rep, .rex, or .rdf file

• Convert a report stored in a .rdf file into a.repor .rex file, or a database report

• Convert a report stored in a .rex file into a database report, .rdf file, or .rep file

Note: You can also convert a report definition to a template definition. However, wedo not recommend this as a method of creating your templates, since theinformation stored in the converted template is limited; only Margin, Header andTrailer objects are converted.

Page 224: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

Instructor NoteYou might want to mention that there is no R30 executable to migrate direct fromSQL*ReportWriter 1.1. To migrate SRW 1.1 reports, users must first migrate toDeveloper/2000 Release 1.x using the R25MREP executable, then they can openthese migrated reports in Developer/2000 Release 2.

7-10 Copyright Oracle Corporation, 1998. All rights reserved.

Migrating Developer/2000Release 1 Reports

• Open and save reports in Release 2.

– Automatic PL/SQL upgrade utility

– Log file contains syntaxincompatibilities

• Use wizard for major modification.

• Use layout model for individual changes.

• Move Release 1 printer definitions to<oracle_home>\report30\printers.

Page 225: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-17......................................................................................................................................................

......................................................................................................................................................Migrating Developer/2000 Release 1 Reports

Migrating Developer/2000 Release 1 Reports

IntroductionYou can migrate existing report definitions from Developer/2000 Release 1 (Reports2.5) by opening and saving the report in the Release 2 Report Builder.

Upgrading PL/SQL Code

Because of syntax differences between the PL/SQL versions, an upgrade utilityautomatically verifies your PL/SQL syntax when you first open a Release 1 reportdefinition.

The upgrade utility reports any syntax incompatibilities that it cannot correct, andcreates a log file for you to view the messages and manually alter the code asnecessary.

Modifying Migrated ReportsYou can reenter the wizard to make changes to an upgraded report, but rememberthat the wizard recreates your layout, so you lose all layout changes, includinglayout triggers, that existed in the original report definition.

To make individual changes to upgraded reports, use the Layout Model editor,which also provides an additional default layout tool.

Migrating Printer Definition FilesThe Developer/2000 Release 1 printer definition files (.prt), used for character-mode reports only, are totally compatible with Developer/2000 Release 2. Copyyour customized printer definition files to the printer directory:<oracle_home>\report30\printers.

Developer/2000 PL/SQL

Release 1 PL/SQL 1

Release 2 PL/SQL 2.3

Page 226: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

7-11 Copyright Oracle Corporation, 1998. All rights reserved.

Summary

• Storage methods: file or database

• Report on reports documentation utility

• File portability

• Conversion between storage types

• Upgrading Release 1 report and printerdefinitions

Page 227: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-19......................................................................................................................................................

......................................................................................................................................................Summary

SummaryIn this lesson you learned the difference between saving a report definition to a file,including the three different report file types, and saving in the database.

One reason for saving in the database is to use the Report on Reports utility todocument your report definition.

Most Developer/2000 Report Builder files are portable, some as text, others asbinary.

Use the Reports Convert utility to convert between the different report storage types.

Upgrading from Release 1 does not require a special utility. Open a Release 1 reportin Report Builder. If the report definition contains PL/SQL, the code automaticallyupgrades to PL/SQL 2.3.

Page 228: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

7-12 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 7 Overview

• Using the Help system to findinformation on storage types andexecutables

• Converting a report using the Convertutility

• Documenting a report using the Reporton Reports utility (optional)

Page 229: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 7-21......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 7

Practice Session Overview: Lesson 7This practice session contains:

• Using the Help system to find comprehensive information on storage types andexecutables

• Converting the storage type of a report using the Convert utility

• Documenting a report using the Report on Reports utility

Since the Report Builder tables are optional in Developer/2000, your classroommight not have the tables available for you to save your report. Therefore yourinstructor will advise you whether to attempt this question

Instructor NoteIn the production version of Developer/2000 Release 2.0 the executable isR30CON(32.EXE), but in the Help system it is still called R30CONV. Just point thisout to students, if they have difficulty finding it in the Help system, since thepractice uses the correct name R30CON.The if you have time question is optional, since some classes might not have thedatabase tables available.The Report on Reports runtime parameter form cuts off the names of theparameters.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 modifythese in Report Builder if they want.

Page 230: Developer 2000 - Build Reports Volume 1 Instructor Guide

7-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 7: Report Storage Methods

Practice Session: Lesson 71 Search the Help system for information on the R30CON executable.

What is this executable used for?

Can you compile more than one report with this utility?

What other tool could you use to compile several reports?Hint: You may want to refer to Lesson 1.

When converting a report to a template, what is converted and what is not?

2 Use the Convert utility in Report Builder to convert a report from.rdf to .rep.

a Openp6q3.rdf, if not already open.

b Convert it to a.rep file.

c What other methods could you use to compile a report?

What is the difference?

d Convert the same report to a.rex file.

e Open a system editor to look at the.rex file.

If You Have Time3 If the database product tables are installed, document a report definition that is

saved in the database.

a Save reportp6q3 to the database.

b Run the Report on Reports utility to produce documentation on thereportp6q3. Set the runtime parameters to output to a file in PDFformat.

c Open the PDF file and scroll through the documentation.

Page 231: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

8

Enhancing Reports Usingthe Data Model—Creating

Queries and Groups

Page 232: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteTopic TimingLecture 50 minutes

Practice 45 minutes

Total 95 minutes

8-2 Copyright Oracle Corporation, 1998. All rights reserved.

ObjectivesAt the end of this lesson, you should beable to

• Describe Data Model objects.

• Modify report hierarchy.

• Change the order of data in a group.

• Eliminate data from a report.

• Create supplemental rows of data, byadding queries.

• Link data from different queries.

Page 233: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionYou have learned to create simple, single-query reports using the Report wizard. Formany reports, one query is sufficient. However, sometimes reports require multiplequeries and a more complex structure than the wizard provides.

In this lesson you learn the Data Model structure and objects, and how to enhancereports by creating additional groups and queries to achieve more complex reportstructures.

ObjectivesAt the end of this lesson, you should be able to:

• Describe the Data Model objects and their relationship.

• Modify the report hierarchy, by creating additional groups.

• Change the order of data in a group.

• Eliminate data from the report, using a group filter.

• Create supplemental rows of data, by adding queries.

• Link data from different queries, by creating a data link.

Page 234: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteOpen a report definition that contains a tabular report (L8DEMO1.RDF).

In the Object Navigator, show the Data Model node, including parameter nodes.

Show the data model and briefly describe the query, group, and columns that thewizard created.

Open a Group Left or Group Above report (example:L4ABOVE.RDF) and show theadditional group(s) in the Data Model editor. Explain the hierarchy.

We explain how to modify the existing query and create the extra group using theData Model instead of the wizard. Obviously, if you can use the wizard, it is thesimplest method, but sometimes, especially in more complex reports, you need to beable to modify the Data Model.Developer/2000 Release 2.1 has a Data Modelwizard that enables you to modify multiple query reports more easily.

8-3 Copyright Oracle Corporation, 1998. All rights reserved.

The Data Model Objects

Page 235: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-5......................................................................................................................................................

......................................................................................................................................................Describing the Report Data Model

Describing the Report Data Model

IntroductionThe Data Model defines the report data and its hierarchy, that is, the report structure.The Data Model does not define any formatting attributes for the report output. Thissection introduces you to the objects in the data model and their appearance in theData Model editor.

The Data Model ObjectsThe Data Model consists of the objects listed below.

What Does the Wizard Create?The objects that the wizard creates by default depend on the style of report that youchoose.

• Tabular style: One query, one group

• Group Above, Group Left: One query, two or more groups

The number of group objects depends on the number of break groups you define inthe wizard.

In Release 2.0, the Report wizard creates only one query.

Object DescriptionQuery You can create a report with one or more queries. The Report wizard

creates a single-query report. Use the query tool to create additionalqueries.

Group Each group is owned by a query. By default, Reports creates onegroup for each query.

Column Columns are owned by the group to which they belong. By default,the group contains one column for each select expression in thequery.

Link Links join a parent group to a child group. You may create links toform a relationship between groups from different queries. Links arenever created by default.

Parameter Parameters are owned by the report. You may create parameters thatallow users to enter value restrictions at runtime. Reports alsoprovides a number of system parameters by default.

Page 236: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteDemonstration: useL8DEMO1.RDF.

With Data Model open, double-click on Q_1 to open the property palette. Open theSQL query statement. Type E.FIRST_NAME, before E.LAST_NAME. Choose OKto close the query statement window, and show how FIRST_NAME column isadded (without the table alias E.) to the end of the group, not in the same position asin the statement. All new columns are added as the last column in the group.

Edit the statement again. Concatenate FIRST_NAME||’ ’||LAST_NAME and add analias EMPLOYEE.

Show EMPLOYEE at the bottom of the group. Point out the use of the meaningfulcolumn alias. Drag this column up above TITLE.

Also point out that, if the query contains duplicate column names Report Builderappends a number to make the report column name unique. You can use columnaliases to give these columns more meaningful names.

Mention that the Query Builder prepends the schema name; you can remove orchange this schema name. We have removed schema names from the coursedemonstrations so that they run for any user.

8-4 Copyright Oracle Corporation, 1998. All rights reserved.

Modifying Properties of a Query

• Modify SQL Query Statement

– Add, rename, or delete columns.

– Use column and table aliases.

– Remove or modify schema name.

• Syntax error checks occur when:

– Exiting SQL query statement

– Compiling or executing a report

SELECT d.id, d.name, e.title, e.first_name|| ' ' ||e.last_name employee_name, e.salary*12 annual_salary

FROM s_emp e, s_dept d WHERE e.dept_id = d.id

Page 237: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-7......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Query

Modifying Properties of a Query

IntroductionYou can modify a query, including the SQL statement, by changing properties in thequery property palette.

Editing the SQL Query StatementTo edit the query statement, open the property palette, choose the SQL QueryStatement property and click the left-hand button.

The SQL Query Statement dialog box appears.

Modifying ColumnsIf you add to, rename, or delete a column or expression in the query statement,Reports automatically creates, revises, or deletes the corresponding column in theData Model.

Using Column and Table AliasesRemember that you can use aliases against the database columns and tables in thequery. Report Builder uses your column aliases to create the relevant report columnnames. Table aliases help your query access the database and return data as quicklyas possible. Aliases therefore provide:

• Fast database access and return of data.

• Shorter, more meaningful names for query expressions, such as employee_nameand annual_salary in the example opposite.

Referencing the Schema NameIf you use Query Builder to create your queries, you will notice that it prepends theschema name to the table name. If you want to run this report against a differentschema, either modify or delete the schema name in the query.

Dealing with Error MessagesReports checks the syntax when you try to leave the SQL Query Statement dialogbox and whenever you generate or execute the report.

If Reports detects an error, it displays the error in anAlert.

Page 238: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteContinue demonstration:

Rename the query: Q_EMP. Note that this does not rename the group.

Add a comment to the query. Show each method, either in the Comment property orthe Query statement, but recommend they use one or other, not both.

Run the report (with no other changes). In the Previewer, LAST_NAME appearscrossed out because we altered the Query and there is no longer a LAST_NAMEcolumn. This is the original layout based on the previous Data Model. So, we haveto update the layout (on the next page).

8-5 Copyright Oracle Corporation, 1998. All rights reserved.

More Properties

Aid maintenance and testing

• Rename queries in complex reports

• Add comments to describe queries

– -- comment for single lines

– /*comment*/ for multiple lines

• Set Maximum Rows to restrict data

Page 239: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-9......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Query

Renaming QueriesWe recommend that you rename queries in a complex report, to make the DataModel easy to understand.

Renaming a query does not automatically rename the group below it.

Commenting Your QueriesUse the Comment property to enter meaningful text that describes the query.

You can also insert comment lines directly in the SQL Query Statement area, usingthe Oracle standard comment delimiters:

• --comment for a single line

• /*comment*/ for multiple lines

Note: For ease of maintenance, avoid entering comments in different places for thesame query.

Restricting RowsSet the Maximum Rows property to restrict the rows returned from a query. This isuseful for testing your report against a large database.

Page 240: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteChoose Report Wizard (from toolbar or menu).

Go to the fields tab and select all fields. Choose Finish. Show the Employee field inthe Live Previewer.

The Report wizard removes all existing layout objects and recreates the layout withnew information from the Data Model.

8-6 Copyright Oracle Corporation, 1998. All rights reserved.

Updating the Layout

• Update layout to reflect changes in DataModel.

– Choose Report wizard.

– Alter tab pages.

• Wizard destroys previous layout andcreates new objects.

Page 241: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-11......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Query

Updating the LayoutWhen you alter the Data Model, you must update your layout to see the changes.

Choose Report Wizard from the toolbar, or Tools—>Report Wizard from the menu,and alter the tabs to create a new layout with additional groups and columns.

This completely destroys the previous layout and constructs all objects based on thenew information in the Data Model.

Note: If you edit a query statement to alter any columns that are part of an existinglayout, and run the report without recreating the layout, the Source propertybecomes <null>, and the field in the previewer appears with a large cross.

Page 242: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteDemonstration:

In the Data Model, show how to rename the group: G_EMP.

Double-click on the group bar to display the property palette.

Also show that you can change the name in the Object Navigator.

8-7 Copyright Oracle Corporation, 1998. All rights reserved.

Groups

Groups determine hierarchy and frequency

• Wizard creates default groups

– Default naming conventions

– You can change query name

– You can change group name

• Developer-created groups for

– Control break reports

– Complex matrix reports

Page 243: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-13......................................................................................................................................................

......................................................................................................................................................Changing the Group Structure

Changing the Group Structure

IntroductionGroups organize your data into sets of records and, in a hierarchy, determine thefrequency at which records in that group appear in the output. Each group containscolumns that Report Builder assigns to the group by default, or that you specificallyassign.

Changing the Group NameIf you change a query name after the group has been created, the group namedoesnot change automatically.

There are two ways you can change the group name:

• Open the Group property palette, and change the Name property.

• In the Object Navigator, select the node representing the group; select the groupname again: this removes the highlight and changes the cursor to an I-beam.Edit the group name. The next time you activate the Data Model editor the newgroup name is visible.

Developer-Created GroupsSometimes you do not want to modify existing Data Model objects in the Reportwizard, for example during later maintenance. In this case, you might need to createyour own groups in the Data Model to perform the following actions:

• Produce control break (nested) reports

• Produce complex matrix reports

Page 244: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteDemonstration: Use shift-select to select and drag ID and NAME up out of G_EMPto create a new group. Rename it G_DEPT.

Choose Report Wizard from the toolbar, to update the layout. Choose Group Abovestyle. Show the Group tab: ID and NAME are selected because you dragged theminto the new group, you can modify the group fields at any time by reentering thewizard.

Report Builder updates the wizard information based on the changes you make inthe Data Model. Report Builder also updates the Data Model with any changes thatyou make in the reentrant wizard.

The default position of the objects in the Live Previewer, depends on the query,group, and column positions in the Data Model.

1 Drag columns up or left, tocreate a parent group.

2 Drag columns down or right,to create a child group.

8-8 Copyright Oracle Corporation, 1998. All rights reserved.

Group Hierarchy

1

2

Page 245: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-15......................................................................................................................................................

......................................................................................................................................................The Group Hierarchy

The Group Hierarchy

IntroductionThe groups in Reports exist in a hierarchy. You can alter the group hierarchy bycreating new groups.

As you have already seen, a single query produces one default group. You canproduce acontrol break report structure by creating one or more additional groupsabove the default. The following example of a single query, called Q_EMP, is thebasis for the hierarchical report.

Creating a New GroupSelect D.ID and drag it out of and above the default group to create a break group.Change the group name to make it more meaningful.

You can drag other columns, such as D.NAME, into the new group. Alternatively,move more than one column into a new group by shift-selecting the columns beforedragging them all together.

Note: You can also drag columnsdowna hierarchy, from a higher group into a newor existing lower-level group. The order in which the groups exist in the Data Modelhas an effect on the output. Always ensure your parent (master) group is first, child(detail) group is second.

One Level LimitWhen you drag a column to create a new group, the new group is only one levelabove or below the column’s original group in the hierarchy.

To create a group more than one level from the original group:

1 Move the column to the level immediately above or below the required positionof the new group.

2 Drag the column out to create the new group at the next level.

SELECT e.first_name, e.last_name, e.title,d.id, d.name

FROM s_emp e, s_dept dWHERE e.dept_id = d.id

Page 246: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteDemonstration: Edit the query Q_EMP: order by E.SALARY.

Run the report and show that the order of departments remains the same (ascendingnumeric order of department ID), it is only each individual list of employees that issorted by salary within the department.

In the data model, show the two arrowheads beside ID and NAME. Drag NAMEabove ID. (Do not update the layout; we still want ID to be the first field on the left.)

Run the report. Show the different order, ascending alphabetical order of departmentname. The break order for the first column takes precedence over the other columns,from top to bottom in the group.

Open the property palette for NAME (department name). Remove the break (SetBreak Order = No). Run the report. It sorts by ID.

Open the property palette for ID and change the break to Descending.

1 Break group controls primary sort; uses Set Break Order andBreak Order properties

2 Order by NAME column: Set Break Order = Yes;Break Order = Descending

3 Child group controls final sort; uses ORDER BY clause in thequery

8-9 Copyright Oracle Corporation, 1998. All rights reserved.

Ordering Data in a Group

1

2

3

Page 247: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-17......................................................................................................................................................

......................................................................................................................................................Ordering Data in a Group Hierarchy

Ordering Data in a Group Hierarchy

IntroductionBreak groups that you create in a hierarchical report display data in a default order.You can modify this default.

Break OrderBreak order controls the break structure and the order in which to display thecolumn’s values. It is denoted by a solid arrowhead to the left of the column. Forcolumn values in user-created groups, you must use the Set Break Order and BreakOrder properties to specify how to order the break column’s values. The order ofprecedence depends on the order of columns, from the top down, in the group.

Reversing the Break OrderTo reverse the break order, double-click the column in the group to open up theColumn property sheet. Change the break order from Ascending to Descendingusing the pop-up list. In the Data Model, the arrowhead is displayed in reverse.

Note: All break groups must have at least one column withSet Break Order = Yes.

Break Order in Break GroupsRemove unnecessary break columns in each break group to improve theperformance of your report. A break group is any group other than the lowest groupof each query. If several columns are all unique, such as our department ID andNAME columns, having break order set on both columns can sometimes causeunnecessary sorting.

1 Open the NAME column property palette.

2 Alter Set Break Order to No.

3 Repeat for each column that is not part of the sort.

Break Order in Lower GroupsThe Break Order property has no effect on columns in the lowest group of eachquery. Modify the ORDER BY clause in the SQL query statement to control thisgroup.

Removing the Break Order property from columns in this lowest group is optionaland has no effect on the output.

Page 248: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteThe Break Order property uses the positional column number (2) instead of thecolumn name to build the ORDER BY clause at run time. Report Builder uses thisnotation to allow for the use of aliases in the SELECT clause, which were invalidsyntax for an ORDER BY clause in previous database releases.

We do not recommend that students use this notation when they explicitly writetheir own ORDER BY clauses in their SQL queries.

If you want to see the SQL Query that Report Builder sends to the server at runtime, create a trace file using the Tools—>Trace option. Specify a filename,including pathname if you want. Select Execution of SQL and any other options yourequire. This is the only way to see the ORDER BY clause that Report Builderbuilds dynamically at run time.

8-10 Copyright Oracle Corporation, 1998. All rights reserved.

Query Modifications

In a break report, data order is determinedby:

• Break order columns in the break groups

• Columns that you specify in the ORDERBY clause

SELECT d.id, d.name, e.last_name...

FROM s_emp e, s_dept d

WHERE e.dept_id = d.id

ORDER BY 2, e.salary

Page 249: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-19......................................................................................................................................................

......................................................................................................................................................Ordering Data in a Group Hierarchy

Reports Query ModificationsThe examples below show how the ORDER BY clause is modified.

For each database column with Set Break Order = Yes, Reports appends an ORDERBY clause to the query or modifies the existing ORDER BY clause.The break columns always take precedence over the lowest group columns.

For example, suppose your report contains the following query:

If you create a break group containing D.ID and D.NAME, but with D.NAME as theonly break column, then at runtime your query becomes:

SELECT d.id, d.name, e.last_name, e.salaryFROM s_emp e, s_dept dWHERE e.dept_id = d.idORDER BY e.salary

SELECT d.id, d.name, e.last_name, e.salaryFROM s_emp e, s_dept dWHERE e.dept_id = d.idORDER BY 2, e.salary

Page 250: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteDemonstration: In the same report, restrict G_DEPT to the first six records.

8-11 Copyright Oracle Corporation, 1998. All rights reserved.

Filtering Data in a Group

8-12 Copyright Oracle Corporation, 1998. All rights reserved.

Using a Packaged Filter

Reports provides two packaged filters:

• First

Retrieves the first <n> records forthe group

• Last

Retrieves the last <n> records forthe group

Page 251: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-21......................................................................................................................................................

......................................................................................................................................................Filtering Data in a Group

Filtering Data in a Group

IntroductionA group filter allows you to control the processing of records in each group. Thissection briefly describes the two types of filter available and how to use a packagedfilter to restrict the number of records returned.

Two Types of Group Filter• Packaged filter: allows you to restrict processing to a predetermined number of

records.

• Developer-created filter: allows you to control processing dependent onconditional PL/SQL code.

Note: We describe developer-created filters in more detail in a later lesson.

Identifying an Active FilterIn the Data Model editor, the circle above the group object changes to green when afilter is active.

Using a Packaged FilterA packaged filterallows you to specify the number of records that you wish toretrieve in a group. You can use this to restrict the data while developing yourreports.

The Two Packaged Filters• TheFirst filter retrieves the first <n> records for the group.

• TheLast filter retrieves the last <n> records for the group.

Steps to Apply a Packaged Filter1 Double-click the group title bar, or its icon in the Object Navigator, to display

the property palette.

2 Change Filter Type toFirst or Last.The Number of Records property appears.

3 Enter the number of records you require.

How Is Data Fetched in a Packaged Filter?• First filter: Reports retrieves a multiple of the array size, sufficient to satisfy the

filter, based on a parameter value at runtime.

• Last filter: Reports must retrieve all records to establish which are last.

Page 252: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteDemonstration: In the Data Model, create a new query to the right of previousquery.

Choose Import SQL Query and choose the fileL8EXT.SQL (count employees thathave the same job title). This copies the file content into the Query SQL Statement.The query content is fully editable, as if you entered the statement yourself.(External queries are discussed on next page.)

If asked: There is another property External Query Source File that allows you tolink the external query file to the report (as we did in Reports 2.5). In that case, thequery is not editable in the report definition.

Do not take too long to explain how to create an external query in Reports. Thebenefits are access to the Query Builder (from Tools menu) and the ability to storeas a database definition instead of a file if required.

The External Query editor is still a very simple window in R2.0. However, plannedfeatures for R2.1 include a toolbar and status line.

Planned for Release 2.1:Data Model wizard that creates multiple queries. Also, theability to base a query on a Ref cursor, and ability to use a stored program unit toimplement a ref cursor query. (A Ref cursor variable was introduced in Oracle 7.2.You can use it to perform array fetches of select statements opened by a server-sideprocedure.)

8-13 Copyright Oracle Corporation, 1998. All rights reserved.

Adding New Data

• Create query statement:

– Enter valid syntax

– Choose Query Builder

– Choose Import SQL Query

Page 253: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-23......................................................................................................................................................

......................................................................................................................................................Adding New Data

Adding New Data

IntroductionFor many standard reports, one query is sufficient. However, sometimes reportsrequire multiple queries. This section describes how to add data to your report bycreating additional queries.

Steps to Create a New Query1 In the Data Model editor, select the Query tool and click in the Data Model

painter area to create a new query.

A Query object appears and the SQL Query Statement dialog box opens.

Note: This behavior is controlled by a tools preference.

2 Create the query statement, in one of three ways:

- Enter the syntax of a valid select statement.

- Choose Query Builder and build the query.

- Choose Import SQL Query and select a.sql file.

Default GroupsEach query that you create in the Data Model creates one default group. ReportBuilder creates a unique group name by appending a number, G_1, G_2, and so on.

Note: When you create the first query and group using the Report wizard, as in aprevious lesson, the first group uses the first column name as the default.

Page 254: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteMention the External Query Source File briefly, to explain the property, but stressthat this is not a common method. Most reports contain the query source within thequery objects of the report definition.

Do not encourage students to use this method, but do point out the rules in case theychoose to do so.

8-14 Copyright Oracle Corporation, 1998. All rights reserved.

Using an External Query

• Import an external query from a file

– Import SQL Query button

• Create an external query file

– Notepad

– SQL*Plus

– Report Builder

• Link to an external query source

Page 255: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-25......................................................................................................................................................

......................................................................................................................................................Adding New Data

Using an External QueryThe Import SQL Query option allows you to import the contents of a text file thatcontains a valid select statement. We refer to the file as an external query.

The external query file contains one select statement only.

Creating an External QueryYou can create an external query in several ways:

• Open a text editor, such as Notepad.

• Invoke SQL*Plus. Enter, run, and test a query, then save.

• Developer/2000 Report Builder. Choose File—>New—>External Query. Youcan access Query Builder from the Tools menu.

When creating an external query in Report Builder, you can save the query to thedatabase instead of a file.

Linking to an External Query Source FileInstead of importing the contents of a file into your report definition, you can createa link to a separate source. The external query source can exist in a file or in thedatabase (report product tables).

Select the External Query Source File property for a query, and enter the name of afile. If the external query exists in the database, prefix DB: to the query name.

An external query source file can be a maximum of 32K.

Report Builder validates the external query source when you enter the name in theproperty palette and also at run time. Therefore, the following rules apply:

• The external query must always exist at run time.

• You must ensure that, if you update the external query, it does not invalidate anydependent report definitions.

Page 256: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-26 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteInvoke the Report wizard to update the layout.

Show the Group tab. Now that we have multiple queries, we can choose a directionfor the new group of data. This allows you to print records across the page from leftto right instead of down the page. Choose Down.

At this stage, select all fields, so that the list of job titles includes the departmentnumber. Otherwise, as a separate tabular listing, the job information is not verymeaningful at this point. Later we will link it to departments, and then we will notneed the dept_id value.

Change COUNT_NAMES label to Count, and change the width to 3.

Change the template to Corporate 1 Landscape.

8-15 Copyright Oracle Corporation, 1998. All rights reserved.

Viewing Output from MultipleQuery Reports

Page 257: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-27......................................................................................................................................................

......................................................................................................................................................Adding New Data

Viewing Output from Multiple Query ReportsWhen you reenter the wizard and update the layout based on multiple queries in theData Model, the order in which unrelated groups of records appear in the outputdepends on the position of queries and groups in the Data Model.

It is the position of the group that determines the processing, not the query.

ExampleIn the report opposite the G_JOB group occurs to the right of the hierarchical modelof G_DEPT and its related child group G_EMP; therefore, the department andemployee records are formatted in the output before the job title records.

The output shows a master-detail listing of departments and employees. After alldepartments have been processed, we see a tabular list of jobs.

If you want to output the job information first, move Q_JOB and G_JOB to the leftof, or below, G_DEPT. G_EMP is always related directly to G_DEPT because thetwo groups are owned by the same query.

Page 258: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-28 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

8-16 Copyright Oracle Corporation, 1998. All rights reserved.

Using Data Links

Id

45

34

Name

Operations

Sales

Last_Name

Dumas

Chang

Patel

Dept_Id

45

34

34

S_Dept

S_Emp

id = dept_id

• Equi-join

8-17 Copyright Oracle Corporation, 1998. All rights reserved.

• Compound join

– Multi-column primary or foreign key

– Define multiple equi-joins

• Nonequi-join

– Primary key value between two othervalues

– Create two links:s_emp.salary >= salgrade.losal

s_emp.salary <= salgrade.hisal

Using Data Links

Page 259: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-29......................................................................................................................................................

......................................................................................................................................................Using Data Links to Structure Data

Using Data Links to Structure Data

IntroductionA data link defines a parent/child relationship between a group and a query by wayof aprimary key andforeign key. The parent/child relationship causes the childquery to be executed for each instance (record) of the parent group, retrieving onlyrows that match the conditions specified in the link.

Primary and Foreign KeysA data link usually corresponds to a primary/foreign key relationship between theunderlying database tables. The common SQL term for this is ajoin.

Defining Equi-JoinsCreate a single link to define anequi-join.

An equi-join is a join condition where one value is equal to another.

Compound KeysYou can define multiple equi-joins between the same group and query, to implementacompound primary/foreign key relationship, that is a key that consists of morethan one column.

Defining Nonequi-JoinsCreate two links to define anonequi-join.

A nonequi-join is a condition where one value falls between a range of two othervalues.

In this example, you define links for two separate expressions:

...WHERE s_dept.id = s_emp.dept_id

...WHERE s_emp.salary BETWEEN salgrade.losal AND salgrade.hisal

s_emp.salary >= salgrade.losal

s_emp.salary <= salgrade.hisal

Page 260: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-30 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteDemonstration:

Link from ID to DEPT_ID. Explain carefully how to use the Data Link tool. Thisoften causes students problems.

Now, update the layout to use the new link information from the Data Model.

Choose all fields, except DEPT_ID, we do not need to see it in the output.

In Live Previewer, scroll down to show Department 43 or 45. The new group on theright shows the total number of employees in the department that have each job title.

8-18 Copyright Oracle Corporation, 1998. All rights reserved.

Creating a Link

Page 261: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-31......................................................................................................................................................

......................................................................................................................................................Using Data Links to Structure Data

Steps to Create a Data LinkUse the Link tool to create a link between groups.

1 In the Data Model editor select the Link tool.

2 Click the primary key column of the parent group and drag a link to the foreignkey column of the child query.

Note: Always create a link from the parent query to the child query.

Modifying the Link DefinitionOpen the property palette using the right mouse button or double-click the linkobject in the Data Model or Object Navigator. You can modify the SQL Clause andCondition properties; both have lists of values:

• Change the SQL Clause property from the default WHERE, to HAVING orSTART WITH.

• Change the Condition to any logical operator in the list such as >= or <=.

The other properties are read-only. If you want to change the parent or childproperties, you must delete and recreate the link.

A Multiple-Query Linked ReportAssume the following two queries within a report.

Query: Q_EMP

Query: Q_JOB

You need to link them, to display job information for each department, instead ofone separate list at the end. The link in the Data Model isfromQ_EMP:ID columnto G_JOB:DEPT_ID column.

SELECT d.id, d.name, e.last_name, e.title, e.salaryFROM s_emp e, s_dept dWHERE e.dept_id = d.id

SELECT dept_id, title, count(id) count_namesFROM s_empGROUP BY dept_id, title

Page 262: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-32 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

8-19 Copyright Oracle Corporation, 1998. All rights reserved.

Other Data Link Methods

Two other methods of forming a link:

• Manual: Using a WHERE clause to formthe link

• Automatic: Using primary/foreign keyconstraints to form the link

Page 263: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-33......................................................................................................................................................

......................................................................................................................................................Using Data Links to Structure Data

Other Data Link MethodsThere are two other types of data link that you can create.

• Manual link

• Automatic link

Creating a Manual LinkA manual link is a link between two group objects, not between specific columns.The link does not define a join condition.

1 Select the Link tool.

2 Click on the parent group and drag the mouse to the child group

3 Edit the child query to include your own join condition, if applicable.

Note: Since the manual link does not define a join between specific columns, youcannot modify the link definition in the property palette.

ExampleAssume a simple example of a master query Q_DEPT and child query Q_EMP. InQ_EMP add the join condition:

Note: “:id” is a bind reference to the primary key column in the master query,Q_DEPT.

Why Create a Manual Link?Create a manual link for the following reasons:

• Define a complex join condition in a query.

• Implement a cartesian product, linking two tables without a join condition.

Creating an Automatic LinkAn automatic link is a link between two query objects that automatically defines ajoin condition if the relevant primary/foreign key constraints exist in the databasefor columns in the queries.

1 Select the link tool.

2 Click on the parent query and drag the mouse to the child query.

An error appears if no relevant constraints exist that match the columns in themaster and child queries. You must include the primary/foreign key columns in yourqueries.

...WHERE s_emp.dept_id = :id

Page 264: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-34 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Instructor NoteOur S_DEPT and S_EMP tables do not show an outer join—there are nodepartments without employees, but if you want to show the two query model with alink, openL8MULTIQ.RDF.

You can also use this to demonstrate the manual and automatic links if you prefer touse a demonstrate instead of a slide.

8-20 Copyright Oracle Corporation, 1998. All rights reserved.

Efficiency Implication of Multipleor Single-Query Hierarchy

• Outer joins

• Data ratio

• Client-Server environment

Page 265: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-35......................................................................................................................................................

......................................................................................................................................................Efficiency Issues: Multiple or Single-Query Hierarchy

Efficiency Issues: Multiple or Single-Query Hierarchy

IntroductionYou can create the department/employee group hierarchy with two queries insteadof one. If you link these two queries, the data structure is the same as the single-query example, that is, a two-level, master-detail hierarchy.

Since you can build a similar report structure using a single-query or multiple-querydata model, your choice depends partly on your report requirements, that is,whether you require an outer join report, and on the ratio of master to detail recordsin your data tables.

Outer JoinsConsider whether you wish to display all master records, regardless of any existingdetails (outer join), or only those master records that have related details.

You can add the outer join notation (+) to a single query, but if you require many orcomplex outer joins, consider using multiple queries which fetch all records in themaster query even if there are no records in the detail query.

Data RatioConsider the likely ratio of master to detail rows. As a general guide, for manymaster records with relatively few details, use a single query.

If your data contains relatively few masters with many details each, however,consider using two queries with a link. This means that you retrieve the columns foreach master record only once (in the master query) instead of repeating the mastercolumns for every detail row in a single query.

Client-Server EnvironmentThis mode of access is a strong argument for reducing the number of queries on thedatabase to a minimum. Multiple queries for a hierarchical report result in fargreater network traffic, in order to fetch records from each query separately.

Note: You can use SQL*Trace to analyze your report, for example, see how muchtime it is taking to retrieve data from the database.

Page 266: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-36 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

8-21 Copyright Oracle Corporation, 1998. All rights reserved.

Summary• Groups: structure data in a group

hierarchy.

• Queries: write efficient SQL. Test inSQL*Plus.

• External queries: save a SQL statementin a file and import into a report.

• Data links: create a relationshipbetween data in different queries,normally corresponding to primary andforeign keys.

• Efficiency: plan the queries required.

Page 267: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-37......................................................................................................................................................

......................................................................................................................................................Summary

Summary

QueriesA report only performs well if the SQL code that accesses the database is efficient.Write well constructed SELECT statements. Use SQL*Trace for detailed analysis ofthe data access.

You can restrict the rows returned by a query using the Maximum Rows property.This is useful for testing purposes.

External QueriesCreate a query in SQL*Plus and test for accuracy and efficiency. Save the finalquery to a.sql file, then import the query to one or more reports.

Create external queries from the Report Builder, which allows you to use the QueryBuilder and to save the query in the database instead of a file.

GroupsOrganize data into sets of records, allowing you to establish hierarchical reports toany depth and width.

Data LinksCreate a data link between two queries, either manually or automatically.

Multiple-Query ReportsA report may comprise many queries running consecutively, or linked together toform a hierarchy. Links are formed according to primary and foreign keyrelationships.

EfficiencyConsider outer joins, data ratios, and network traffic when designing your reportsand planning the number of queries.

Page 268: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-38 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

8-22 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 8 Overview• Creating a second query in an existing

report

• Restricting records in a query

• Restricting records with a packagedfilter

• Creating a data linke

• Creating a report containing a mastergroup with two details

• Creating and referencing an externalquery file

Page 269: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-39......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 8

Practice Session Overview: Lesson 8This practice session contains:

• Creating a second query in an existing report

• Restricting records in a query

• Restricting records with a packaged filter

• Creating a data link

• Creating a report containing a master group with two detail groups

• Creating an external query file and referencing the file in a new report

IntroductionIn this practice session you include new data in a report by adding a query to anexisting single-query report created with the wizard. You also practice linking datafrom 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 andlink it to a report.

Page 270: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-40 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Practice Session: Lesson 81 Open reportp8q1_a.rdfthat contains a single-query report showing customer

information.

a In the Data Model create a new query. Either use the Query Builder,or import filenamep8q1.sql.

b Open the Report wizard and choose a Tabular layout.

c Copy group G_ORD to the Displayed Groups area.

d Copy all remaining fields to the Displayed Fields area.

e Choose Finish.

f Note how the data appears in the Live Previewer. TheQ_CUSTOMER data appears before the Q_ORD data. Rememberyou can alter the order in which the data prints by modifying queryorder in the Data Model. You may want to try that.

Note: If you do adjust the order of the queries, please put them back in theoriginal order, and save before the next question.

g Save the report asp8q1.rdf, do not close the report.

2 Modify the previous report to restrict the number of customer records processedby the group.

a Place a filter on the G_CUSTOMER group, to display only the firstfour customers. Run to test.

b Save the report asp8q2.rdf and close it.

c Close the report, and any other you still have open in the ObjectNavigator.

3 Openp8q1.rdf.a In 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 primarykey 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 Abovestyle. Do not display CUSTOMER_ID.

QUERY : Q_ORD

SELECT customer_id, id, date_shipped, totalFROM s_ord

Page 271: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-41......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 8

c Run to test.

d Save the report asp8q3.rdf.

4 Modify p8q3.rdf to show and restrict customers’ credit rating. You need tomodify the query properties.

a Include CREDIT_RATING in the query statement, though you neednot display it. Restrict the query statement to show those who have apoor credit rating.

b Run to test.

c Save the report asp8q4.rdf and close it.

5 Create a new report that lists the sales representatives and the products they havesold.

a Choose a Group Above report style.

b Import the query filep8q5_a.sql.

c Make NAME and ID the group fields. Ensure that these fields are inone group, at Level 1, not two separate groups.

d Do not display ID but display all other fields in the order described inthe table below.Hint: You can change the order of fields in the Report wizard on thefields tab.

e Change the following field attributes:

f Use the template filesummit.tdf.

g Run and test your report.

Column Label Width

name Name 20

product Product 10

product_id Id 4

quantity Quantity 4

prod_total Total 6

Page 272: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-42 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

h Now you need to show not only which products the salesrepresentatives have sold but also who are the customers they havedone business with.Go to the Data Model and add a new query, importing the filep8q5_b.sql.This query returns the customer names, their ids and thetotal sales per customer for each sales representative.

i Rename the group to G_CUSTOMER.

j Link the second query to the correct group.

k Use the Report wizard to display the new group. Do not displaySALES_REP_ID or ID.

l Change the following field attributes:

m Run and test your report.

n Save the report asp8q5.rdf and close it.

If You Have Time6 Create an External Query module that selects the following data:

a Remember to include a join condition.

b Give the columns meaningful names.

c Save the query asp8q5.sql and close the query window.

7 Use the Report wizard to create a Group Left report using the external querycreated in Question 5.

a Department information should be in the master group.

b Look at the Data Model. Notice the break group exists.

Column Label Width

customer Customer 10

customer_id Id 4

cust_total Total 6

Columns Tableid, name s_deptid, first_name||’ ’||last_name, title, salarys_emp

Page 273: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 8-43......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 8

c In the Data Model, move TITLE into a group at the top of thehierarchy.Hint: Move it into the department group first, then up into its ownnew group.

Note: Since this is a single-query report, you can also make the group changeusing the Report wizard, Group tab. However, you have learned that you cancombine many queries and groups in your own reports and this simple exercisehelps you to practice moving columns in the data model.

d Open the Report wizard and choose Finish, to update the layout andrun the report.

e Run and test the report.

f Save the report asp8q7.rdf and close it.

Do you still have any objects open in the Object Navigator? If you do close them all.

Page 274: Developer 2000 - Build Reports Volume 1 Instructor Guide

8-44 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 8: Enhancing Reports Using the Data Model—Creating Queries and Groups

Page 275: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

9

Enhancing Reports Usingthe Data Model—Creating

Columns

Page 276: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

Instructor NoteTopic TimingLecture 50 minutes

Practice 45 minutes

Total 95 minutes

9-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to

• Describe various Data Model columns.

• Display the contents of a file.

• Identify characteristics of user-definedcolumns.

• Create report summaries and subtotals.

• Derive data, using a formula column.

• Create and populate a placeholder.

Page 277: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionWhen you define a query to extract the data from the database, and modify thegroup structure, you might want to modify the data model further, to performcomplex calculations not included in your query.

In this lesson you learn more about the Data Model objects, and how to enhancereports by creating user-defined columns for summaries and calculations.

ObjectivesAt the end of this lesson, you should be able to:

• Describe the different types of Data Model columns.

• Display the contents of a file, using a database column.

• Identify the characteristics of the three types of user-defined columns.

• Create report summaries and subtotals, using summary columns.

• Derive data, using a formula column.

• Create and populate a placeholder column.

Page 278: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

1 Database columns 4 Placeholder column

2 Summary column 5 Summary column at reportlevel

3 Formula column

9-3 Copyright Oracle Corporation, 1998. All rights reserved.

Data Model Columns

1

23

4

5

Page 279: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-5......................................................................................................................................................

......................................................................................................................................................The Data Model Column Types

The Data Model Column Types

IntroductionA Data Model column is a data container. A column defines the type of data, butdoes not include any formatting information relating to the report output.

The Column TypesThere are two main types of column, those that Report Builder creates from yourquery and those that you create yourself:

• Database columns: Report Builder creates one column for each item in theSELECT statement of a query. Database columns are directly associated with acolumn orexpression retrieved from the database by the query. You cannotmodify most properties of a database column.

• Developer-created columns: You can create columns, either in a specific groupor at report level.

Developer-Created ColumnsA developer-created column may be one of three types:

• Summary column: summarizes another column and can recalculate for eachrecord in a specified group.

• Formula column: uses a formula you have written in PL/SQL to calculate avalue from one or more other columns.

• Placeholder column: has its value set from another object at runtime.

Default Column NamesEach column that you create in the Data Model has an initial default name, whichyou should change to a descriptive name.

Column Type Default Name

Summary CS_1

Formula CF_1

Placeholder CP_1

Page 280: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

1 Read-only properties

9-4 Copyright Oracle Corporation, 1998. All rights reserved.

Maintaining Database Columns

1

Page 281: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-7......................................................................................................................................................

......................................................................................................................................................Maintaining Database Columns

Maintaining Database Columns

IntroductionSince Report Builder creates database columns from the contents of the querystatement, there are some restrictions to how you modify these columns.

Displaying a Column Property PaletteTo display a column’s property palette, as for other report objects, you can use oneof several methods:

• Double-click on the Column icon in the Object Navigator.

• Double-click on the Column in the Data Model.

• Select the column and use the right mouse menu.

• Select the column and use the Tool menu.

Editing Database Column PropertiesFor database columns, some of the property settings are not editable in the propertypalette. You can see the values, but you cannot modify them. These values aredependent on the column name and type in the SQL query.

The read-only properties are:

• Name

• Datatype

• Width

All editable properties, except Value if Null, provide a list of values.

Some properties might or might not appear in the palette, depending on the columndatatype, or on the value of another property.

Deleting a Database ColumnYou cannot delete a database column object directly from the group. To delete acolumn, you must remove the corresponding expression from the SELECTstatement in the query.

Page 282: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

Instructor NoteDemonstration files:L9FILE.RDF; tabular style showing filenames, not images.Modify this report to show the images during the demonstration. (Also point outthat you can display a picture that is stored directly in a long raw column in thedatabase.)

Although the column properties occur in the Data Model, the same properties arealso available from the Live Previewer (and the Layout editor), where the propertypalette combines field and column properties.

When you demonstrate the Read from File property, you might want to double-clickon the image in the Live Previewer and show that you can modify the sameproperties there, under the Column node.

9-5 Copyright Oracle Corporation, 1998. All rights reserved.

Outputting Contents of a File

Page 283: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-9......................................................................................................................................................

......................................................................................................................................................Using a Database Column to Output Contents of a File

Using a Database Column to Output Contents of a File

IntroductionYou can include in your report the contents of a file, for which the file name variesfor each record retrieved. The file can contain an image, for example the picture ofeach employee or of each product, as shown opposite.

What Is a File Column?A file columnis a database column that contains the name of an operating systemfile or a URL. The file can be text, image or multimedia.

The Read from File property does not exist in the property palette unless thedatabase column has a datatype of Character.

What File Formats Can You Output?Report Builder provides a list of values for the file type: Text, Image, CGM, OracleFormat (drawing), Sound, Video, OLE2, and Image URL.

Note: Text is the only valid format in character mode reports.

Steps to Create a File Column1 Open the column property palette.

2 Set Read from File to Yes.

3 Select the appropriate file format from the list of valid types.

What Does the Report Wizard Create?• Video or Sound format: Button

• All other file formats: Field

The Report wizard provides a default size for the displayed field. However, you canresize it either in the Live Previewer or the Layout Model editor.

File SearchFor portability, avoid prefixing the full path to the filename in the column. If you donot prefix a path, Report Builder can use its file path search order to find the file.

Include the correct paths in the environment variable REPORTS30_PATH.

Page 284: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

Instructor NoteDescribe the three column types briefly at this stage.

The following pages contain a definition and explanation of each, before describingsome example reports that demonstrate how to use each of the column typescorrectly.

The first example is a simplification of the “Highest Earner” report from a previouscourse, and uses all three types together. The other examples demonstrate thevarious property settings for Summary columns.

9-6 Copyright Oracle Corporation, 1998. All rights reserved.

Creating a Column

• What type of value?Choose the correctcolumn tool.

• What frequency?Create in a group orat report level.

C_xxx

C_xxx

C_xxx

Page 285: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-11......................................................................................................................................................

......................................................................................................................................................Creating a Column

Creating a Column

IntroductionThere are two important questions to ask yourself before you create a column:

• What type of column do I require?—The answer determines which one of thethree tools to select.

• How often do I want this column to display?—The frequency at which thecolumn value appears in the output determines the group in which you create thecolumn.

Steps to Create a Column1 Select the appropriate tool from the toolbar in the Data Model editor. Click

inside a group to create the column at the same frequency as other columns inthat group.

Note: To display the column once for the report, click in an open area of theData Model editor.

2 Double-click on the column to display its property palette.

3 Replace the default column number with a brief but descriptive name. Considerstandard naming conventions for different types of column.

4 Fill in the rest of the settings as appropriate for the type of column you require.

Page 286: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

9-7 Copyright Oracle Corporation, 1998. All rights reserved.

Summary Column

• Specific properties:

– Function

– Source

– Reset At

– Compute At

• Datatype depends on Source datatype.

• Page summaries: not supported in thewizard.

Page 287: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-13......................................................................................................................................................

......................................................................................................................................................Creating Summary Columns

Creating Summary Columns

IntroductionA summary column performs a computation on another column’s data.

Summary Column PropertiesThe following properties apply specifically to summary columns:

• Function—the calculation to be performed on the values of the column specifiedin Source.

• Source—the name of the column whose values are to be summarized. Source isa list of values containing those columns that are valid for the specifiedFunction.

• Reset Atthe group at which the summary column value resets to zero.

• Compute At—the group for which a% of Total summary column is computed.Compute At is used only for columns with a function of% of Total.

Summary DatatypesThe datatype of a summary column is dependent on the datatype of the source of thesummary. If you change the datatype of the source column, the datatype of thesummary also changes.

Page SummariesThe Report wizard does not support page summaries. If you select a page summaryin the Field tab of the wizard, an error message appears. Deselect the page summaryfrom Field tab and create the field manually in the layout editor. Creating fields inthe layout editor is described in a later lesson.

Page 288: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

Instructor NoteDemonstration:L9SUM.RDF.

1 Department totals

2 Report total

9-8 Copyright Oracle Corporation, 1998. All rights reserved.

Displaying SubtotalsReset At:

G_dept

1

2

Report

Page 289: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-15......................................................................................................................................................

......................................................................................................................................................Example Report Displaying Subtotals

Example Report Displaying Subtotals

IntroductionThe control break report output opposite shows two summary columns created bythe wizard. One summary shows the total salary for each department, the othershows the total salary for the whole report.

The wizard creates these summaries at one or more levels above the salary sourcecolumn.

Resetting Summary ValuesThe Reset At property defines the group at which a summary resets to zero, to allowyou to recalculate a number of subtotals.

The wizard chooses a default reset value for these summaries.

• The department total, in G_Dept, is reset at G_Dept, that is, values start fromzero for each new department record.

• The report total, at report level, is reset at Report.

To create an accumulating total for the department total, change the Reset Atproperty to Report.

Valid Reset OptionsThe Reset At property displays only options that are valid for each summary.

There are two options, Report and Page, that are valid for all summaries. Dependingon the level of the summary, some groups are also available in the valid list.

Outputting Summary ValuesThe frequency at which the summary value displays depends on the group withinwhich you create the column.

RuleTo create your own summaries, use the following rule:

Discrete Total: Reset At value is the same as the summary group.

Accumulating Total: Reset At value is a higher group than the summary.

Page 290: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

Instructor NoteDemonstration:L9PCT.RDF.

1 Department total percentage

2 Employee total percentage

9-9 Copyright Oracle Corporation, 1998. All rights reserved.

Displaying PercentagesReset At: G_empCompute At: G_dept

1

2

G_empReport

Page 291: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-17......................................................................................................................................................

......................................................................................................................................................Example Report Displaying Percentages

Example Report Displaying Percentages

IntroductionThe control break report opposite shows the following two percentage totals createdby the wizard:

• Employee’s salary as an individual percentage

- Notice that this is a column in the G_Emp group. This is the only summaryfunction for which the wizard creates a column in the same group as itssource.

• Department total as a percentage of the report total

Resetting PercentagesThe Reset At property works the same way that the Sum function does. The default,Reset At G_Emp, results in a discrete value for each employee.

For both summaries opposite, the Reset At property is G_EMP. Both percentagesreset to zero for each employee record. If you want to create a running percentagethat eventually accumulates to 100%, change the Reset At property to a reset at ahigher level than its source column. For example, to create an accumulatingpercentage that accumulates for each department and then resets to zero, changeReset At to G_Dept.

The Compute At PropertyThe Compute At setting defines the total value that a% of Totalsummary uses in thepercentage calculation. This property is only applicable to% of Total summaries.

The wizard sets the Compute At property to one group above the source column. Inthe left-hand example opposite, the default is G_Dept. To display the salary as apercentage of the whole report value, change Compute At to Report.

Page 292: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

9-10 Copyright Oracle Corporation, 1998. All rights reserved.

Resetting Summary Values

REPORT

Grand Total

Running

Total

Running

Total

Data ModelGroup

REPORT

G_DEPT

G_EMP

Reset At

G_DEPT

XXXX

Sub Total

Running

Total

G_EMP

XXXX

XXXX

Record

Total

Page 293: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-19......................................................................................................................................................

......................................................................................................................................................Example Report Displaying Percentages

Resetting Summary ValuesThe Data Model group defines how often a value is calculated. Therefore ReportBuilder does not allow you to reset a calculated value at a lower level of the hierarchy;that is, you cannot reset a value more often than you calculate it.

Valid Group and Reset OptionsThe table on the opposite page, identifies which combinations of group and resetoptions are valid. The XXXX denotes invalid combinations.

Page 294: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

9-11 Copyright Oracle Corporation, 1998. All rights reserved.

Formula Column

• Performs a user-defined computation

• Executes a PL/SQL function

• Must return a value

• Can be Character, Number, or Date

• Returned value must match datatype

function CF_SALCALCFormula return Number isbegin return(my_function(:salary));end;

Page 295: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-21......................................................................................................................................................

......................................................................................................................................................Creating Formula Columns

Creating Formula Columns

IntroductionA formula column performs a user-defined computation on one or more othercolumn’s data.

The PL/SQL Formula property button opens the Program Unit editor where you enterand edit your code.

Code in a Formula ColumnThe formula is a PL/SQL function that returns a single value. It must return a valueof the same type as specified in the datatype property. The following code is asimple example that calls another function, passing the :salary value as an argument,and returns the result in the SALCOMM formula column.

RuleAny columns referenced by the formula column are calculated first.

A Note on Efficiency:The code above is a simple example to illustrate the syntax. The function“my_function” might be a local program unit at report level, a program unit in anattached PL/SQL library, or a stored program unit.

Only consider using a formula column when you cannot include your calculation inthe query statement. It is always advisable to perform calculations on the serverrather than on the client, especially if the calculation requires only database values.

function salcomm return number is

begin

return(my_function (:salary));

end;

Page 296: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

Instructor NoteStress that you must code the PL/SQL (to populate the placeholder) in anotherobject, not the placeholder column itself.

If students ask for more details about the PL/SQL Formula property:

A placeholder column cannot populate itself; therefore, you write the formula in aFormula column (or trigger), not in the placeholder.

The only time you need the Formula property in a placeholder is if you populate theplaceholder from a user exit that you call in the other object.

In that case, Report Builder cannot resolve possible dependencies that might be inthe user exit, so you must call SRW.REFERENCE() in the placeholder itself, todeclare explicitly any column values on which the placeholder depends. (The SRWpackage is discussed in a later lesson.)

9-12 Copyright Oracle Corporation, 1998. All rights reserved.

Placeholder Column

• An empty container atdesign time

• Populated by anotherobject at run time

– Before Report trigger

– Formula column atreport level

– Formula column in samegroup or belowplaceholder

CP_xxx

CF_xxx

Page 297: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-23......................................................................................................................................................

......................................................................................................................................................Creating Placeholder Columns

Creating Placeholder Columns

IntroductionA placeholder column is an empty container at design time. The placeholder can holda value at run time that has been calculated and placed into it by PL/SQL code fromanother object.

Setting the Value of a Placeholder ColumnYou can set the value of a placeholder column in the following places:

• A Before Report trigger

• A report-level formula column (if the placeholder column is at report level)

• A formula column in the placeholder group or a group below it

Uses of Placeholder Columns• Placeholder columns enable you to populate multiple columns from one piece of

code. You can calculate several values in one block of PL/SQL code in aformula column, and assign each value to a different placeholder column. Youtherefore create and maintain only one program unit instead of many.

• Store a temporary value for future reference. For example, store the currentmaximum salary as records are retrieved.

The Placeholder’s PL/SQL Formula PropertyYou cannot populate a placeholder by writing code in the placeholder’s ownFormula property.

• The PL/SQL Formula button opens up the Program Unit editor where you enterand edit your code. This is only applicable when you call a user exit.

Page 298: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

Instructor NoteDemonstration:

Open the reportL9PLACE.RDF. The report is prebuilt, because this is not an easydemonstration to create from scratch and display neatly and quickly, especiallysince the students have not seen the Layout editor yet.

Show the report output in the Live Previewer and explain the aim of the report. Pointout that this layout is not totally achievable in the Live Previewer.

Then show the Data Model, explain each of the three columns.

Show the properties for each.

Remember to show the PL/SQL Formula for the formula column and explain thecode. The first block of code is a simple example. It returns only one employee. Toallow for multiple employees who earn the maximum salary, the code must test foran existing string in the placeholder and concatenate with the current name.

9-13 Copyright Oracle Corporation, 1998. All rights reserved.

Populating a Placeholder

Page 299: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-25......................................................................................................................................................

......................................................................................................................................................Example Report to Populate a Placeholder

Example Report to Populate a Placeholder

IntroductionThe sample report opposite is a report of all employees. The aim of the report is to:

• Calculate, and temporarily store, the name of the employee who earns thehighest salary in the company

• Display the highest earner and the maximum salary once, at the beginning of thereport

The ColumnsWe need to create the following columns:

• A SUMMARY to show the maximum salary for the company

• A PLACEHOLDER to contain the highest earner’s name at runtime

• A FORMULA to:

- Compare each employee salary with the maximum salary

- Populate the placeholder with the employee name if salary equals maximumsalary

Steps to Create the Columns1 Create a summary column CS_MAX_SALARY at report level (outside all

groups). Datatype: Number, Width: 10, Function: Maximum.

2 Create a placeholder column CP_MAX_EARNER at report level (outside allgroups). Datatype: Character, Width: 80.

3 Create a formula column CF_CALC_MAX in the G_EMP group. Datatype:Number, Width: 10 (these are the default values).

4 Open the Program Unit editor from the PL/SQL Formula property inCF_CALC_MAX. Create a function:

function CF_CALC_MAXFormula return Number isbegin

if :salary = :CS_MAX_SALARY then:CP_MAX_EARNER := (:LAST_NAME||’ in Department ’||

:ID||’--’||:NAME);end if;

return(0);end;

Page 300: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-26 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

9-14 Copyright Oracle Corporation, 1998. All rights reserved.

Summary

• Column types

• Summary levels

• Reset At—resets to zero

• Compute At—% of Total only

• Formula columns return a value

• Placeholder columns hold a value

Page 301: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-27......................................................................................................................................................

......................................................................................................................................................Summary

Summary

Column Types• A database column exists for each column or expression in the query.

• Create summary columns for computations and summaries.

• Create formula columns to perform a calculation or to populate a placeholdercolumn.

• Create a placeholder column to provide an empty container that is populatedfrom another object at run time.

Summary Levels• Report

• Page (not supported by the Report wizard)

• Groups within the Report

Reset AtThe level at which to reset the summary back to zero

Compute AtOnly valid for summary columns with a function of% Total

Page 302: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-28 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

9-15 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 9 Overview

• Creating a new report with summaries

• Adding summary calculations to anexisting report

• Creating a report that displays thecontents of a file in a column

• Creating a new report with rankingsummary columns

• Adding placeholders for highest andlowest values

Page 303: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-29......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 9

Practice Session Overview: Lesson 9This practice session contains:

• Creating a new report with summaries

• Opening an existing report to add summary calculations to the columns

• Creating a report that displays the contents of a file in a column

• Creating a new report with ranking summary columns(Use ORDER BY clause to create the ranking effect.)

• Opening an existing report to add placeholders for the highest and lowest valuesin the report

IntroductionIn your reports, you may need to include additional columns with summaryfunctions, or even add summaries, such as break totals and report totals. Thispractice gives you the opportunity to create summaries and additional columns withfunctionality that cannot be achieved using SQL alone.

Page 304: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-30 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

Practice Session: Lesson 91 Create a new report using the Report wizard. Choose a Group Above report

style.

a Display the following data:

b Do you need a formula column to calculate the line_total?

c Create the following summaries. Can you use the Report wizard tocreate the summaries?

d Use the summit.tdf template file from the file system.

e In the Data Model, rename the groups to G_ORD for the break groupand G_ITEM for the detail group. Alter the position of columns inthe G_ORD group so that DATE_ORDERED is above ID, andchange the break order on DATE_ORDERED so that it is sorted indescending order.

f Run and test the report. (Do not reenter the wizard!)

g Save the report as p9q1.rdf and close it.

Table Column Definition Label Width

s_ord id Ord. No. 4

date_ordered Order Date 9

s_item item_id No. 2

product_id Product No. 5

price Price 4

quantity_shipped Quantity 4

line_total price*quantity_shipped Total 4

Column Summary

line_total Sum

line_total % Total

Page 305: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 9-31......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 9

2 Open report p8q5.rdf.

a Add a summary to total PROD_TOTAL for each employee master.Can you use the Report wizard?

b Create columns to show the percentage of the total per salesrepresentative for PROD_TOTAL and CUST_TOTAL.

c Make all the new summaries four characters wide.

d Run and test the report.

e Save the report asp9q2.rdf andclose it.

3 Create a new report using the Report wizard.

a Choose a Tabular report style and display the following information:

b Restrict the query to return only products with ID beginning with 10or 30, because we do not have picture files for all products.

c Run the report.

d In the Data Model change the properties for the column filename toread from an image file.

e Use the Report wizard to redo the layout.

f In the Live Previewer resize the picture column to about 3x3 inches.Hint: You need to enable Flex Mode. Use the last image on the pageto resize the picture column

g Save the report asp9q3.rdf and close it.

Table Column Label

s_product id Id

name Name

short_desc Description

s_image filename picture

Page 306: Developer 2000 - Build Reports Volume 1 Instructor Guide

9-32 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 9: Enhancing Reports Using the Data Model—Creating Columns

4 Open reportp9q1.rdf to list the orders ranked by their total.

a In the Data Model add column s_ord.total to the query.Hint: You have to move the new column TOTAL to the G_ORDgroup.

b As you want to list the highest total first, set the break order forTOTAL accordingly, and move the TOTAL column so that it is firstin the G_ORD group.

c To display the ranking add another column called RANK in thegroup G_ORD.

d Use the Report wizard to display the rank, giving it a width of 2. Youneed not display the total, because there is already a total on theG_ITEM group.

e Run the report to test.

f Save the report asp9q4.rdf and close it.

If You Have Time5 Open report p9q1.rdfto display the highest and lowest orders at the end of the

report.

a In the Data Model add the columns necessary to list the maximumorder total and the corresponding ID as well as the minimum ordertotal and the corresponding ID.Hint: You will need one formula column and some summaries andplaceholders.You can import the code for the formula column from the filep9q5.txt.

b Use the Report wizard to put the new columns into the layout.Display the maximum order total, the maximum ID, the minimumorder total and the minimum ID.

c Run the report to test. Scroll down to the last page to see the newcolumns.

d Save the report asp9q5.rdf and close it.

Page 307: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

10

Enhancing Reports Usingthe Layout Model

Page 308: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteTopic TimingLecture 50 minutes

Practice 45 minutes

Total 95 minutes

10-2 Copyright Oracle Corporation, 1997. All rights reserved.

ObjectivesAt the end of this lesson, you should beable to

• Distinguish the four report regions.

• Design multipanel reports.

• Describe the layout objects andrelationships.

• Modify an existing report layout.

• Create variable length lines.

• Create buttons and explicit anchors.

Page 309: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionYou can fulfill many of your report requirements simply by making modifications inthe Live Previewer. However, for more complex reports you need to modify or insertobjects in the Layout Model editor.

The layout can be a complex area to view and modify. This lesson aims to give youan appreciation of the layout regions, as well as the objects that you see and createusing object tools in the toolbar.

ObjectivesAt the end of this lesson, you should be able to:

• Distinguish the four different regions of a report.

• Design multipanel reports.

• Describe the layout objects and their relationship.

• Modify an existing report layout using the Layout Model tools.

• Separate report data using variable length lines.

• Add interactivity to a report, using a button.

• Alter object positions at run time, using an explicit anchor.

Page 310: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

10-3 Copyright Oracle Corporation, 1997. All rights reserved.

Viewing the Regions

CompensationReport

Header

Page 1 of 1 Margin

Body

End of report Trailer

Page 311: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-5......................................................................................................................................................

......................................................................................................................................................Viewing the Layout Model Regions

Viewing the Layout Model Regions

IntroductionThe Layout Model editor allows you to modify one of four different report regionsat any time. The regions separate the formatting ofheader andtrailer pages, andmargins from the mainbody of your report pages.

When you enter the Layout Model editor, you see the body region of your report. Tochange the view, choose the Body, Margin, Header, or Trailer tool in the toolbar orchoose View—>Layout Section—>Body, Margin, Header, or Trailer View.

HeaderThe header region consists of one or more pages that appear once, on a separate setof pages, at the beginning of the report. Header pages can contain text, graphics,data, computations, and summaries.

TrailerThe trailer region consists of one or more pages that appear once, on a separate setof pages, at the end of the report. Trailer pages can contain text, graphics, data,computations, and summaries.

BodyThe bulk of the report output appears on one or more pages, positioned between theheader and trailer pages. Each physical page consists of a body and margin region.

MarginA margin appears on all body pages, but not on a header or a trailer. Margins cancontain text, graphics, page numbers, page totals, and grand totals.

When you choose the margin view, the body also remains visible, but read-only, inthe editor. The body appears within a black rectangle that defines the size of marginand body. You cannot modify objects in the body while working in the margin view.

Adjusting Margin SizeTo adjust the size of the margin, choose the margin view, select the marginrectangle, click on a select handle and drag to resize.

Modify margins in your template definition to apply the same dimensions to manyreports.

Page 312: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteLogical panels apply to body pages only, not to header or trailer pages. Headers andtrailers are always one physical page width; however, headers and trailers can bemore than one physical page.

10-4 Copyright Oracle Corporation, 1997. All rights reserved.

Page 1-2

Page 2-2

• Logical horizontal panels = 2• Report output = 7 physical pages

Designing Multipanel ReportsCompensation

Report

March 31, 1994

End of report

Page 1-1

Page 2-1

Header

Body/Margin

Trailer

Page 313: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-7......................................................................................................................................................

......................................................................................................................................................Designing Multipanel Reports

Designing Multipanel Reports

IntroductionReport Builder allows you to design large, or multipanel, report layouts bymaintaining two different definitions of a page.

• A physical page represents the actual paper page size.

• A logical pagerepresents a conceptual page on which you can design the layoutof your report.

Logical Panels and Physical PagesReport Builder allows you to design multipanel reports, where the logical design ofthe report output is wider than the physical (printer) page. A report might need alayout width of 16 inches, that can print on two physical printer pages each 8 incheswide.

Define the logical and physical dimensions of your report in the property palette forthe report object itself:

1 Select the report node in the Object Navigator.

2 Open the property palette.

3 Specify physical page size: Report Width and Height properties.

4 Specify logical page size: Logical Horizontal/Vertical Panels properties.

Define the logical dimensions in multiples of the physical page width and height.

ExampleIn the diagram opposite, the layout is twice the width of the physical page. Forexample, to output a logical design of 16 inches across 8 inch pages, the settingsare:

• Unit of Measurement: Inch

• Physical Page Height: 8

• Logical Horizontal Panels: 2

• Logical Vertical Panels: 1

Printing PanelsThe default order in which panels print is Across/Down. That means that horizontalpanels print before vertical panels. To change this order, modify the Panel PrintOrder property.

Page 314: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteRemind students that, as long as they create and modify reports using the Reportwizard, they do not have to worry about the layering. The Report wizard createseverything correctly for them.

If they have to modify the layout themselves, recommend they test and save theirreport frequently, in case they make a big mistake and want to return to a previousversion. Point out that the File—>Revert menu option is very useful for this.

10-5 Copyright Oracle Corporation, 1997. All rights reserved.

Body

Layers of a Tabular Report

M_G_xxxR_G_xxxF_xxx F_xxx

Page 315: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-9......................................................................................................................................................

......................................................................................................................................................The Layout Model Layers

The Layout Model Layers

IntroductionAll layout objects exist in a hierarchy. Each object is contained inside and on a layerabove another object. The hierarchy is very important in the processing of reportobjects. If you destroy the correct layering, you receive error or warning messages,and the report might not run.

The bottom-most layer of a report is effectively the page itself.

Layers of a Tabular ReportTo explain the concept of layers, the exploded diagram shows the objects in a simpletabular report. From bottom up the layers are:

• Body

• M_G_xxx: group frame encloses other objects and controls the format,frequency, and position of several objects simultaneously

• R_G_xxx: repeating frame displays for each row of data that is retrieved for agroup

• F_xxx: fields define the appearance of columns; can contain character, number,date, for each database column

In addition, the tabular style creates a boilerplate text object, B_xxx, for each fieldlabel; these objects occur outside the repeating frame, not once for each record.

Group ReportsGroup Left and Group Above reports create two repeating frames, the detail groupframe is nested inside the master repeating frame, to produce a detail tabular listingfor each master record.

Page 316: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteThe slide shows:

• The effect of Confine Mode when Flex Mode is disabled; the parent enclosingobject does notflex

• The effect of Flex Mode when Confine Mode is enabled (locked); the enclosedobject cannot move outside its parent enclosing object

Flex Mode only flexes in one direction at a time, either horizontally or vertically, butnot diagonally. To flex the layout when moving diagonally, first move or resize theobject in one direction, horizontally or vertically, and then in the other direction as aseparate movement.

10-6 Copyright Oracle Corporation, 1997. All rights reserved.

Avoid Layout Errors

• Confine Mode

• Flex Mode

Page 317: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-11......................................................................................................................................................

......................................................................................................................................................The Layout Model Layers

Avoiding Layout ErrorsTo avoid common hierarchy errors in your report layout, always work in the LayoutModel using the Confine and Flex modes.

• Confine Mode

- Work with Confine Mode enabled (closed padlock), to avoid accidentlymoving one object outside or below its correct enclosing object.

- Work with Confine Mode disabled (open padlock) when you deliberatelywant to move one object outside its enclosing object.

• Flex Mode

- Work with Flex Mode enabled to adjust all affected objects when you moveor resize one object; the whole layoutflexes to accommodate your changes.

- Work with Flex Mode disabled when you want to move an individual objectwithout moving other objects.

Page 318: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteExplain the 3GL way of understanding the report processing.

Also briefly explain the meaning of the arrowhead (repeating frame) and thediamond (variable size).

10-7 Copyright Oracle Corporation, 1997. All rights reserved.

Report Processing

BEGIN M_G_master...

REPEAT R_G_master

BEGIN M_G_detail...REPEAT R_G_detail

END M_G_detail

END M_G_master

f_xxx f_xxx f_xxx

f_xxx f_xxx

Page 319: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-13......................................................................................................................................................

......................................................................................................................................................The Layout Model Layers

Report ProcessingTo understand how the Layout Model maps to the output that you see in the LivePreviewer, consider the layout as a 3GL program, where the group frame is a whileloop and the repeating frame is a block.

In a two-level group report, the report processes a master record including all detailsthat relate to each master record, and then processes the next master.

Layout SymbolsLayout objects often show symbols and icons that indicate their characteristics. Thediagram opposite shows two of these symbols:

• Black arrowhead: indicates a repeating frame object.

• Diamond: indicates the object is a variable size, it can increase or decrease insize depending on the contents.

BEGIN M_G_master

while M_G_master has records to processREPEAT R_G_master

BEGIN M_G_detailwhile M_G_detail has records to process

BEGIN R_G_detailend R_G_detail;

END M_G_detail;END R_G_master;

END M_G_master;

Page 320: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

1 Drawing objects 6 Text

2 Frame 7 Repeating frame

3 Field 8 Link file

4 Chart 9 Button

5 Anchor 10 OLE2 object

10-8 Copyright Oracle Corporation, 1997. All rights reserved.

Creating Layout ObjectsThe tool palette contains:

• Standard GUI drawing tools• Frame, repeating frame, field objects

• Other layout objects

1

2

3

4

5

6

7

8

9

10

Page 321: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-15......................................................................................................................................................

......................................................................................................................................................Creating Layout Objects

Creating Layout Objects

IntroductionLayout objects define the appearance of the report output and are displayed in theLayout Model editor.

When you create or modify your report using the Report wizard, Report Builderautomatically creates many objects, such as the frame, repeating frame, fields, andlabels for a tabular report style.

The tool palette provides tools for you to create these and other types of object. Thetools available depend on the view currently in the Layout Model.

Layout Object Naming ConventionsWhen you create a layout object, the default name is an alphabetic character thanindicates the object type, followed by a number. Rename your layout objectsmeaningfully to help you in developing and maintaining the report.

Additional Layout Objects

ObjectType

DefaultName Description

Chart D_ A display object that represents data as a graph, such as a pie orbar chart; Oracle Graphics runs the chart and returns the result tothe display object in your report

Boilerplate B_ Constant text or an image that appears in a report every time it isrun, and that is not dynamic; example: the Report wizard createscolumn labels and template objects

Link File B_ Constant text or an image that appears in a report every time it isrun, but is read from a file on disk

OLE2 B_ A layout object that calls an OLE2 registered product to displaysomething in your report

Button U_ An interface element that can perform a PL/SQL procedure, ordisplay a multimedia file; only applicable in the Previewer

Anchor None A layout object that anchors the position of one object relative toanother; create an anchor to override the default position

Page 322: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

10-9 Copyright Oracle Corporation, 1997. All rights reserved.

Layout Tools

• Shift for constrained objects

• Magnify

• Frame Select

• Additional Default Layout

• Pin a tool: double-click

Page 323: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-17......................................................................................................................................................

......................................................................................................................................................The Layout Model Tools

The Layout Model Tools

IntroductionIn addition to the object tools in the tool palette, the Layout Model provides somespecific tools to help you modify layout objects.

Pinning a ToolIf you want to create several objects of the same type, double-click the drawing tool.A small, red pin appears on the tool icon, and the tool remains active until you clickthe tool again or choose a different tool.

Drawing Constrained ObjectsTo create a constrained object, such as a perfect circle or square, hold down theconstrain (shift) key when drawing the object.

To resize an object to scale, hold down the constrain key when resizing the object.

Magnifying the LayoutChoose the magnify tool when you want to focus on one part of a large report. Themagnify tool centers the layout area on the point that you choose and enlargesobjects to twice their size.

Hold down the constrain key when using the magnify tool to reduce objects by half.

There are also zoom in and zoom out buttons in the toolbar.

Selecting All Objects in a FrameChoose the Frame Select tool, and then click on a frame or repeating frame in thelayout. This selects the frame and all objects inside it.

Additional Default LayoutThe Additional Default Layout tool invokes the wizard to enable you to createadditional layouts in your report without deleting existing objects.

Page 324: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteYou might want to point out that, if you need to change the print direction for thefirst layout of a report, you can delete the original layout created by the Reportwizard and use this Additional Default Layout tool in the Layout editor to reenterthe layout wizard.

Remember, in Release 2.1 you will have a separate Data Model wizard.

10-10 Copyright Oracle Corporation, 1997. All rights reserved.

Creating Additional Layout

Page 325: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-19......................................................................................................................................................

......................................................................................................................................................Creating Additional Layouts in a Report

Creating Additional Layouts in a Report

IntroductionThe Report wizard creates the initial layout for your report. When you add queriesand groups to the Data Model, you might want to create additional parts of yourlayout without affecting the layout that is already there.

Report Builder provides the Additional Default Layout tool that enables you tobuild up an indefinite number of separate layouts based on all or part of the DataModel.

For example, you can create a letter to be sent to all customers and add a tabularlayout to list all the customers at the end of the report. Both layouts use the samedata; there is no need to create two queries.

Steps to Create an Additional Layout1 Choose the Additional Default Layout tool from the tool palette.

2 Drag an area in the Layout Model editor defining where to place the newobjects.

The Report wizard opens.

3 Choose the Group tab; choose the group you want and the direction to print therecords.

4 Complete the wizard tabs as before.

Page 326: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteYou can create variable lines in the Live Previewer or the Layout editor;demonstrate in the Live Previewer and show the object in the Layout editor also.

Demonstration: L10FLEX.RDF, tabular report of s_emp, with some job titleswrapping onto more than one line.

In the Live Previewer, magnify the layout. Draw a vertical line between TITLE andSALARY to fill the first repeating frame. Show that the fixed line does not stretch tofill the records that wrap onto two lines. Select the line, open the property palette,and change Line Stretch with Frame to R_G_last_name; the line expands for eachrepeating frame.

Ask: What if you want the line to fill the whole group frame including the columnheadings? Answer: create the line starting at the top of the column headings andchange Line Stretch with Frame to the group frame.

Demonstrate this example: In the Live Previewer, you cannot extend the lineupwards, because the layout is protected, so delete and recreate the line from the topof the colum label through the repeating frame; set Line Stretch with Frame toM_G_last_name_GRPFR. Alternatively, change to the Layout editor, disableConfine Mode and extend the line. Remember to reenable Confine Mode.

10-11 Copyright Oracle Corporation, 1997. All rights reserved.

Flex Lines

Flex lines adjustto fit variableframes andrepeating frames

Line Stretch with Frame

Page 327: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-21......................................................................................................................................................

......................................................................................................................................................Creating Variable Length Lines

Creating Variable Length Lines

IntroductionThe line drawing tool enables you to draw straight vertical lines between columns ofa report. However, these lines are a fixed length, whereas the data in your reportmight be variable. Report Builder enables you to specify that a line varies in lengthor width to fill a chosen frame.

Separating Vertical Columns in a Tabular ReportIn the report opposite, the job title has a variable number of characters; sometimesthe characters require a single line field, sometimes more. The field expandsvertically if necessary at run time; the repeating frame also expands to contain thefield.

If we draw a vertical line inside the repeating frame, the line is not long enough tospan the extra line of characters at run time.

• To make the line stretch to fit the repeating frame, open the property palette.Choose Line Stretch with Frame and select the repeating frame you require,such as the repeating frame, R_xxx.

• To make the line stretch to fit the group frame, draw the line from the top of thecolumn labels through the repeating frame. Change the property Line Stretchwith Frame to the group frame, M_xxx_GRPFR.

Live Previewer Versus Layout EditorYou can create and modify a line in the Live Previewer or in the Layout editor.There are advantages and disadvantages to both:

• Live Previewer: It is easy to create a line and change the property. You caneasily see the line stretching with the data, but you cannot move the line outsideits enclosing object, because you cannot disable Confine Mode.

• Layout editor: You can disable Confine Mode to change the position of the line,but you cannot see the effect of Line Stretch with Frame until you view thereport in the Live Previewer.

Page 328: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

10-12 Copyright Oracle Corporation, 1997. All rights reserved.

Creating a Button

Buttons

• Provide runtime user interaction forPreviewer reports only

• Do not appear in printed output

• Can exist in any layout region

• Perform one of three actions:

– Display multimedia information

– Access a URL

– Drill-down to a detail report

10-13 Copyright Oracle Corporation, 1997. All rights reserved.

Displaying a Video Clip from aButton

Page 329: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-23......................................................................................................................................................

......................................................................................................................................................Displaying a Multimedia File from a Button

Displaying a Multimedia File from a Button

IntroductionButtons allow users to interact with a report in the Previewer at run time. Buttonshave no meaning in a printed report.

Create a button in any report region to:

• Display multimedia information related to report items

• Access a URL

• Drill-down to a separate detail report

Steps to Create a Button1 Choose the Button tool in the tool palette.

2 Click and drag an area in the layout.

3 Rename the button.

4 Choose label type, Text or Icon.

5 Enter a text string or an icon name (without the extension).

6 Set other properties as required.

Note: Report Builder uses the TK25_ICON environment variable to search for iconfiles outside the current working directory.

Displaying a Video ClipSet the following button behavior properties:

• Type: Multimedia File

• Multimedia File: name of file

• Multimedia File Type: Video

Testing Button BehaviorTo test that the button works as you want, run the report using the Reports Runtime;buttons are not active in the Live Previewer, because this is thedevelopmentpreviewer.

Page 330: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteEnable Anchoring Information (Navigator—>Navigator Options—>Layout tab)and explain how to read the symbols:

• Blue = parent object

• Red = child object

Large blob identifies the current node. Therefore large blue blob indicates currentnode is the parent; large red blob indicates current node is the child.

• Solid fill = explicit anchor

• Shaded fill = implicit anchor

10-14 Copyright Oracle Corporation, 1997. All rights reserved.

Creating Explicit Anchors

• Objects in the push path have implicitanchors (not visible in layout model).

• Explicit anchors override implicitanchors.

• All anchors appear in Object Navigator.Implicit (shaded)Explicit (solid)

Page 331: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-25......................................................................................................................................................

......................................................................................................................................................Creating Explicit Anchors

Creating Explicit Anchors

IntroductionThe absolute position of each layout object is, by default, related to the position ofits enclosing object at run time, unless one of the following is true:

• Report Builder determines that the position causes a conflict with other objects,so Report Builder creates an implicit anchor.

• You decide to override the default position of an object, so you create an explicitanchor.

Push PathReport Builder creates an implicit anchor for any object that it considers to be in thepush path of another object. For example:

• An object occurring below a vertical repeating frame

• An object occurring to the right of a horizontal repeating frame

• An object occurring below an object that has a variable vertical size

• An object occurring to the right of an object that has a variable horizontal size

Contrasting Implicit and Explicit Anchors

Implicit Explicit

Not visible in the Layout Model Visible in Layout Model

Created and maintained automatically byReport Builder

Created by developer, using Anchor tool intool palette

Visible in Object Navigator if Anchoring Information is enabled (Navigator option)

Page 332: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-26 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Instructor NoteDemonstration:L10ANC.RDF.

Warning: If you want to suppress null fields in mailing labels (which we used to dowith an anchor in the 2.5 class), it is not as simple as it used to be. The Reportwizard creates mailing labels as one boilerplate object with direct columnreferences.

Therefore you cannot simply add an explicit anchor to the mailing label report thatyou or the students built using the wizard earlier.

However, if youreally want to demonstrate the mailing label example, modify themailing label report from the earlier lesson as follows:

1 Delete the layout in the Layout editor.

2 Use the Additional Default Layout tool.

3 Change style to Tabular.

4 Change group direction to Across/Down.

5 Remove all labels.

6 Use template corpmat.tdfto ensure you have gaps between the fields.

10-15 Copyright Oracle Corporation, 1997. All rights reserved.

Removing SpacingLayout Output

F_LAST_NAME F_JOB

PRINT FOR ALL EMPLOYEES

PRINT FOR SALES PEOPLE ONLY

PRINT FOR ALL EMPLOYEES

SCHWARTZ Store Clerk

PRINT FOR ALL EMPLOYEES

PRINT FOR ALL EMPLOYEES

• Create anchor from child to parent

• Collapse Vertically = Yes

Page 333: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-27......................................................................................................................................................

......................................................................................................................................................Creating Explicit Anchors

Suppressing Space in Conditional ReportsYou can hide objects in your report by creating a format trigger to test for acondition and decide whether or not to display the object (We discuss formattriggers in more detail later in the course.) In some layouts, this can result inunwanted white space between the remaining objects. You can create explicitanchors to remove this extra space.

Steps to Remove Spacing in a Conditional Letter

The ProblemThe layout opposite is a letter that contains three paragraphs of text. Each paragraphis a separate boilerplate object.

The second paragraph is conditional on the employee job title. The condition in theformat trigger is below:

Since all three paragraphs are fixed size objects, their position is directly related tothe enclosing, repeating frame. The position of paragraph 3 remains the same,whether paragraph 2 prints or not, which results in a large gap for most letters.

The SolutionCreate an anchor from the top edge of paragraph 3 (the child object) up to thebottom edge of paragraph 2 (the parent object). Click once on the child to start theanchor, and double-click the parent to complete the anchor.

The start position of the child depends on the final position of the parent. Ifparagraph 2 does not take up any space, paragraph 3 starts higher up the page.

Collapsing AnchorsThe solution suppresses the space that was filled by paragraph 2, but it still showsthe gapsbetween both paragraphs. If you want to suppress this space, open theproperty palette of the anchor and change Collapse Vertically to Yes.

function b_para2formattrigger return boolean is

beginif :title like ‘Sales%’ then

return(true);else

return(false);end if;end;

Page 334: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-28 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

10-16 Copyright Oracle Corporation, 1997. All rights reserved.

Summary

• Modifying the Layout Model

– Report regions

– Multipanel reports

– Layout objects and tools

– Additional layouts

• Example reports

– Variable length lines

– Display a video clip from a button

– Suppress space with an anchor

Page 335: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-29......................................................................................................................................................

......................................................................................................................................................Summary

Summary

IntroductionIn this lesson you learned to modify a report layout in the Layout Model editor.

Modifying the Layout Model• There are four report regions: Margin, Body, Header, and Trailer.

• You can create multipanel reports, by modifying the logical panel properties ofthe report.

• You can use the tool palette to create standard drawing objects and reportobjects. The tool palette also provides some useful editing tools such as theFrame Select tool.

• You can create many additional layouts in the same report, using the AdditionalDefault Layout tool.

Example ReportsIn this lesson, we discussed solutions to the following report requirements:

• Create variable length lines.

• Display a multimedia file from a button.

• Suppress conditional space with an explicit anchor.

Page 336: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-30 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

10-17 Copyright Oracle Corporation, 1997. All rights reserved.

Practice 10 Overview

• Adding header and trailer pages

• Adding a button to display a multimediacolumn

• Adding a repeating frame to the headerpage

• Adding flexible lines

• Anchoring a boilerplate object to anouter frame

Page 337: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-31......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 10

Practice Session Overview: Lesson 10This practice session contains:

• Opening an existing report to add header and trailer pages

• Modifying an existing report to add a button to display a multimedia column

• Modifying an existing report to add a repeating frame to the header pagedisplaying order information

• Opening an existing report and adding flexible lines

• Modifying an existing report to anchor a boilerplate object to an outer frame

IntroductionIn this practice session you use reports created in earlier practice sessions. The aimis to familiarize you with the different layout regions of a report. You also addflexible lines to a frame and anchor one object to another.

Page 338: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-32 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Practice Session: Lesson 101 Open report p9q4.rdf. Modify the report as follows:

a Create a header page.Display thesummitlo.tif file as fixed boilerplate.Add a rectangle boilerplate object. Give it fill colorPlace the logo on top of the rectangle. Center the two objects.Hint: Use the Arrange option from the menu.

b Add a report title.Use font Arial, size 18 bold.

c Add a trailer page which displays today’s date with the text “End ofreport run on: ”. Choose a larger font.Hint: Copy and paste the date from the Margin Area of the report.

d Run and test the report.

e Save the report asp10q1.rdfand close it.

2 Open report p9q3.rdfand modify it to display the product picture in a separatewindow.

a Delete field F_PICTURE from the body of the Layout Model (notthe column from the Data Model!).

b Add a button to display the picture from the multimedia column.Give it a meaningful label.

c Resize the other layout fields to 1/4 inch in height.Hint: Use the Arrange option in the menu.

d Make the button the same size.Hint: Use the Arrange option in the menu.

e Give all fields and the button the same vertical alignment.Hint: Use the Arrange option in the menu.

f Resize the repeating frame and all enclosing frame to be just largeenough to fit the fields inside.Hint: Think of the Flex Mode.

g Save the report asp10q2.rdfand close it.h Run and test your report. Run the.rdf file from the Reports Runtime,

do not use the Live Previewer!

Page 339: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 10-33......................................................................................................................................................

......................................................................................................................................................Practice Session: Lesson 10

3 Open report p9q1.rdf.

a Add a header page to list all orders and order dates contained in thereport.Hint: Use the additional default layout feature for this.

b Save the report asp10q3.rdf and close it.4 Open report p5q3.rdf.

a Use the Report wizard to givelast_nameandfirst_namea width of 6.(You can also do it directly in the Layout Model or from the LivePreviewer.)

b Add flexible lines vertically between the fields.

c Run and test the report.

d Save the report asp10q4.rdf.

If You Have Time5 Continue with reportp10q4.rdf.

a Add boilerplate and anchor it to half way down the right side of thereport group frame.Hint: To ensure that you get the right frame, select the frameM_G_LAST_NAME_GRPFR. You can use either the ObjectNavigator or theSelect Parent Frametool. Pull the frame out slightlyto the right. After you have fastened your anchor you can make itsmaller again.

b Run and check that the text is in fact halfway down the data output.

c Rerun the report, this time only displaying 10 rows. The boilerplateshould still be halfway down the data output.

d Save the report asp10q5.rdfand close it.

Page 340: Developer 2000 - Build Reports Volume 1 Instructor Guide

10-34 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 10: Enhancing Reports Using the Layout Model

Page 341: Developer 2000 - Build Reports Volume 1 Instructor Guide

................................

11

Modifying Properties

Page 342: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-2 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteTopic TimingLecture 30 minutes

Practice 30 minutes

Total 60 minutes

11-2 Copyright Oracle Corporation, 1998. All rights reserved.

Objectives

At the end of this lesson, you should beable to

• Create a link file.

• Modify common layout properties

• Modify specific layout properties

Page 343: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-3......................................................................................................................................................

......................................................................................................................................................Overview

Overview

IntroductionAll Report Builder objects have properties that provide default settings, which inmany cases are suitable for your report. However, you can modify these propertyvalues, for example to change the pagination of objects in the report output.

In this lesson you learn how to reference the contents of a file at run time, andcontrol the placement and pagination of this and other objects in the report outputby modifying the object properties.

ObjectivesAt the end of this lesson, you should be able to:

• Display the contents of a file in the report layout.

• Modify layout properties common to all types of object.

• Modify layout properties specific to one type of object.

Page 344: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-4 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteRemind students of the exploding layer view of a tabular report (covered in theprevious lesson). Verify object name before modifying the properties.

11-3 Copyright Oracle Corporation, 1998. All rights reserved.

Accessing a property palette

• Object Navigator

– Select object

– Double-click on node icon

• Live Previewer or Layout editor

– Use Select Parent Frame tool

– Choose Tools >Property Palette

Selecting an Object in LowerLayers

abc

11-4 Copyright Oracle Corporation, 1998. All rights reserved.

Comparing PropertiesIntersection Freeze

Page 345: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-5......................................................................................................................................................

......................................................................................................................................................Modifying Layout Object Properties

Modifying Layout Object Properties

IntroductionYou have already seen that you can access the property palette for any object inseveral different ways. For layout objects, you can access the same properties bychoosing the object in one of the following windows:

• Object Navigator

• Layout Model

• Live Previewer

Selecting an Object in Lower LayersSince there are several layers in even a simple report, it is difficult sometimes toselect the correct object in the Layout Model or Live Previewer, when other objectsoverlay the object you want.

• Using the Object Navigator

- Choose the object directly in the Object Navigator, where you can easily seethe name and type of object.

- To open the property palette, choose the node icon to the left of the objectname, or use the right mouse menu.

• Using the Select Parent Frame Tool

- Choose the top-most object in the Layout Model or Live Previewer. ChooseSelect Parent Frame to select the enclosing object on the layer below. Forexample: select a field; choose Select Parent Frame to select the repeatingframe; choose Select Parent Frame again to select the group frame.

- To open the property palette, choose Tools—>Property Palette or use theObject Navigator.

Do not double-click on the object in the Live Previewer, since you will probablyselect the wrong object, on the top layer.

Comparing Properties of Two Objects1 Select one or multiple objects and open the property palette.

Note: Selecting multiple objects results in anintersectionof properties.

2 Choose the Pin tool to “freeze” the property palette.

3 Select the second object and open the property palette.

4 Reposition the property palettes to view them side-by-side.

Page 346: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-6 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteIn Release 2.0, the Link File tool is only available in the Layout Model.

In Release 2.1, the Link File tool is available in the Live Previewer, as well as in theLayout Model.

11-5 Copyright Oracle Corporation, 1998. All rights reserved.

Displaying File Contents

Page 347: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-7......................................................................................................................................................

......................................................................................................................................................Displaying File Contents with a Link File

Displaying File Contents with a Link File

IntroductionThere is a special type of boilerplate object, a link file, that does not have to remainconstant for each report run.

A link file allows you to create an “external” boilerplate object that displays thecontents of a file.

Link File PropertiesThe specific properties for this type of object are as follows:

You can see the full list and descriptions of valid image formats underFile—>Import—>Image.

In character-mode reports, Text is the only valid format.

Steps to Create a Link File Object1 In the Layout Model toolbar, choose the Link File tool. Drag an area in the

layout, to create a link file object of the required size.

2 In the property palette, change the name of the object.

3 Enter the name of the link file that you want to include in the output, and theformat of the file.

Property Name DescriptionSource File Format The type of file contents; contents can be Text, Image, CGM,

Oracle Drawing Format, or Image URLSource Filename The name of the file that you wish to link to the report

Page 348: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-8 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

11-6 Copyright Oracle Corporation, 1998. All rights reserved.

When Are Contents Updated?

Report Builder reads the file contentswhen you:

• Modify property palette.

• Open report definition.

• Run report.

11-7 Copyright Oracle Corporation, 1998. All rights reserved.

1

Linking and Importing Files

2Import

Link

3 4

Page 349: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-9......................................................................................................................................................

......................................................................................................................................................Displaying File Contents with a Link File

When Are the Contents Updated?Developer/2000 picks up the contents of a link file at run time, therefore the filecontents can change dynamically for each report run.

The link file object automatically redisplays the current contents of the file whenyou:

• Modify the source filename in the property palette.

• Open the report (in Report Builder).

• Run the report.

Note: the file must exist at run time, otherwise the report fails with an errormessage.

How to Choose Between Linking and Importing File ContentsIf the contents of a file might change, and especially if you want to use the samecontents in many reports, use a link file so that the contents are includeddynamically at runtime.

If the file contents are unlikely to change often, you can import the contents.

Note: An imported image is stored in the report definition file, and thereforeincreases the size of the file. However, the report runs faster if the image isimported, rather than linked to a file.

Page 350: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-10 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

1 The layout field F_Picture depends on its source columnPICTURE in the Data Model. The filename, and therefore the pic-ture, can be different for each record.

2 Link File exists as a layout object only. The same picture repeatsfor each record.

11-8 Copyright Oracle Corporation, 1998. All rights reserved.

Comparing a Link File and FileColumn

F_PICTURE

1

2

G_EMP

PICTURE

Q_EMP

Page 351: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-11......................................................................................................................................................

......................................................................................................................................................Displaying File Contents with a Link File

Comparing a Link File and a File ColumnThe main difference in creating a link file and a file column is that you create a linkfile in the Layout Model, whereas you create a file column in the Data Model.

The table below shows the differences between a link file and a file column.

A Link File A File ColumnIs an explicit boilerplate object. Is a database column.Represents one file only. Represents a different value for each record.Displays the same file contents for everyoccurrence of a repeating frame.

Can display different file contents for eachrecord.

Exists in the Layout Model. Exists in the Data Model and is the source ofa layout field.

Is a layout boilerplate object that displays thefile contents in the Layout editorduring development.

Sources a layout field that does not displaythe file contents in the Layout editorduring development. You see the field nameonly.

Page 352: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-12 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

11-9 Copyright Oracle Corporation, 1998. All rights reserved.

Layout Object PropertiesFour objects with common properties:

• Frame

• Repeating Frame

• Field

• Boilerplate

Some common properties affect:

• Sizing

• Pagination

• Frequency of display

Page 353: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-13......................................................................................................................................................

......................................................................................................................................................Modifying Common Layout Properties

Modifying Common Layout Properties

IntroductionMost layout objects share a number of common properties. This section explains howto use these common properties.

The Four Layout Objects That Have Common Properties• Frames

• Repeating Frames

• Fields

• Boilerplate Objects

Some Common Properties• Sizing: Horizontal and Vertical Elasticity

• Pagination: Page Break Before, Page Break After, Page Protect, and Keep withAnchoring Object

• Frequency of Display: Print Object On, and Base Printing On

Page 354: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-14 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteThere is a demonstration report to illustrate the next slide (Layout ObjectRelationships) and page breaks. The file isL11ANC1.RDF.

Use this to remind students of the differences between explicit and implicit anchors.You can also show the anchor icons in the Object Navigator if you want.

Continue using this file to show the effect of the pagination options that follow:Page Break Before and After.

Suggestion: In the preferences, go to Runtime Settings and ensure Run Debug isenabled, so that you see the warning message when Page Break After has no effect.

11-10 Copyright Oracle Corporation, 1998. All rights reserved.

Sizing Objects

ElasticityLayout icons

Vertical Horizontal

fixed

expand

contract

variable

Page 355: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-15......................................................................................................................................................

......................................................................................................................................................Sizing Objects

Sizing Objects

IntroductionYou can create objects of any size in the Layout Model. The elasticity propertiesallow you to specify whether the object can change size at runtime.

The Four Types of Object Elasticity

How Wizard Report Styles Affect ElasticityFrames: The wizard sets the elasticity of enclosing objects, such as a group frame,to allow for multiple occurrences of a repeating frame.

Fields: When you reduce the size of a character field in the labels tab, the wizardsometimes, depending on the report style, alters the vertical elasticity of the field toallow for additional characters.

Elasticity Output Object SizeFixed Identical to layout object sizeExpand Can be larger than layout, but not smallerContract Can be smaller than layout, but not largerVariable Can be larger or smaller than layout

Layout Style Horizontal Elasticity Vertical ElasticityTabular Fixed ExpandGroup Above Fixed ExpandForm Fixed ExpandForm Letter n/a n/aMailing Label n/a n/a

Page 356: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-16 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteRemind students of anchors. Ask questions to determine how well they understandor remember. Use these questions before or instead of this slide, for example: Whatdo we mean by push path?

Draw a diagram, include all or some of the suggested objects:Draw a field, F_1, enclosed in repeating frame R_1 (down direction, fixed size),enclosed in a frame M_1 (draw diamonds to show variable size).Add an object (B_1) below the repeating frame, but inside the group frame.Add an object (B_2) to the right of the repeating frame.Add an object (B_3) below the group frame.

To which object is the field related? repeating frame, enclosing object)To which object is the repeating frame related? (group frm, enclosing obj)To which object is B_1 related? (the repeating frame, implicit anchor)To which object is B_2 related? (the group frame, enclosing object)To which object is B_3 related? (the group frame, implicit anchor)Remind them they can create an explicit anchor to override the defaults.

1 No relationship, no anchor

2 Explicit anchor to enforce relationship

3 Implicit anchor because object is in the push path of a frame

11-11 Copyright Oracle Corporation, 1998. All rights reserved.

Layout Object Relationships

1 2

3

Page 357: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-17......................................................................................................................................................

......................................................................................................................................................Layout Object Relationships

Layout Object Relationships

IntroductionTo understand how the pagination properties work, you must remember that allobjects in the Layout Model are related in a hierarchical structure.

In a previous lesson you learned that the relationship depends on anchors, eitherexplicit or implicit. Each object is anchored either to the logical page or to anotherobject.

We can use this hierarchical relationship to control the display of related objects, forexample if we want to force a page break between related objects, or keep relatedobjects together on a page.

More About the Push PathBy default, Report Builder implicitly anchors each object to its immediate enclosingobject. However, sometimes Report Builder must alter the implicit anchor, to ensurethat objects do not overlap at runtime when their size is not fixed.

Report Builder uses an implicit anchoring algorithm to determine whether an objectlies in thepush path of another object.

Page 358: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-18 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

11-12 Copyright Oracle Corporation, 1998. All rights reserved.

Pagination Icons in the Layout

Page 359: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-19......................................................................................................................................................

......................................................................................................................................................Layout Object Relationships

The Four Pagination PropertiesThe four common properties that affect whether and where additional page breaksoccur in your report are:

• Page Break Before

• Page Break After

• Page Protect

• Keep with Anchoring Object (Advanced Layout)

Seeing Pagination Settings in the Layout ModelThe Layout Model displays icons representing each of the properties when they areset to Yes (this is the default).

These icons are very useful, especially for maintenance and support.

However, you can suppress these and other icons in the Layout Model options:

1 Choose Format—>Layout Options—>Layout Model.

2 Choose the Options tab.

3 Select or clear the options as required.

Page 360: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-20 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteExplain Example 1: the image is to the side of repeating frame, not in the push path,therefore not related: Page Break Before forces the repeating frame to the secondpage, but the image remains on the first page.

Ask how they could make the image move to the second page in Example 1. (Createan explicit anchor from image to repeating frame, so that the image waits for therepeating frame to be formatted.)

In Example 2, the image is implicitly anchored because it is in the push path of therepeating frame.

Point out that the Page Break Before happens before the first instance only of therepeating frame, not between each instance.

If they ask how to do it, we discuss the property, Maximum Records per Page, laterin this lesson.

1 Image is not related to repeating frame

2 Image is in the push path of, and implicitly related to the repeatingframe

11-13 Copyright Oracle Corporation, 1998. All rights reserved.

Using Page Break Before

1

xxx xxx

-2-

2

-1-

xxx xxx

-2-

-1-

Page 361: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-21......................................................................................................................................................

......................................................................................................................................................Layout Object Relationships

Using Page Break BeforePage Break Before delays the formatting of the current object and its anchored childobjects until the next page. Objects that are not implicitly or explicitly anchored tothe current object do not move to the next page, even if they appear below thecurrent object in the layout.

Note: Remember to use the Navigator options to view implicit and explicit anchorinformation in the Object Navigator. This helps you to understand the relationshipbetween layout objects, and which objects are affected by setting a page break.

ExampleExample 1: the repeating frame and image are not related; therefore, when youselect the Page Break Before check box for the repeating frame, the image does notmove to the next page.

Example 2: the image is below, and in the push path of, the repeating frame,therefore there is an implicit anchor between the repeating frame (parent) and theimage (child). The image formats after the repeating frame, on the same page as therepeating frame.

Note: Setting Page Break Before on a repeating frame gives a page break beforethe first occurrence of the repeating frame only. It does not provide a page breakbetween each record.

Page 362: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-22 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NotePoint out that:

• Page Break After is useful for forcing several child objects onto a new page.

• Page Break Before is useful for forcing one object onto a new page.

For example, if we only want the image to move to a new page, we can set PageBreak Before on the image.

1 Image and rectangle are not related to repeating frame; PageBreak After has no effect

2 Image and rectangle are in the push path of, and are implicitlyrelated to, the repeating frame

11-14 Copyright Oracle Corporation, 1998. All rights reserved.

Using Page Break After

1xxx xxx

2xxx xxx

-2-

-1-

-1-

Page 363: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-23......................................................................................................................................................

......................................................................................................................................................Layout Object Relationships

Using Page Break AfterPage Break After delays only the formatting of those objects that are anchoredeither implicitly or explicitly to the current object.

Use Page Break After when you want to move multiple related objects to a newpage. This is quicker, and easier to maintain, than setting Page Break Before on eachof the individual child objects.

Note: Remember to use the Object Navigator to view implicit and explicit anchorinformation.

ExampleExample 1: the repeating frame and image are not related; therefore, when you setPage Break After to Yes for the repeating frame, the image does not move to thenext page.

Example 2: the image and rectangle are below, and in the push path of, the repeatingframe, therefore there is an implicit anchor between the repeating frame (parent)and the image and rectangle (children). The page break occurs immediately after thelast instance of the repeating frame, and the image and rectangle appear on the newpage.

Note: Setting Page Break After on a repeating frame gives a page break after thelast occurrence of the repeating frame only. It does not provide a page breakbetween each record.

Page 364: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-24 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NotePage Protect is useful to protect a number of objects together on the same page.

Mention Keep with Anchoring Object to keep just two related objects together onthe same page. This property works with implicit and explicit anchors.

11-15 Copyright Oracle Corporation, 1998. All rights reserved.

Using Page Protect

f_dept_id

f_ename

Employee

40xxxxxxxxxxxxxxxx

-1-

41xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

-2-

Page 365: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-25......................................................................................................................................................

......................................................................................................................................................Layout Object Relationships

Using Page ProtectPage Protect indicates whether to keep the entire object and its internal child(enclosed) objects on the same logical page.

Page Protect only applies to the first logical page on which the object normallyformats; Report Builder ignores Page Protect on subsequent pages, to avoid aninfinite loop.

ExampleA particular instance of a master repeating frame might contain so many detailrecords at runtime that it is not possible to display them all on the same page. If so,you can force a page break before the master instance begins.

• To start the master on a new page, set Page Protect to Yes on the masterrepeating frame.

• If there is no suitable frame to protect several objects, create your own frame,enclose the objects in the frame, and set Page Protect on the frame.

Hint: If you create your own frame to protect several objects, give the frame a solidfill, so that you can ensure that you place it at the correct layer of the layout. Theframe must be behind all the objects it encloses.Remember to remove the fill when you are satisfied with the layout.Ensure the frame is variable, expand or contract, depending on the sizing of theobjects it encloses.

Keep with Anchoring ObjectThe Keep with Anchoring Object property is similar to page protect, except that itaffects anchored objects instead of enclosing objects.

It is useful when you want to keep two objects together on the same page.

If there is not enough room to display the child object on the same page as itsparent, Keep with Anchoring Object moves both parent and child objects to a newpage.

Page 366: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-26 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteThe default value for Base Printing On is Enclosing Object, so Print Object On =All Pages, means that Summit Goods prints for all pages of the group frame.

Mention that you do not often need to change Base Printing On to AnchoringObject. It might be necessary in some layouts if the text is explicitly or implicitlyanchored to a parent object and you want to control the printing of the text on thesame pages as its parent object.

Therefore, the combination of options depends on the layout of different reports andobjects.

11-16 Copyright Oracle Corporation, 1998. All rights reserved.

Summit Goods-1-

Controling Print Frequency

Summit Goods

• Print Object On = All Pages

• Base Printing On = Enclosing Object

Summit Goods-2-

Summit Goods-3-

Page 367: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-27......................................................................................................................................................

......................................................................................................................................................Layout Object Relationships

Controlling Print FrequencyTwo related properties, Print Object On and Base Printing On, control how often toprint the object in relation to another object.

Which Page?Print Object On determines on which of the parent’s logical pages the object prints:

Which Parent?Base Printing On determines whether the parent object is to be the Enclosing Object orthe Anchoring Object.

ExampleThe report opposite shows a text title inside the group frame. The output for this frameshows there are several records that span three pages.

When you create a piece of text, the default is that it prints on the First Page only of itsEnclosing Object. In this case the enclosing object is the group frame. You can modifythe properties to choose the pages on which the text prints:

• To print the text on all pages of the group frame: Print Object On = All Pages;Base Printing On = Enclosing Object (default)

Note: If the text is outside all group frames, its parent is the body page itself;therefore, you can use these two properties to display “Continued...” on all but the lastpage, or “...continued” on all but the first page.

There are several restrictions that apply to these settings, if you receive an “invalidsetting error”, look at the explanation and restrictions in the Report Builder HelpTopics.

Print Object on Object prints onAll Pages All logical pages of the parentAll But First PageAll But Last Page

All logical pages except the first or last page

First Page/Last Page The first or last logical page onlyDefault The option that Report Builder chooses; Report Builder resets the

property, using an internal algorithm; use the default setting ifyou have made a mistake and want to return to the report default

Page 368: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-28 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteRemind students that you can easily create page numbers and the current date fromthe Live Previewer; however, creating your own fields provides more control overthe property settings for page numbering.

11-17 Copyright Oracle Corporation, 1998. All rights reserved.

Properties of a Field

• Fields define formatting attributes andlogic

• Wizard creates a field for each column

• You create additional fields in Layouteditor

– Source: Column, Parameter, orSystem Variable

– Format Mask: Standard Oracle formatsymbols

Page 369: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-29......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Field

Modifying Properties of a Field

IntroductionA field is a layout container for a column or a parameter.

A field defines formatting attributes or logic for the data of its related column orparameter.

Fields and Their Relationship to Data Model ObjectsThe Report wizard creates one field for each column and places these fields inside arepeating frame or at report level.

You can create a field in the Layout editor and relate it to a data model column orparameter.

Defining the Source of a FieldThe Source property provides a list of columns of which there are three categories:

• Columns in the Data Model

• Parameters (always listed in upper case)

• System variables such as today’s date, current page number

The datatype of a field depends on its source.

Defining a Format MaskRemember, when you create a page number object in the Live Previewer, ReportBuilder provides sample dates to enable you to pick a format easily.

The format mask property appears in the standard Oracle date format symbols, suchas MM, which displays the number of the month, or Month, which spells out thename of the month in full.

The list provides all the format masks that exist in your preferences. Modify yourpreferences to include the common masks that you use, or enter a different mask inthis property.

Page 370: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-30 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

11-18 Copyright Oracle Corporation, 1998. All rights reserved.

System Variables

Page 371: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-31......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Field

System Variables as the Source of a FieldThe table below lists the variables and describes their display values.

Variable Name DescriptionCurrent Date The operating system date, at run time, after the

Runtime Parameter Form has displayed.Page Number The current page number, based on the

output numbered by logical page.Panel Number The current panel number within the current logical

page.Physical Page Number The current page number based on the

output numbered by physical page.Total Pages The total number of logical pages in the

current report run.Total Panels The total number of panels within a logical page.Total Physical Pages The total number of pages based on the output

numbered by physical page.

Page 372: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-32 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

11-19 Copyright Oracle Corporation, 1998. All rights reserved.

Page NumberingPage 4 of 4

End

Example 1Page 3 of 4

Page 2 of 4Page 1 of 4

ReportTitle

EndPage 1 of 1

Page 2 of 2Page 1 of 2

ReportTitle

Example 2

Page 373: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-33......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Field

Page NumberingWhen a field’s source is one of the system variables for page or panel numbers, youcan define where and how your page numbers are calculated by choosing the PageNumbering property.

Example 1To number all the pages in the body of a report and include trailer pages but excludeheader pages, you would specify:

Example 2To number all pages in the body of a report, excluding header and trailer pages, andto restart the numbering at 1 for each new department record in the repeating frameR_Dept, you would specify:

Note: When resetting page numbers for each record in a repeating frame, ensurethat each record starts on a new page. Use the Maximum Records per Page property;this is a property of the repeating frame that we discuss later in this lesson.

Page Numbering Property ValueInclude BODY, TRAILERStart At 1Increment By 1Reset At Report

Page Numbering Property ValueInclude BODYStart At 1Increment By 1Reset At R_dept

Page 374: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-34 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

11-20 Copyright Oracle Corporation, 1998. All rights reserved.

Valid Source Columns

G_Region

G_Dept

G_Emp

R_Region

R_Dept

R_Emp

F_REPORT

F_1

Page 375: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-35......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Field

Valid Source ColumnsWhen creating new fields, ensure that they exist at the correct level within thereport, otherwise frequency errors occur.

If you create a field in a repeating frame, the column you choose as the source mustbe in the relevant group for the repeating frame or in an ancestor of that group.

In the diagram opposite, the data model shows a three-level hierarchy:

• G_Region is the parent of G_Dept

• G_Dept is the parent G_Emp

The layout shows the three nested repeating frames, R_Region, R_Dept, andR_Emp.

If you create another field in the R_Dept repeating frame, the source column mustcome from either G_Dept or G_Region; a column in G_Emp would be an invalidsource, because values in the G_Emp group occur more often than R_Dept wouldprint.

Report-Level FieldsIf you create a field outside any repeating frame, that is at report level, the sourcecolumn must be a report-level colum, outside all groups in the Data Model.

System columns, such as current date or page numbers, are report-level columns;you can use these in report-level fields, or at any lower level of your report. Forexample, you can display the current date at report level or within a repeating frame.

You often use the Header or Margin regions to display report-level information.

Page 376: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-36 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

11-21 Copyright Oracle Corporation, 1998. All rights reserved.

Properties of a Repeating Frame

Page 377: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-37......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Repeating Frame

Modifying Properties of a Repeating Frame

IntroductionA repeating frame is record-related, and its properties allow you to modify specificattributes associated to the display of the records.

Specific Properties of a Repeating Frame

The most commonly used properties are discussed in more detail on the followingpages

Property Name IndicatesSource Name of the Data Model group that provides

the source data for this repeating frame; youmust source every repeating frame to a validgroup

Print Direction Direction in which records print: either Downor Across, Across/Down, or Down/Across thepage

Maximum Records per Page Maximum number of records that can displayon a single page

Minimum Widow Records Minimum number of records from a groupthat can display at the bottom of a page

Column Mode Whether to maintain the column for eachrecord across multiple pages

Horiz. Space Between FramesVert. Space Between Frames

Spacing between each record, horizontallyand/or vertically

Page 378: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-38 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

.

1 Maximum Records per Page = 1

2 Maximum Records per Page = 2

11-22 Copyright Oracle Corporation, 1998. All rights reserved.

1

Records per Page

-1-

-2-

-3-

2-1-

-2-

Page 379: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-39......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Repeating Frame

Controlling the Number of Records per PageYou can specify the maximum number of records that you wish to display on eachlogical page.

In the repeating frame property palette, choose the Maximum Records per Pageproperty. The value you enter for this property can be any positive, whole number orblank.

If this setting is 0 (zero), Report Builder formats as many records as possible on thelogical page.

ExamplesRecall the Form and Form Letter report styles: Report Builder automatically setsMaximum Records per Page to 1. If you require more than one record on each page,you can modify this property.

In the Group Above report style, Report Builder formats as many records aspossible on a page (Maximum Records per Page is null). Modify this property forthe master repeating frame, to display one master record per page.

Page 380: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-40 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteThe PowerPoint slideshow provides two other slides after this one: MinimumWidow Records and Column Mode.

These are hidden slides. Use them only if you want to, and if you have time.

There is also a demonstration file for Column Mode:L11COL.RDF.

11-23 Copyright Oracle Corporation, 1998. All rights reserved.

Spacing Between RecordsMailing Labels

1

2

Page 381: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-41......................................................................................................................................................

......................................................................................................................................................Modifying Properties of a Repeating Frame

Controlling Spacing Between RecordsThe properties, Horiz. Space Between Frames and Vert. Space Between Framescontrol the amount of space between occurrences of a repeating frame, that is recordspacing.

Horizontal Space Between FramesDefine the amount of space you want between records horizontally across the pageby entering zero or any positive number for this setting.

This setting has no effect if the repeating frame has a print direction of Down.

Vertical Space Between FramesDefine the distance you want between records vertically down the page by enteringzero or any positive number for this setting.

This setting has no effect if the repeating frame has a print direction of Across.

Note: In bitmapped reports, the distance is a whole or part of the unit ofmeasurement, for example .25 (of an inch).In character mode reports, the distance is the number of blank characters(horizontal) or lines (vertical); therefore, you must enter a whole number, forexample 10 (characters).

Page 382: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-42 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Instructor NoteHere is a suggested demonstration to summarize some of the properties discussed inthis lesson. Use this to encourage discussion among students by asking them how toachieve each step:

Use a master-detail report, for example s_dept/s_emp (or you might prefer thesimple example of dept/emp).

Result you want to achieve: Each master is to be atitle page with its details on asubsequent page. The master information must not repeat on the detail pages.

1 Change Maximum Records per Page to 1 (master repeating frame).

2 Page Break Before (detail group frame).

3 Change Print Object on to First Page for all objects in master repeating frame(use shift-select and show how to change the property for several objects at thesame time on one property palette).Point out that an alternative is to create a frame to enclose all these objects andset the property on the frame instead. This method is used in the Carry Overexample in the Practice Session.

4 If you have extra time, create a field for page numbering and reset for eachdepartment (master record).

11-26 Copyright Oracle Corporation, 1998. All rights reserved.

Summary

• Report objects have many properties.

• Modify only if necessary.

• Common properties for most layoutobjects.

• Specific properties for some objects.

• Examples:

– Link file

– Pagination

– Record spacing

Page 383: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-43......................................................................................................................................................

......................................................................................................................................................Summary

SummaryReport objects provide many properties that you can modify in the property palette,to alter the appearance and position of objects in your report output.

You do not have to make many alterations for most standard reporting needs.

• Common properties exist for most layout objects.

• Specific properties exist for individual object types, such as fields and repeatingframes.

This lesson explained how to modify object properties and gave examples of somemore common uses, such as:

• Forcing pagination by setting Page Break Before or Page Break After.

• Controling spacing between records.

Page 384: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-44 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

11-27 Copyright Oracle Corporation, 1998. All rights reserved.

Practice 11 Overview

• Modifying the printing of a mailing labelreport

• Controling the number of records on apage

• Adding a link file to a report

• Ensuring all details of a master print onthe same page

• Creating a page level running sum and acarry over sum

Page 385: Developer 2000 - Build Reports Volume 1 Instructor Guide

Developer/2000: Build Reports 11-45......................................................................................................................................................

......................................................................................................................................................Practice Session Overview: Lesson 11

Practice Session Overview: Lesson 11This practice session contains:

• Modifying the printing of a mailing label report

• Controling the number of records on a page

• Adding a link file to a report

• Ensuring that all details of a master print on the same page

• Creating a page level running sum and a carry over sum

IntroductionModify 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 atruntime.

Page 386: Developer 2000 - Build Reports Volume 1 Instructor Guide

11-46 Developer/2000: Build Reports......................................................................................................................................................

......................................................................................................................................................Lesson 11: Modifying Properties

Practice Session: Lesson 111 Open reportp4q4.rdf.

a Modify the layout so that the mailing labels are two inches wide andone inch high. Use the Arrange option in the menu. Ensure that thecompany names print in alphabetical order across the page.

b Give each label a solid fill.

c Make the boilerplate object 1.8 inches wide and center it horizontallyand vertically in the repeating frame.

d Add spacing between the labels: .25 inch between each column oflabels across the page; .5 inch between each row of labels down thepage.

e Save the report asp11q1.rdf.

2 Continue with reportp11q1.rdf.

a Modify the report so that only six labels print on each page.

b Save the report asp11q2.rdfand close it.

3 Openp9q1.rdf.

a On the operating system, copy the filesummitlo.tif to a filelogo.tif.b Delete the logo in the margin area and create a link file in its place to

display the contents oflogo.tif.

c Run the report.

d On the operating system, copy any other .tif file to logo.tif.

e Rerun your report.

f Save the report asp11q3.rdf.

4 Continue with reportp11q3.rdf.a Ensure that all items of one order are printed on the same page.

b Save the report asp11q4.rdfand close it..