Previous | Table of Contents | Next

Page 475

CHAPTER 18

Customizing Reports
and Advanced Report
Functions

Oracle Reports 2.5 is a frame-based report writer. There are two kinds of report writers: frame-based and banded. A banded report writer such as Powersoft's Infomaker places fields or database columns in bands, which represent the header, body, and footer of a report. A frame-based report writer gives you much more flexibility because frames correspond to actual groups from the query, not sections of the report. Frames hold all of the fields that are in one group from the query. You can manipulate frames in any number of ways in the layout, whereas bands can be expanded only vertically to fit more fields.

It is also very helpful to use the Object Navigator, discussed in the previous chapter, when creating a layout. The Object Navigator gives you a way to keep track of your objects and be sure that they are in their proper sequence. So, keep the Object Navigator open when creating a layout.n

Page 476

Description of Layout Editor Objects

This discussion is based on the default layout of the employee listing from Chapter 17. The objects will be explained in the order they appear in the Object Navigator, to make it easier to understand the objects' interaction. Take notice in Figure 18.1 that the Object Navigator window expanded to show the layout objects.

FIG. 18.1
Default Layout for
employee listing report,
with expanded Object
Navigator window.


Open the report file from the CD or refer to the preceding figure. Click the outermost frame from the layout editor or select the first frame whose name ends with GRPFR. This is the first object created by the default layout tool described in the previous chapter. This frame gets created every time a repeating frame is created. Its purpose is to group all the objects that belong to a group in the query, therefore it is called a group frame. Any other frames that you create will begin with an M_ and the name will be a number, unless you name!them and they will not end with GRPFR.

The second object is another frame. This frame's name ends with an _HDR. This is a header frame and it contains two other objects: boilerplate text and line. These objects' names start with a B_. The frame's purpose is to group the boilerplate text and line objects to form the column headings for the report. This frame is not necessary, although it is helpful if you want to perform any operations on the header, such as a certain print condition or format trigger. There is also another frame with an _EXP at the end of its name. (This third frame isn't represented here because we did not define any summary columns.) Again, this frame isn't necessary; it's just useful for print conditions and format triggers.

Page 477

The next object is the repeating frame. You can tell repeating frames in two different ways: they always have an arrow on the frame signifying the print direction of the frame, and their names start with an R_. A repeating frame represents a group in the query. There is a one-
to-one relationship. If you have a group, you must have a repeating frame. It is very helpful to name the groups in your query, because when the Default Layout Editor creates the repeating frames it names them the same as the groups. You may have multiple groups in a query in which case the layout will have group frames (GRPFR) and repeating frames inside of other group and repeating frames. The way they are laid out is the uppermost group from the query is the outermost set of frames (group and repeating)and as you move down the query the frames go inside one another. So the last group is the innermost frame.

The last objects are the Field objects. These objects reside inside the repeating frame. Field objects display database columns and formula columns. The Fields' names start with an F_. The fields must be displayed in the repeating frame that corresponds to the group they are in, in the query. This will be stressed a number of times in this chapter because if you are moving objects around in the layout, they sometimes can be moved outside of their correct repeating frame and you get an error when you try to run the report. If you are creating the layout from scratch you have to be very careful that the fields are placed in the correct repeating frames corresponding to the query. That is why it is very helpful to name your groups.

Layout Editor Menu Options

The File, Tools, Window, and Help menus are the same as previously discussed in Chapter 17, in this book.

Edit Menu Options

The Edit menu has standard windows editing options, as shown in the following minitable and Figure 18.2:

Undo Undoes the last change you made.
Cut Cuts a selection to the clipboard.
Copy Copies a select to the clipboard.
Paste Pastes a selection from the clipboard.
Clear Deletes a selection from the layout.
Duplicate Duplicates a selection and keeps all of its properties.
Select All Selects all layout objects.
Search/Replace Searches and replaces text in a PL/SQL editor.
Import and Export Imports and export stext, drawings, or images.
Insert Object Allows you to insert any variety of different objects into the report from Excel spreadsheets to sound files.

Previous | Table of Contents | Next