Enhancing Layout and Properties in Report Builder
Enhancing Reports Using the Layout Model*
Viewing and Modifying Objects in Four Report Regions *
Viewing and Modifying the Layout of Report Regions*
Designing Multipanel Reports *
Other Features of the Runtime Previewer*
Defining Multipanel Features for Fields in the Layout Model*
Determining Panel Print Order*
Layout Objects and Their Relationships *
Types of Objects in the Layout Model*
Relationships Between Objects and their Representations*
Modifying Existing Report Layout with Layout Model Tools *
Layout Model Tool General Usage Procedures*
Specific Layout Model Tools and Their Usage*
Separating Tabular Data Columns with Lines *
Creating Buttons to Display Multimedia Objects *
Defining Button Labels in the Property Palette*
Defining Button Behavior in the Property Palette*
Creating Explicit Anchors to Alter Object Positions *
Redefining Anchor Properties with the Property Palette*
Modifying Layout Properties in Reports*
Using Link Files in Reports to Display File Contents *
Using Web Content for Link Files in Reports*
Modifying Layout Properties Common to All Object Types *
The Property Palette, Revisited*
Modifying Layout Properties Specific to One Object Type *
In this chapter, you will cover the following areas of modifying reports using Report Builder:
This chapter comprises the second big set of tasks before you when creating reports using Report Builderthe enhancement of report layout. Report Builder gives you a tool to handle the tasks related to enhancing report layout: the Layout Model. Similar to the Data Model covered in the last chapter, the Layout Model shows you your layouts in a graphical format, where certain symbols represent either data in the report or behaviors Report Builder will assume when generating the pages of the report. There is another tool you will use quite extensively when modifying report layout, and that is the Property Palette. This is because every object in your layout has properties that can be redefined. The content of this chapter comprises about 15 percent of OCP Exam content.
Enhancing Reports Using the Layout Model
In this section, you will cover the following points on enhancing reports using the Layout Model:
Simply putting together the right content for your report isnt enough to complete your modification tasks. You have to know how to perform certain tasks in the Layout Model of your report as well. Until now, you have let the Report Wizard handle your layout tasks for you. In this section, you will cover several key areas of defining your Layout Model view on the report. Your understanding of these areas is key both to your OCP certification and to your performance with modifying report design using the Layout Model view on your report. The Layout Model view on your report allows you to look at your report as graphical representations of its different areasviewing and modifying objects in four report regions. You will cover designing multipanel reports. You will understand the different layout objects and their relationships with other objects in the Layout Model. You will discover processes for modifying an existing report layout with Layout Model tools. You will learn how to separate tabular data columns with lines. You will create buttons to display multimedia objects. Finally, you will also create explicit anchors to alter object positions.
Viewing and Modifying Objects in Four Report Regions
Key to your ability to handle layout issues in your report is your understanding of the usage of the Layout Model view on your reports available in the Report Editor. You can open the Layout Model view on your report from Report Editor in several ways. For example, you can open the Layout Model on your report by clicking on the Layout Model button in the Report Editor (appearing third from the left in that interface window), or by choosing the View | Layout Model menu option from the main menu in Report Builder. You can click on the icon next to the Layout Model node in the Object Navigator for your report as well.
Your Layout Model view consists of several components. Across the top is the toolbar. Within this toolbar are controls designed to help you navigate through different views on your report, such as the Data Model, Layout Model, Parameter Form, and Live Previewer. Also, there are buttons that help you navigate through the different report regions, which will be covered shortly. Below this row of buttons is another row. This second row is called the style bar because it enables you to define text formatting and styles, fonts, and other appearance-related items. The main content of your Layout Model is the report layout, also known as the painting region of your report. Across the top and down the left side of the painting region are rulers. Down the left margin of the Layout Model is another set of buttons called the Tool Palette. You have already used the Tool Palette in your activities on the Data Model. Across the bottom of the window, there is a set of status controls that tell you where your pointer is located on the horizontal and vertical axis of the report and the magnification of the report as it appears in the Editor module.
Viewing and Modifying the Layout of Report Regions
Turn your attention back to the toolbar across the top of the Layout Model view of your report. Four of the tool buttons across the top help you to navigate through the sections or regions of your report. These buttons include the Body, Margin, Header, and Trailer buttons. These buttons correspond to the several areas or regions in each report. You have already identified these areas. To refresh the discussion, they are body, margin, header, and trailer, along with several others available as nodes in the Object Navigator module. For your purposes, however, this discussion focuses only on those four regions that are immediately accessible from within the Layout Model view on your report in Report Editor. Figure 26-1 demonstrates what you will see in the Layout Model for your ALL_TABLES report in Report Editor.
Figure 1: Layout Model view on your reports in Report Editor
Notice in Figure 26-1 there are four buttons on the right side of the top list of command buttons in the Layout Model view interface. These buttons, in order of appearance, are Body, Margin, Header, and Trailer. You can navigate to each region in your report with the use of these buttons. As you navigate through your report in this way, you will notice different formatting options available on your report, catering to the different format needs of each area.
You are free to modify each item in the Layout Model view on your report, so long as you are in the appropriate region. For example, if you are looking at the margin region of your report, you can alter the heading that appears on every page of the report by clicking on that object in the region and making an appropriate modification. However, you cannot make a change to the layout of column data appearing in the body of the report while you have the margin region active in the Layout Model. Instead, you have to click on the appropriate Body button to move to that region. To modify an object in the region of a report, double-click on the object you wish to modify. The Property Palette for that object will then appear, and you can modify any of the properties you wish by clicking on that property and making the change.
Designing Multipanel Reports
Designing multipanel reports requires that you first expand your interpretation of what a report page consists of. Recall in Oracle Reports 2.5 that there are two types of pages to consider: physical pages and logical pages. Logical pages contain data that is returned from the run of your report. In Reports 3.0, the page is referred to as a panel. Logical pages consist of all the data that you may logically place together in your report. For example, you may have a tabular report that has several dozen columns. Although this is usually represented on a single page by "stacking" the column data, if you could stretch the horizontal axis of your page infinitely rightward, you would ultimately wind up with a perfect table, long though it may be. A physical page is how the data winds up looking on that physical piece of paper that gets fed through the printer. Although most of the time your logical page to physical page mapping is one to one, this neednt always be the case.
A multipanel report is the method you will use to represent situations where a logical page of data maps across several physical pages of information. Although a logical page mapping to multiple physical pages cannot be represented in hard copy on one page, you can view the output of such a report using the Runtime Previewer. The scroll bars appearing in the window for this tool allow you to move across the logical page sideways or downward. In addition, you can split the screen to show different physical pages (or panels) on one side of the Runtime Previewer interface while showing another on the other side.
To open the Runtime Previewer view of your report, open the report in Report Editor using the Tools | Report Editor menu bar option. Then, open the Runtime Previewer using the View | Runtime Preview menu option. If you are not connected to your database already, Reports 3.0 will prompt you to do so. Report Builder will process the report and display it in the Runtime Previewer interface. From there, you can scroll through the logical pages of the report or split the screen. In the Runtime Previewer, notice there is a small box appearing over the Up Arrow button in the vertical scroll bar to the right side of the Runtime Previewer interface. If you click and hold on that box, you will notice a thick dotted line appearing across the interface. To split the screen, click and hold that box, and drag it to the left or downward to split the interface vertically or horizontally, respectively. Figure 26-2 shows your activity in progress.
Figure 2: Runtime Previewer interface while splitting screens
Other Features of the Runtime Previewer
So far, primarily the Live Previewer has been covered in the chapter. However, the Runtime Previewer gives you a better representation of the running report. Some of the features Runtime Previewer allows you to use on your report include the buttons you may have embedded into your report. These buttons allow you to do things like view multimedia objects, run PL/SQL functions that call other reports or execute other operations, or use objects that are linked or embedded into your report. You will cover how to create these buttons shortly.
Defining Multipanel Features for Fields in the Layout Model
There are several ways you can specify the output for each field to appear in a multipanel report. These ways are defined as properties for fields in the Layout Model of your report. The property you will be mainly concerned with is the Source property. When you click on that property for one field in your Layout Model, you will notice that several values can be specified for it. A list of those values pertaining to multipanel reports appears below, along with a description of each property and a bit about its usage.
Determining Panel Print Order
The size of the body or margin of your report in logical and physical pages can also be guided with the use of two properties, Logical Horizontal Panels and Logical Vertical Panels, which determine how many horizontal and vertical panels will map to one logical page. The maximum number of panels in either direction a logical page may span is 50. A small note about header and trailer panels is relevant hereboth can be only one logical horizontal panel, or one physical page, wide, while they can span multiple panels downward.
Your report will make it to print at some point or another, meaning that you have to deal with the mapping of logical pages on screen to physical pages in print. This step is accomplished with the use of the Panel Print Order property, which can be set to Across/Down (default) in order to print your logical pages from left to right, then downward onto physical pages. This setting may be used where your logical pages are wide and you are reading them from left to right. The other setting available for the Panel Print Order property is Down/Across, which may be used to print your physical pages down the logical page first, then across. This setting is most useful when your logical panels read downward based on the reports length in that direction.
TIP: There are compelling performance reasons to beware of your use of the Total Pages setting as the definition for the Source property for a field in the report. This performance problem has to do with the fact that Oracle Reports must generate and store all the pages in the report in order to calculate the total number of pages, creating overall performance problems.
Layout Objects and Their Relationships
Everything that appears in a report has an associated layout object that governs its appearance. Your Layout Model view on your report shows you in miniature how your report will appear. Report Builder fills in the objects in the Layout Model with actual data when you run your report. There are several types of layout objects that represent different things in your report. The Layout Model will show you those objects, and will also show you the relationships that exist between them. In both cases, the Layout Model uses symbols and graphical representations. The following lessons will explain those representations to you.
Types of Objects in the Layout Model
Several types of objects exist in the Layout Model. These objects are displayed in the painting region of your Layout Model view on your report. These objects, and an explanation of their use, are given here.
A frame is an object that encloses other objects and prevents the contents from being written over or displaced by other objects in the layout. Your report will already have some frames in it if you used Report Wizard to create the report, and you can add more with tools in the Layout Model view.
A repeating frame is an object that encloses all columns in a group and appears in the report once for each record displayed in that group (i.e., once for each row of data from the database for that group). Your report will already have some frames in it if you used Report Wizard to create the report, and you can add more with tools in the Layout Model view.
A field is a layout object used for each column in your report. Recall from discussion of Report Wizard that you select your fields for display from the columns included in your report. Frames or repeating frames own the fields they surround.
A boilerplate is an item that appears in your report every time the report is run. Items may include column or report header text, graphical images like logos, and that sort of thing. Like fields, boilerplates are owned by the frame or repeating frame surrounding it, or by the region they appear in.
An anchor handles placing a detail layout object in relation to its master. Visually, an anchor is depicted as a line from the detail layout object to the master, with a small box delineating the termination.
TIP: There are certain situations where Report Builder creates implicit anchors between objects when those objects risk being displaced by other objects in the report. Research this topic in the Report Builder online help before taking the OCP exam.
A button is designed to give interface to objects in a report by performing actions like opening and playing sound or video files, or executing PL/SQL blocks designed to launch detail reports. Some buttons are automatically created by Report Builder, such as ones supporting use of sound or video file interfaces.
An OLE2 object is one that conforms to standards for object linking and embedding. Some examples of OLE2 objects include spreadsheets.
A graphics object is a chart or display created in Oracle Graphics, a component of the Developer/2000 suite of application development tools. You can place these objects into your reports using tools provided in the Layout Model.
Relationships Between Objects and their Representations
In addition to displaying objects to represent each data component of your report, the Layout Model also shows several different relationships between your objects in the Layout Model of your report. The capabilities of Report Builders Layout Model have already been hinted at in the definition for anchors. Several different types of graphical representations are used for different Layout Model objects. For example, a frame is represented in the Layout Model as a box surrounding a field representing a database or user-defined column. Other relationships are indicated by different symbols in the Layout Model, and those symbols are indicated in Figure 26-3.
Figure 3: Relationship symbols and their meanings
The following list identifies relationships and representations you may see in Layout Model views on your reports, relating to items pointed out in Figure 26-3. They are described here.
A frame is represented in the Layout Model as a box thinly drawn around another object. Frames surround most objects in the Layout Model of the report.
A repeating frame in the Layout Model is represented as a box thinly drawn. A small arrow is drawn perpendicular to one of the sides of the repeating frame to indicate the direction in which the frame will repeat. The arrow appears on the left side of the frame facing downward if the frame repeats downward. The arrow appears on the top side of the frame facing rightward if the frame repeats across. Combinations of the two are possible as well, and those combinations will be represented with arrows on two sides of the frame. If arrows appear on the left and bottom sides, the frame repeats down/across. If arrows appear on the right and top sides, the frame repeats across/down. Logically, these are the only possibilities.
A matrix cell is represented in the Layout Model view of your report as a box with lines thickly drawn. Matrix cells appear only on matrix reports.
A field is a label for the data that will appear in the content of the report. Fields appear within frames, repeating frames, or matrix cells.
An anchor is an object that keeps one Layout Model objects location in the report rooted with respect to another object. Anchors are represented as lines with a filled-in small box attached to the end of the line.
A page break is represented in the Layout Model as a small sheet with the edge lifting away in the corner. The corner the page lifts away from indicates whether the page break occurs before or after the object. The upper corner lifting away indicates a "before" page break, the lower corner lifting away indicates an "after" page break.
Page protection is represented in the Layout Model as a box with two small ovals appearing in it. A line between the two ovals indicates that the page will be kept with an anchoring object.
Frames may change in size depending on several factors, including the size of data in the field inside the current frame or within frames around it. Expanding size frames are indicated by two lines drawn on the frame. If the frame expands vertically, the two lines are drawn on the upper and lower edges of the frame. If the frame expands horizontally, the two lines are drawn on the left and right edges of the frame.
Frames may change in size depending on several factors, including the size of data in the field inside the current frame or within frames around it. Contracting size frames are indicated by a circle drawn on the frame. If the frame contracts vertically, the circle is drawn on the upper and lower edges of the frame. If the frame expands horizontally, the circle is drawn on the left and right edges of the frame.
Frames may change in size depending on several factors, including the size of data in the field inside the current frame or within frames around it. Variable-size frames are indicated by a diamond drawn on the frame. If the frame contracts vertically, the diamond is drawn on the upper and lower edges of the frame. If the frame expands horizontally, the diamond is drawn on the left and right edges of the frame.
Modifying Existing Report Layout with Layout Model Tools
There are at least 20 different tools available for use in the Layout Model view on your report. These tools are displayed as buttons in the left-hand margin of the display. The tools allow you to do a multitude of different things, such as add buttons, file links, charts, OLE2, and other objects to your report, change formatting, text, background, and other colors, and other things.
Layout Model Tool General Usage Procedures
Use of all the Layout Model tools falls into a general pattern of usage. You have already seen this pattern in specific form in some cases with your use of tools in the Data Model. The next lesson will identify where and when exceptions exist to this general model for usage as well. The general use for these tools is given in the following list of steps:
Specific Layout Model Tools and Their Usage
The following list of bullets identifies those tools and briefly explains their use. To identify the tools shown below, you should move your pointer over the tool button and leave it there until an identifier balloon appears with the name of the button in it. Alternately, Figure 26-4 shows all the different tools in the Layout Model Tool Palette down the left margin of the Layout Model interface and points them out to you. The tools will now be explained.
Frame Select button
Shape Drawing buttons
Repeating Frame button
Link File button
Ole2 Object button
Additional Default Layout button
Text Color Display button
Report Fill button
Report Line button
Report Text Color button
Figure 4: Layout Model buttons and their location
Select and Frame Select Buttons
The arrow that is activated by clicking the Select button allows you to choose an object on the Data Model view for property modification. You use this button by default when you edit reports in the Layout Model. The Frame Select button allows you to choose the frames that surround objects for property modification. These buttons enable you to access and change properties on your other objects in the Layout Model.
Rotate and Resize Buttons
The Rotate button allows you to rotate an object on its axis. The Resize button allows you to alter the size of the object. These buttons allow for movement of objects, and therefore there is little use for the Property Palette in conjunction with your usage of these buttons in the Layout Model view on your report.
The Magnify button allows you to increase the size of the image you are looking at, or decrease it when used in conjunction with the Shift key. Since this is a button used for viewing objects in the Layout Modelnot modifying ityou will not actually use the Property Palette in conjunction with this button, eliminating step 4.
Line and Shape Drawing Buttons
Buttons in this set include the Line, Rounded Rectangle, Rectangle, Ellipse, Arc, Polygon, Polyline, and Freehand buttons. They allow you to draw the shapes or lines identified onto your Layout Model view on the report. The process for creating these objects is a little different from the procedure defined earlier in that after clicking on the Button button to activate in step 2, you actually draw the object on the Layout Model for step 3.
The Text button allows you to create boxes in your Layout Model that display fixed text in the report. This is useful for adding titles, captions, and other text. Use of this button adds the task of actually entering the text you want to appear in the text box after drawing it as part of step 3.
Frame and Repeating Frame Buttons
The Frame and Repeating Frame buttons allow you to create frames or repeating frames on your report Layout Model. A frame is an object that contains a data field, while a repeating frame contains every data field that is part of a group.
Field and Link File Buttons
The Field and Link File buttons allow you to create fields inside of frames or objects that reference and read from files, respectively. Before creating a field, you should draw a frame to contain it using the buttons described earlier for this purpose. Also, to create your link file, you must be sure to identify the filename used in the link file Layout Model object in step 4 when you invoke the Property Palette.
Chart and Button Buttons
The Chart button allows you to create simple charts using the Graphics Builder button. After placing your chart into the report Layout Model, you will use the Chart Wizard to define chart layout and the data source for your chart, as well as actually creating the chart. Alternately, you can create your chart manually using Graphics Builder and tie it into the chart object in your Layout Model using the Property Palette. The Button button allows you to create buttons that appear in your report, allowing you to access a multimedia object like a sound file from within your report.
Anchor and OLE2 Object Button
The Anchor button allows you to create an explicit anchor between a detail item and master item on your report, so that the details dont get displaced from their masters when the report is run. The OLE2 Object button allows you to embed an OLE2 object into your Data or Layout Model.
Additional Default Layout Button
The Additional Default Layout button allows you to create a default layout for one part of your report without overwriting any other part of your report layout. Use of this button is effectively like creating a report within your report, because after you draw the new object in step 3, your step 4 will be actually going through Report Wizard again to create another layout and report contentrather than the general step 4 of modifying properties in the Property Palette.
Text Color Display
Though not actually a button, the text color display is useful as a display that allows you to see the field fill or background color, text color, and line color of these respective items in your report. It is useful for determining if the selected format using the next three buttons is visually balanced.
Report Fill, Line, and Text Color Buttons
The Fill Color, Line Color, and Text Color buttons handle alterations to the background color, line color, and text color of your report. You can see the effects of any change in the report either in the text color display defined above or in the Layout Model for your report itself.
Separating Tabular Data Columns with Lines
In some situations, you may want to create lines that separate your columns into tabular reports in order to visually distinguish the data in each of those columns. To do so, you will use the Line button to create the line in your data model according to the steps defined in the previous discussion. However, your line will be a fixed length according to how you drew it in the Data Model. The real question then becomes how to make the line extend for the depth of the column in the tabular report, however long that column ends up being in your report.
In order to make the line extend to the length of the tabular column, you must first determine which field or column you want the lines extension to be tied to by drawing the line within the frame that contains that field. After doing so, you double-click on the line you just drew in order to display the Property Palette for that line. The property that defines how Report Builder should extend the line is called Line Stretch with Frame. Figure 26-5 displays the Property Palette with the options for this property. Initially the Line Stretch with Frame property will most likely be NULL, meaning that the line length is fixed as you drew it in the Layout Model. Click on the property to make a drop-down list box appear to show you how the line can be extended. The options shown in this list are labels that identify the frames through which you drew your line, not the fields within those frames. Thus, the choices you have at this point are directly related to where you drew the line on the Layout Model, so if you dont see the frame you want the line to stretch in relationship with, you will have to redraw the line. Once youve identified the frame you want your line to stretch in relationship with, click on that frame to select it and close the Property Palette. You have now defined a variable-length line that will separate your columns of data.
Figure 5: Line Stretch with Frame Property in the Property Palette
Creating Buttons to Display Multimedia Objects
Recall from the previous section that you can create multimedia reports containing sound, video, and image data appearing along with database columns. But, to do so for sound and video components, you must create a button to handle interfacing with that sound or image data. Creating a button is done as follows. First, click on the Button button, shown in the left margin of the Layout Model view of Report Editor with a rectangular button on it. Then move your pointer to the area of the Layout Model where you want the button to appear. Click on the layout to place your button in the Layout Model view of your report. Figure 26-6 shows your Layout Model with a multimedia button created in it. Once you have created your button, there are two properties you must define about your button: the button label and the button behavior. The following two lessons will help you complete these tasks.
Figure 6: Layout Model with a multimedia button
Defining Button Labels in the Property Palette
The button label is a name or icon that will appear on your button to identify it to the report reader as such. Opening the Property Palette for your button will demonstrate the properties you must change to define your button label. The first property is Label Type, and it appears under the Button Label header. Click on the Label Type property to make a list box appear, and look in that list box to see that your two options are Text and Icon. If you choose Text, you must then enter a name for the label in the Text property appearing below Label Type.
If you choose Icon, you must enter a filename for the icon in the Icon Name property that will substitute for Text under the Label Type property. The name for an icon will have the extension .ico, but you dont need to include that extension when defining the Icon Name property. Report Builder checks to see if the file is in a certain place when you define the icon. That place is the tools/devdem20/bin/icon subdirectory under the Oracle software home directory on Windows platforms. If you are not using an icon file that is already in this location, or if you want to use your own icon file, you must ensure the file is in this directory before associating it with a button, or else when you try to associate it with the button you will receive an error.
TIP: There is supposed to be an environment variable called TK25_ICON or TK30_ICON that allows you to specify what directory Report Builder will search for your icon files, but it appears not to work in Developer/2000 2.0 on Windows 95. There are, however, no problems with this on Windows NT, so you should know about it for the OCP exam.
Defining Button Behavior in the Property Palette
The button behavior determines what happens when the report reader clicks on the button to trigger an event. The first property in the Property Palette you will need to define is the Type property appearing under Button Behavior in the Property Palette. Click on this property and you will see three choices appear for the property: Multimedia File, Multimedia Column, and PL/SQL. If you choose the Multimedia File option for the Type property, you must also define a filename for the Multimedia File property and the type of multimedia file (Image, Sound, or Video) in the Multimedia File Type property. If you choose the Multimedia Column option for the Type property, then you must define a field from your group that stores the multimedia object using the Multimedia Column property as well as the appropriate value for Multimedia File Type, as was covered. The value for this property will be NULL unless you place the button inside a field on the Layout Model view for your report. Finally, if you choose PL/SQL for your Type property, then you must only define the code for the PL/SQL Trigger property appearing in the Property Palette.
Creating Explicit Anchors to Alter Object Positions
Recall that anchors allow you to link two different items in your Layout Model, thereby preventing them from becoming displaced from one another. This feature is useful for tying master/detail records together. Since an anchor overrides the default formatting Oracle Reports will use in placing your data on the page of the report, you can use anchors to alter object positions. To create an anchor between a detail object and its master, first click on the Anchor button to activate that tool in the Layout Model of your report. An anchor has two ends, the originating end and the anchoring or terminating end, so your next task is to set the originating end for your anchor by positioning your pointer to the upper edge of the frame surrounding the detail field you want to anchor to a master. Click and hold the mouse button while you position the pointer to the lower edge of the frame surrounding the master field you want to anchor the detail to and release the mouse button youve been holding. A line will appear between the two fields. Finally, without disturbing the pointer, double-click on the anchoring or terminating end of the line you just created and a box will appear at the terminating end of your line. Creation of your anchor object is now complete.
TIP: Situations where you might want to anchor information include when you want a logo to appear in a specific area of the report with respect to the report data, or when you want certain data such as a summary field to appear near the single instance of the data it is summarizing.
Redefining Anchor Properties with the Property Palette
The next thing you can do with your anchor is redefine properties for it in the Property Palette. Double-click on the anchor again, and the Property Palette appears for your anchor. Several properties can be modified in the Property Palette for anchors, including the Child Object Name, Child Edge Type, Child Edge Percent, Parent Object Name, Parent Edge Type, Parent Edge Percent, Collapse Horizontally, and Collapse Vertically properties. Each of these properties will be defined. To see how an anchor looks in the Layout Model, refer to Figure 26-7.
Explicit anchor object
Figure 7: Layout Model view of an anchor
Child Object Name
This is the name of the child or detail object being anchored, which is the end of the anchor shown without the white box on the end in Figure 26-7. The value for this property is changed only by creating an anchor from another detail object.
Child Edge Type
This property identifies the edge of the frame around the detail or child object field you are anchoring to a parent or master, and can have the value Top, Bottom, Left, or Right. Click on the property to make a drop-down list box appear, where you can select one of these choices. Doing so actually moves the originating end of the anchor you just created to the edge you selected. This property alters where the detail or child object will appear with respect to its parent.
Child Edge Percent
This property identifies the exact location of the originating end of the anchor on the child or detail object edge in terms of percentage from left to right for top or bottom edges, or top to bottom for left or right edges. If you alter this value, the originating end of the anchor will actually move to the place you specify. This property alters where the detail or child object will appear with respect to its parent.
Parent Object Name
The name of the parent or master object, which is at the terminating edge of the anchor, shown as a white box on the Layout Model view shown in Figure 26-7. Changing this value is possible only by redrawing the anchor.
Parent Edge Type
This property identifies the edge of the frame around the master or parent field to which the anchor is attached. There are four values for this property, Top, Bottom, Left, or Right. Click on the property to make a drop-down list box appear, where you can select one of these choices. Doing so actually moves the originating end of the anchor you just created to the edge you selected. This property alters where the detail or child object will appear with respect to its parent.
Parent Edge Percent
This property identifies the exact location of the terminating end of the anchor on the master or parent object edge in terms of percentage from left to right for top or bottom edges, or top to bottom for left or right edges. If you alter this value, the originating end of the anchor will actually move to the place you specify. This property alters where the detail or child object will appear with respect to its parent.
Something must happen to the child or detail object if the parent does not print. This and the next property handle that situation. Each of these properties can be defined as Yes or No. If this property is defined to be Yes, then the child or detail object will move horizontally into the parents or masters place if the parent or master does not print.
Something must happen to the child or detail object if the parent does not print. This and the previous property handle that situation. Each of these properties can be defined as Yes or No. If this property is defined to be Yes, then the child or detail object will move vertically into the parents or masters place if the parent or master does not print.
Modifying Layout Properties in Reports
In this section, you will cover the following points on modifying layout properties in your reports:
From reading the last section, you should have some idea of the integral nature modifying object properties plays in the overall task of modifying report layout. This section delves more deeply into the task of modifying layout properties. The topics considered are using link files to display file contents, modifying layout properties that are commonly shared by all objects in a report, and modifying layout properties specific to one object type.
Using Link Files in Reports to Display File Contents
Sometimes you may want to display the contents of a file in your report. You have already seen one way to do this by specifying a database or formula column to read its output from file and display those contents in the column of the report. Another approach to this task is to use the Link File tool button to create an object in the Layout Model of the report and associate a file with that object.
TIP: Use link files in situations where the actual content of the file may change frequently and you always want the most current version to appear in the report. If you actually embed or import the file into the report (as an image, for example), you will only have the contents as they appeared at that moment in time.
The first set of steps in this task was covered in the previous section. That process is to create the link file object in the Layout Model of the report by clicking on the Link File tool button, moving the pointer to the appropriate location in your report layout, and drawing the link file object to create it. These items are covered in steps 1-3 in the general model for enhancing reports with the Layout Model Tool Palette. For step 4, the General Layout and Advanced Layout properties simply identify aspects of the link file object as you created it in the Layout Model. Forget them for now. The properties you are concerned about include the Source File Format and Source Filename properties. The options available for specification in Source File Format include Text, Image, CGM, Oracle Drawing Format, and Image URL. Refer back to the explanation of these different file formats relating to their use in the Read from File property in database or formula columns in the Data Model in the last chapter if you have any questions. A link file object is shown as part of your Layout Model for a report in Figure 26-8.
Figure 8: Link files in your Layout Model
The second task defining link files is to identify to Report Builder which file you want to use as the source for this object in your Layout Model. For the Source Filename property, when you click on that property, a button will appear that you will click to select the file you want the link file object to open and read from. The file you specify must correspond to the file format you selected for that property or the report will not behave properly at run time. Recall that this process for defining the filename is different from that used in the Data Model to obtain file contents within database or formula columns.
TIP: The existence of your link file is checked at link file object creation time. If your link file doesnt exist, you will receive an error.
Using Web Content for Link Files in Reports
You can use pages from the Web in your data links as well, and those pages can be either in the regular HTML format or in portable document format, or PDF, which uses a special PDF reader to render your document in its original hard-copy format. There are several additional properties you will need to define within the Property Palette for link files in order to do so. These properties help Report Builder identify whether the document format is HTML or PDF. The following items identify the different properties in the Property Palette you will need to define for link files, and the appropriate values for each. Figure 26-9 also shows the Property Palette you will see for defining link files in your reports.
Figure 9: Property Palette for defining link files
This property accepts identifiers of 26 or fewer characters, numbers, and underscores in length. Once defined, the Hyperlink Destination property acts as a unique identifier for the link file object in the Layout Model of the report. You must specify this property if you intend to reference this object via Web link from other objects.
This property accepts an identifier that appears wherever bookmarks are displayed in your PDF document viewer or master HTML document. This identifier may or may not have ordering or indentation defined for it, using an outline number followed by the pound sign (#) that determines order but does not actually appear as part of the bookmark. If you use outline numbers, be careful about leaving gaps in the numbering of your bookmark items. Significant gaps (i.e., jumping from 1.0 to 2.1.5 in your outline numbering scheme) will cause intermediate entries to be generated automatically with blank bookmark entries for them.
This property defines how the object will behave if clicked on from a PDF viewer. There are two possible values for this property, and they are Use Hyperlink and Launch Application. The option you define for this property determines which of the two following properties will be activated when the object is clicked in a PDF viewer.
This property defines a hyperlink that will be used to reach a link file via URL/Web conventions. You can specify another location in a current document with HTML anchors (#anchor_name), a document on your machine (file:///C|/doc_name), or a Web-based URL (http://www.wherever.net/docname), or combination thereof. To make this property active when the report is shown as a PDF file, you must select Use Hyperlink for the PDF Action property identified earlier.
Application Command Line
This property defines a statement that can be issued from the command line of your local machine running or viewing the report that will be executed when you click on the file link object in the report. To make this property active when the report is shown as a PDF file, you must select Launch Application for the PDF Action property identified earlier.
Modifying Layout Properties Common to All Object Types
The main way to modify layout properties in Report Builder is to use the Property Palette. When developing Layout Model objects one at a time, as you are likely to do, you will find yourself going from one Property Palette view to another to modify the exact property you need to make the report work. This is annoying, especially if you know you have to do something tedious like add comments to every object in the Layout Model. Try to picture it yourself: opening the Property Palette for a Layout Model object, making the change, closing the Property Palette, then opening it again for another object and starting the process again. Asleep yet? Its good that theres another way to quickly modify properties across multiple objects. This method allows you to focus your efforts either on the properties that are common across different objects you selected or on the aggregate collection of all properties for the objects you selected. But, to understand how to do these things, lets take a closer look at the Property Palette and the features of how it works.
The Property Palette, Revisited
One thing the Property Palette allows you to do is to open multiple Layout Model objects. You accomplish this task in the following way. First, you must select the Layout Model objects to be opened within Property Palette by clicking on them while simultaneously pressing the shift or the ctrl key and clicking once on the Layout Model object you wish to display in the Property Palette. After you have completed selection of all the objects in the Layout Model you wish to see, double-click on one of the objects you selected to view within the Layout Model, and the Property Palette will bring all those objects properties up within it.
Within the Property Palette there is a set of buttons that allows you to do many different things. From left to right, the tools you will find along the top of the Property Palette include the Expand and Collapse buttons to help you drill down into the properties in your Property Palette for this object by group. Other tools to the right include the Intersection/Union button and the Freeze/Unfreeze button. The first button is by far the most important in the Property Palette from the perspective of altering properties from multiple objects. This button toggles between allowing you to view the intersection of properties appearing in the objects you selected and the union of those properties. In other words, you can either see the common properties in the Property Palette for all the objects you selected from the Layout Model (the intersection) or all the properties for every object (the union). You will see the intersection of properties when the Intersection/Union button is toggled down, and you will see the union of properties when the button is toggled up.
To make property changes to objects across all object types, you should first select every object you wish to change in the Layout Model, using the shift or ctrl key and clicking on it with the mouse button. This selection of Layout Model objects can be across one particular object type or across all object types. The choice is yours. Once this step is complete, simply click on one of the objects you selected to invoke the Property Palette for all the objects, and set the Intersection/Union button toggled down to view the properties that are common to all objects you selected. Alternately, set the Intersection/Union button toggled up to see all properties for all objects and set them all at once.
Modifying Layout Properties Specific to One Object Type
Sometimes, however, you may want to alter properties that are specific to one object, or to a subset of objects. For example, you may want to modify properties associated with only the Layout Model objects for summary columns. To do so, you would use the same methods as those outlined in the previous discussionnamely, selecting all of the summary column Layout Model objects with the shift or ctrl key and clicking the mouse button, and then double-clicking on one of the objects to open Property Palette for all of those selected. From there, you can alter properties common to all objects selected or all the properties across all objects selected.
You may want only to change properties for one object within the multiple objects you selected, however. You already know how to accomplish this by double-clicking on the individual Layout Model object to open the Property Palette for that object and then modifying the property desired. You may be able to do it with multiple objects selected; however, one of the drawbacks to modifying properties of multiple objects in the Property Palette is that the value for the property is altered for all objects selectedthe antithesis of what youre trying to do.
The best method in this situation is to open the Property Palette for each Layout Model object you want to change properties for one at a time. Though slower to accomplish, you will have more control over the values for properties at the individual object level. Finally, one other alternative you can use when altering individual properties is to open multiple Property Palettes at once to use for comparing properties of one Layout Model object to another. This task is accomplished in the following way. First, you click on the Freeze/Unfreeze button to toggle it to unfreeze mode, where instead of seeing a pin shown lengthwise on the button, you see only the top of its head. This step allows you to open multiple Property Palettes for different Layout Model objects instead of having Property Palette replace the properties it displays every time you click on a new Layout Model object. You can then place the two Property Palettes side by side for easy property comparison across Layout Model objects. Figure 26-10 displays the Property Palette with the Intersection/Union and Freeze/Unfreeze buttons identified.
Figure 10: Property Palette with Intersection/Union and Freeze/Unfreeze buttons
TIP: You can view properties for multiple objects in the Data Model view just as you can in the Layout Model, by pressing shift or ctrl and clicking your mouse on the object and then opening the Property Palette. You can also open multiple Property Palettes for Data Model objects using the Freeze/Unfreeze button.
This chapter covered several areas of enhancing layout and properties of reports in Report Builder. The key subjects in this chapter were using the Layout Model view to enhance report layout, and the intricacies of modifying the properties of a layout object using a combination of the Layout Model view and the Property Palette tool. The information in this chapter goes hand in hand with the content of the last chapter to form the basis of your knowledge of modifying reports. These are crucial areas of understanding in order to pass OCP Exam 5 on building reports. Toward that end, this chapter comprises 15 percent of content on that exam.
The first item covered in the chapter is using the Layout Model view on your report to view and modify layout objects in the four regions of your report. Recall those four regions are the body, margin, header, and trailer region, corresponding to the body or content, top and bottom margins, header page, and trailer page on the report when it appears in hard copy or in the Live Previewer. You can view the contents of the report for that region by clicking on the appropriate region button in the Layout Model view of the Report Editor tool. Once you are in that region, you can then add objects to the layout for that region using the appropriate buttons in the Tool Palette along the left margin of the Report Editor module.
There are many different types of objects in the Layout Model view of your report. These items include frames, repeating frames, fields, boilerplates, anchors, buttons, OLE2 objects, and graphics objects. There is a tool in the Tool Palette on the left margin of the Layout Model view in Report Editor corresponding to each of these objects in the Layout Model of the report.
Each of the objects in the Layout Model has a representation and/or a relationship to the other objects in the model. These representations are made graphically in the Layout Model through the use of outline boxes for matrix cells, frames, and repeating frames. Other representations take the form of labels, such as those for fields. Still other objects are represented as a line connecting another object with a special box on the end, as in the case of anchors. Relationships form between these objects as well, such as those that determine whether the size of a frame is expanding, contracting, or variable. Two lines, a circle, or a diamond on the edges of a frame will identify these relationships, respectively.
The content of the chapter describes those relationships in the database and instructs you on how to create each of them. The general procedure for defining objects in the Layout Model is first clicking on the button in the Tool Palette to allow you to create the object, then creating the object in the Layout Model view, then defining any properties that need to be associated with the object. Some of the tools that appear in the Tool Palette on the Layout Model view include Select Object and Select Frame tools, Rotate and Resize Objects tools, Magnify Report Display tool, Line and Shape Drawing tools, and tools for drawing text objects. Other tools include Frame and Repeating Frame creation tools, Field and Link File creation tools, Chart and Button creation tools, Anchor and OLE2 Object creation tools, additional default layout creation tools, and Background, Line, Text Color tools and Display tools.
After drawing the object onto the Layout Model view of your report, the next task is to set properties for the object appropriately. One of the tasks you may want to accomplish is to separate the tabular data output in a report with lines that extend the length of the column. This is accomplished by drawing a line on the Layout Model view inside the frame for the field whose columnar output you want the line to extend with and then by setting the Line Stretch with Frame property to the object with which the line should extend in relation to on the report.
The chapter covered the concept of logical pages in your reports, and how most of the time the logical pages of your report showing in the Runtime Previewer will map to physical pages on a one-to-one basis. However, you can set it up so that your logical pages of the report will be multipanel, or spread across multiple physical pages. The use of the Logical Horizontal Panels and Logical Vertical Panels properties defines how logical pages will be divided into panels or physical pages printed as output. The Panel Print Order property helps you determine whether the panels are printed across or downward first. Several other aspects of report printing were covered in the chapter as well, so be sure you understand them for the exam.
Creation of buttons to support the view of multimedia objects is covered as well. First, you use the Button tool to create the button object. A button can have a label that is either an icon or a name. After creating the button, you then associate the button with the multimedia file using the Type property and setting it to Multimedia File or Multimedia Column. If you define Type to be Multimedia File, you will also need to set a value for the filename using the Multimedia File property. When Type is defined as Multimedia Column, then you also must define a field from the Layout Model that stores the multimedia object in the report with the Multimedia Column property along with a filename for Multimedia File.
Creating explicit anchors to set placement for an object in a report in direct relation to another object is another topic covered by the chapter. Again, the process of creating the Layout Model object comes firstin this case, the anchor. Then, you define your properties. In this case, those properties include Child Object Name, Child Edge Type, Child Edge Percent, Parent Object Name, Parent Edge Type, Parent Edge Percent, Collapse Horizontally, and Collapse Vertically. Both the Parent Name and Child Name properties cannot be altered. In those others whose values can be changed, the change will affect both the appearance of the anchor in the Layout Model view and the appearance of the two objects anchored together in the report.
The other section covered in the chapter dealt with modification of properties for Layout Model objects in reports. Three main topics of discussion were using link files to display file contents and modifying layout properties in reports both for properties that are common across many object types and for those properties that are unique to a single object. Closely related to this topic is a discussion of showing properties for multiple objects in the Property Palette, along with opening multiple Property Palettes to compare properties for more several objects.
Using link files is helpful in reports when you want to display files in reports. The types of files you can display include text, images, images on the Web, and a few others. The link file is set up in the same way as other objects in the Layout Model, with the creation of the layout object followed by the definition of the properties required. In this case, the properties are Source File Format and Source Filename. Recall from the chapter that the existence of the file you set up as a file link is checked when you create the link file object. Thus, you must ensure that your file exists before creating the link to it in the report. It was covered that your file can exist on the Web as well, and that there are properties you define for setting this up, including Bookmark, PDF Action, Hyperlink, and Application Command Line.
The modification of properties is handled with the Property Palette, as has been explained before. You can view properties for one or several objects using this tool. To open properties for multiple objects, you first have to select multiple objects in the Layout Model by holding the shift or ctrl key and simultaneously clicking on the mouse button, while also pointing to the object you select. Then, when you double-click on one of the objects you selected, the Property Palette opens showing either all the properties for all the objects or only the properties that are common across all objects you identified. You switch between these two views with the Intersection/Union button on the Property Palette. Alternately, you can open multiple Property Palettes, each containing properties for one object, and compare them. This is accomplished with the Freeze/Unfreeze button. Use of both these tools in the Property Palette is described in the chapter.