4.9 Work with the Report Layout

This section provides procedures for creating and modifying objects in your report layout. The procedures are grouped into the following sections:

4.9.1 General Layout Objects

This section provides procedures for the following tasks that you may perform as you work with container objects:

4.9.1.1 Creating a field object

To create a field object manually in the report layout:

  1. In the Paper Design view, Paper Layout view, or Paper Parameter Form view, click the Field tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the new field object.

  4. In the Property Inspector, under the Field node, set the Source property to the column or parameter that will provide the value for the field.

  5. Set other properties as desired.

See also

Section 1.8.4, "About fields"

Section 1.9.2, "About Parameter Form fields"

4.9.1.2 Creating a frame or repeating frame

To create a frame or repeating frame manually:

  1. In the Paper Layout view, click the Frame tool or the Repeating Frame tool in the tool palette.

  2. Click and drag a rectangle.

    Note:

    The size of the rectangle must be large enough to include the objects that it will contain.

  3. Double-click the new frame object.

  4. In the Property Inspector, set the desired properties.

See also

Section 1.8.1, "About frames"

Section 1.8.2, "About repeating frames"

Section 1.8.3, "About frame and repeating frame sizing"

4.9.1.3 Creating a matrix object

Note:

This procedure provides steps to create a matrix object manually. The recommended method for creating a matrix object is to use the Report Block Wizard (choose Insert > Report Block in the Paper Layout view).

To create a matrix object:

  1. In the Paper Layout view, click the Repeating Frame tool in the tool palette, then drag a rectangle to create a repeating frame.

  2. In the Property Inspector, under Repeating Frame, set the Source property to the "column" for the matrix, and set the Print Direction property to Down.

  3. Click the Repeating Frame tool in the tool palette again, then drag a rectangle to create a second repeating frame, intersecting the first repeating frame.

  4. In the Property Inspector, under Repeating Frame, set the Source property to the "row" for the matrix, and set the Print Direction property to Across.

  5. Drag a rectangle around both repeating frames to select them, then choose Insert > Layout Matrix.

    This creates a matrix object that is the intersection of the two repeating frames. For example:

    Figure 4-1 Example matrix object

    Shows two intersecting rectangles
    Description of "Figure 4-1 Example matrix object"

  6. Double-click the matrix object to set its properties.

See also

Section 2.3.7, "About matrix objects"

Section 1.3.7, "About matrix reports"

Section 2.1.7, "About nested matrix reports"

Section 2.1.8, "About matrix with group reports"

Section 4.8.8, "Creating a matrix (cross-product) group"

Section 4.5.3, "Creating a nested matrix report"

4.9.1.4 Creating a barcode using a barcode font

Note:

Beginning with Oracle9i Reports, Release 2 (9.0.2), you can use a barcode JavaBean that automatically generates the barcode for you. See the example report in Chapter 43, "Building a Report with a Barcode".

To create a barcode using a barcode font:

  1. Install a barcode font on your machine (for example, on Windows, install the barcode font in the Windows Control Panel Font). Barcode fonts are available from most computer stores.

    Note:

    For portability between platforms, you can use a PostScript barcode font to allow you to print your report to any PostScript-enabled output device.

  2. Create a query that selects a column from the database containing the numbers for the barcodes you want included in your report.

  3. In the Paper Layout view, click the barcode field, and choose Format > Font to apply the barcode font to the field.

4.9.1.5 Applying conditional formatting to a layout object

To apply conditional formatting to a layout object:

  1. Click the object, then choose Format > Conditional Formatting.

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. In the Conditional Formatting dialog box, click New to display the Format Exception dialog box.

  3. Specify the conditions and formatting attributes to be applied when the condition(s) evaluate to TRUE.

  4. Click OK.

Usage notes

  • For more complex conditional formatting, you can define conditions against an object using a PL/SQL format trigger in the PL/SQL Editor.

See also

Section 2.1.6, "About conditional formatting"

Chapter 4, "Highlighting a value"

Chapter 4, "Highlighting a row"

4.9.2 Text Objects

This section provides procedures for the following tasks that you may perform as you work with text objects:

4.9.2.1 Creating a boilerplate object for text

To create a boilerplate object for text:

  1. In the Paper Design view, Paper Layout view or Paper Parameter Form view, click the Text tool in the tool palette.

  2. Click and drag a rectangle.

  3. In the new boilerplate object, type the desired text.

    The text you type is composed of paragraphs which are separated by new lines. Text within a paragraph is word-wrapped inside the boilerplate object's horizontal size.

  4. Click outside the boilerplate text object.

See also

Section 1.8.5, "About boilerplate objects"

4.9.2.2 Creating a boilerplate object for text that displays every other page

To create a boilerplate object for text that displays every other page:

  1. Create a boilerplate text object where you want it to appear on the page, either in the margin, or in a repeating frame (expand the repeating frame to make room for the boilerplate text, below the fields in the repeating frame).

  2. Double-click the boilerplate text object to display the Property Inspector. Under the Advanced Layout node, set the Format Trigger property by typing the following code in the PL/SQL Editor:

    function XXX_HDRFormatTrigger return boolean is page_num number; 
    begin 
      srw.get_page_num(page_num); 
      if mod(page_num, 2) = 0 then 
        return(false); 
      else 
        return (true); 
      end if; 
    end; 
    
  3. Run the report to see the boilerplate text appear every other page.

See also

Section 1.8.5, "About boilerplate objects"

4.9.2.3 Creating a boilerplate text object for HTML tags

Note:

This procedure applies to paper-based reports.

To create a boilerplate text object for HTML tags:

  1. In the Paper Design view, click the Text tool in the tool palette.

  2. Click and drag a rectangle.

  3. In the new boilerplate object, type the desired HTML.

  4. Click outside the boilerplate text object.

  5. Double-click the boilerplate text object (or right-click the object, and choose Property Inspector).

  6. In the Property Inspector, under the Web Settings node, set the Contains HTML Tags property to Yes.

Usage notes

When the text object's Contains HTML Tags property is set to Yes, HTML tags and attributes are formatted in your report output as follows:

  • If the report is generated to HTML or HTMLCSS output, all HTML tags and attributes are interpreted and formatted in the output.

  • If the report is generated to other bitmap output formats (for example, PDF, RTF, PostScript), a fixed set of HTML tags and attributes are interpreted and formatted in the output, as described in Section 2.8.9, "About HTML formatting". Any HTML not in the supported set of tags and attributes are not interpreted, and appear as is in the report output.

Example 1: Turning formatting on and off

Consider a text boilerplate object that is defined as follows:

<i><b>Design time format</b> is merged with <span style="font-family:Arial;
color:#00F">run time formatting instructions.</span></i>

With its Contains HTML Tags property set to Yes, this will format as:

Design time format is merged with run time formatting instructions.

With its Contains HTML Tags property set to No, this will format in the report output as:

<i><b>Design time format</b> is merged with <span style="font-family:Arial; color:#00F">run time formatting instructions.</span></i>

Example 2: Boilerplate text object tagged as a hyperlink

In a boilerplate text object, you can type the following text:

<a href=http://your_webserver/reports/my_report.html><img src=oracle.gif> </a>

With the Contains HTML tags property set to Yes, this object will appear in HTML/HTMLCSS report output as a graphic (oracle.gif) , which the end user can click to link to my_report.html.

Example 3: Parameter values output to HTML

In a boilerplate text object, you can type the following Java Applet, called NervousText.class, which takes the object width and height as parameters:

<base href=http://cagney.uk.oracle.com/java/NervousText/>
<applet code="NervousText.class" width=&ObjectWidth height=&ObjectHeight>
<param name=text value="&deptno">
</applet>

With the Contains HTML tags property set to Yes, this object will be interpreted with the parameters replaced with their actual values, as follows:

<base href=http://cagney.uk.oracle.com/java/NervousText/>
<applet code="NervousText.class" width=84 height=72>
<param name=text value="10">
</applet>

See also

Section 1.8.5, "About boilerplate objects"

Section 2.5.1, "About Parameter Form HTML extensions"

4.9.2.4 Editing text

To insert and replace text:

  1. In the Paper Design view, Paper Layout view, or Paper Parameter Form view, single-click the text object.

  2. Click the text to change to edit mode.

  3. Modify the text as desired, then click outside the text object.

To delete text:

  1. In the Paper Design view, Paper Layout view, or Paper Parameter Form view, single-click the text object.

  2. To cut all the text, choose Edit > Delete.

To cut, copy, or paste text:

  1. In the Paper Layout view or Parameter Form view, single-click the text object.

  2. Click and drag to mark the text you want to cut or copy, then choose Edit > Cut or Edit > Copy.

  3. To paste text, choose Edit > Paste.

4.9.2.5 Referencing a field in boilerplate text

To reference a field in boilerplate text:

  1. In the Paper Design view or Paper Layout view, click in the boilerplate text where you want the reference to a field to appear.

  2. Type an ampersand (&) followed by the name of the field.

    If you want to place the field reference in front of other text with no spaces in between, enclose the field name in angle brackets to separate it from the text (for example, &<fieldname>Oracle). If the field reference follows other text, no angle brackets are needed (for example, Oracle&fieldname). You can include field references right next to each other with no spaces in between and without angle brackets (for example, &field1&field2&field3).

Usage notes

  • A reference to a field includes the field's properties. Therefore, if the Horizontal Elasticity property is set to Fixed, any extra spaces in the field will appear in the report output. For example, if field f_sal is fixed horizontally, $&<f_sal>/week may produce $800/week in the report output.

  • In addition to referencing fields in a boilerplate text object, you can directly reference a database column (for example, &SAL). For example, $&<SAL>/week may produce $800/week in the report output.

See also

Section 1.8.4, "About fields"

Section 1.8.5, "About boilerplate objects"

4.9.2.6 Linking a boilerplate text object to a file

Note:

This procedure applies paper-based reports. File Link objects are not implemented in JSP-based Web reports.

To link a boilerplate text object to a file:

  1. In the Paper Design view or Paper Layout view, click the File Link tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the file link object to display the Property Inspector.

  4. Under the File Link Boilerplate node:

    • Set the Source File Format property to Text.

    • Set the Source Filename property to the name of the file containing the text.

See also

Section 1.8.5, "About boilerplate objects"

4.9.2.7 Linking an HTML text object to a file

Note:

This procedure applies to paper-based reports. File Link objects are not implemented in JSP-based Web reports.

To link an HTML object to a file:

  1. In the Paper Design view or Paper Layout view, click the File Link tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the file link object to display the Property Inspector.

  4. Under the File Link Boilerplate node:

    • set the Source File Format property to Text.

    • set the Source Filename property to the name of the file containing the HTML tags.

  5. Under the Web Settings node, set the Contains HTML Tags property to Yes.

Usage notes

When the text object's Contains HTML Tags property is set to Yes, HTML tags and attributes are formatted in your report output as follows:

  • If the report is generated to HTML or HTMLCSS output, all HTML tags and attributes are interpreted and formatted in the output.

  • If the report is generated to other bitmap output formats (for example, PDF, RTF, PostScript), a fixed set of HTML tags and attributes are interpreted and formatted in the output, as described in Section 2.8.9, "About HTML formatting". Any HTML not in the supported set of tags and attributes are not interpreted, and appear as is in the report output.

See also

Section 1.8.5, "About boilerplate objects"

4.9.2.8 Wrapping text in a field

To wrap text in a field:

  1. Choose Tools > Report Wizard.

  2. In the Report Wizard, click the Labels tab.

  3. Change the value in the Width column for the field in which you want to wrap text, as desired.

  4. Click Apply.

    Caution:

    If you have made manual adjustments to your layout in the Paper Layout view or Paper Design view, you will lose these layout changes when you click Apply or Finish in the Report Wizard, which redefaults the layout. If you do not want to overwrite your current layout, you can manually drag the column to the desired width in the Paper Layout view or Paper Design view.

  5. In the Paper Layout view or Parameter Form view, double-click the field to display the Property Inspector, and set the following properties:

    • Under General Layout, verify that the Vertical Elasticity property is set to Expand.

4.9.2.9 Changing text attributes

To change the font, justification, spacing, or reading direction of a text object:

  1. In the Paper Design view, click the text object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. From the Format menu, choose Font, Justify, Text Spacing, or Direction.

4.9.2.10 Changing text attributes using PL/SQL

To change the font or justification of a text object using PL/SQL instead of the user interface:

  1. In the Object Navigator, expand the Paper Layout node.

  2. Double-click the PL/SQL icon next to the text object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  3. In the PL/SQL Editor, use the following built-in procedures to change the font or justification of the object as desired:

    SRW.SET_CHARMODE_TEXT

    SRW.SET_FONT_FACE

    SRW.SET_FONT_STYLE

    SRW.SET_FONT_WEIGHT

    SRW.SET_FONT_SIZE

    SRW.SET_JUSTIFICATION

See also

Topic "SRW built-in package" in the Reference > PL/SQL Reference > Built-in Packages section of the Oracle Reports online Help.

4.9.3 Page Numbers or Date/Time Stamps

This section provides procedures for the following tasks that you may perform as you work with page numbers or date/time stamps:

4.9.3.1 Creating page numbers

To create default page numbers:

  1. In the Paper Layout view or Paper Design view, choose Insert > Page Number.

  2. In the Insert Page Number dialog box, choose from the list the location for the page number.

  3. Click the desired page number format: Page Number Only or Page Number and Total Pages.

  4. Optionally, change the default attributes of the page number text as desired.

To create customized page numbers:

  1. In the Paper Layout view or Paper Design view, click the Edit Margin button in the toolbar.

    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.

  2. Create a field object (see Section 4.9.1.1, "Creating a field object") in the margin area for each page number value you require, for example Physical Page Number, Total Physical Pages.

  3. In the field's Property Inspector, under the Field node, set the Source property to the source for the page number, and set the Visible property to No. Under the General Layout node, set the Horizontal Elasticity property to Variable.

  4. Create a boilerplate text object (see Section 4.9.2.1, "Creating a boilerplate object for text") in the margin area, and reference the page number field(s) (see Section 4.9.2.5, "Referencing a field in boilerplate text") using &fieldname.

Usage notes

  • To generate odd page numbers on the right and even pages numbers on the left, you have to create two fields: one on the right side, one on the left side. In the format trigger of each field, you test if it is an odd or an even page by using SRW.GET_PAGE_NUM. Then, you specify whether or not to display the field.

4.9.3.2 Resetting page numbers

To reset default page numbers (created with Insert > Page Number):

  1. In the Paper Layout view or Paper Design view, click the default page number field, then choose Edit > Delete to delete it.

  2. Create customized page numbers (see Section 4.9.3.1, "Creating page numbers").

  3. In the page number field's Property Inspector, under Field, double-click the Page Numbering property value.

  4. In the Page Numbering dialog box, click the desired Reset At setting. Page numbers will reset to the Start at value each time the selected frame is formatted. Click OK.

4.9.3.3 Creating a time or date stamp

To add a date or time stamp to your report:

  1. In the Paper Layout view or Paper Design view, choose Insert > Date and Time.

  2. In the Insert Date and Time dialog box, choose from the list the location for the date or time stamp.

  3. Click the desired date or time format, or click Custom to define your own format.

4.9.4 Borders

This section provides procedures for the following tasks that you may perform as you work with borders:

4.9.4.1 Showing or hiding object borders

To show or hide the borders around an object:

  1. Click the object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Click the Line color tool in the tool palette.

  3. To add a border, click any color solid square.

  4. To make a border transparent in the report output, click No Line at the bottom of the color palette.

    Note:

    If you make the borders transparent for all the objects, this includes the underlines beneath the column headings. To add the underlines, click the underline objects, and use the Line Color in the tool palette to select a line color.

  5. To show or hide part of the border, choose Format > Line > Border, and select from the menu to toggle between showing and hiding the sides of the border.

4.9.4.2 Changing object border attributes

To change the borders around an object:

  1. Click the object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. To change the line width, choose Format > Line > Line Width.

  3. To select a pattern, choose Format > Line > Dash. Even though it appears in the output, the dash pattern is sometimes obscured by the object's outline. You can choose Tools > Options > Paper Layout and clear the Options:Frame Outlines check box.

  4. To "frame" the border, choose Format > Bevel.

See also

Section 2.4.5, "About changing colors and patterns"

Section 4.12.8, "Modifying the color, pattern, or border of body objects in a template"

4.9.4.3 Changing the current mode (Confine or Flex)

To set or override Confine mode:

  • In the Paper Layout view, click the Confine On button or the Confine Off button in the toolbar to toggle the mode:

    On: child objects cannot be moved outside their enclosing parent objects.

    Off: child objects can be moved outside their enclosing parent objects.

To set or override Flex mode:

  • In the Paper Layout view, click the Flex On button or the Flex Off button in the toolbar to toggle the mode:

    On: parent borders "stretch" when child objects are moved against them. The child object maintains the same distance from the side it moves against.

    Off: parent borders remain fixed when child objects are moved against them.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

Chapter 4, "Adjusting parent borders automatically"

Chapter 4, "Moving an object outside its parent"

4.9.5 Anchors

This section provides procedures for the following tasks that you may perform as you work with anchors:

See also

Section 2.4.4, "About anchors"

4.9.5.1 Anchoring objects together

Anchoring objects assures that the anchored object will move with the parent object. An object can be anchored to only one other object.

To anchor objects together:

  1. In the Paper Layout view, click the Anchor tool in the tool palette.

  2. Click an edge of the child object and double-click an edge of the parent object.

    A line is drawn from the child to the parent. A small box appears at the end of the line that is attached to the parent object.

4.9.5.2 Viewing implicit anchors

By default, you see the explicit anchors created in the Paper Layout view of the Report Editor.

To view information on both implicit and explicit anchors:

  1. In the Object Navigator, choose Tools > Options > Navigator to display the Object Navigator Options dialog box.

  2. Click the Layout tab, and select the Anchoring Information check box.

    With this option selected, you can see all information on both implicit and explicit anchors in the Object Navigator.

    Note:

    By default, objects are anchored to the upper left corner of their enclosing object. If this view of the Object Navigator does not show anchoring information for an object, you can assume that the object is anchored to its enclosing object, which might be the frame or the body.

See also

Section 2.4.4.1, "Implicit anchoring algorithm"

4.9.5.3 Moving an anchor

Moving an anchor changes how the objects will be displayed in relationship to each other.

To move an anchor:

  1. In the Paper Layout view, click the anchor.

  2. Click the Reshape tool in the tool palette, then drag one of the anchor endpoints to its new location on the object edge.

To move an anchor along an object edge:

  • Press the constrain (for example, shift) key when moving the anchor.

To change the position of the anchor on the object edge, as a percentage down or across from top to bottom or left to right:

  1. Double-click the anchor object to display the Property Inspector.

  2. Set the Child Edge Percent property or Parent Edge Percent property to a new value.

To change the edge on which the anchor is positioned:

  • Set the Child Edge Type property or Parent Edge Type property as desired.

4.9.6 Colors, Patterns, and Highlighting

This section provides procedures for the following tasks that you may perform as you work with colors, patterns, and highlighting:

4.9.6.1 Setting color palette preferences

See Section 4.2.6, "Setting color palette preferences".

4.9.6.2 Changing colors

To change the color of an object or text:

  1. In the Paper Layout view, click the object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Click the Fill Color tool, the Line Color tool, or the Text Color tool in the tool palette, depending on which part of the object you want to apply a color to.

    Note:

    The Fill/Line/Text Display, the box directly above the three Color tools, shows the currently selected fill, border, and text. The default fill and border for objects created by Oracle Reports Builder is transparent, while the default for objects you create is a black, one-point line around a white.

  3. On the color palette, click a color.

See also

Section 2.4.5, "About changing colors and patterns"

Section 4.12.8, "Modifying the color, pattern, or border of body objects in a template"

4.9.6.3 Changing patterns

To change the pattern of an object:

  1. In the Paper Layout view, click the object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Click the Fill Color tool or the Line Color tool in the tool palette, depending on which part of the object you want to apply a pattern to.

    Note:

    The Windows platform does not support a border pattern (that is, patterns for the Line Color tool).

  3. On the color palette, click Patterns.

  4. On the pattern palette, click a pattern. To change the foreground and background colors, choose from the color palettes at the bottom of the pattern palette.

See also

Section 2.4.5, "About changing colors and patterns"

Section 4.12.8, "Modifying the color, pattern, or border of body objects in a template"

Topic "Pattern color palette" in the Reference > Color and Pattern Palettes section of the Oracle Reports online Help.

4.9.6.4 Changing colors and patterns using PL/SQL

To change the color of an object using PL/SQL instead of the user interface:

  1. In the Object Navigator, expand the Paper Layout node.

  2. Double-click the PL/SQL icon next to the object for which you want to change the color.

  3. In the PL/SQL Editor, use the following built-in procedures to change the color of the object as desired:

    SRW.SET_BACKGROUND_BORDER_COLOR

    SRW.SET_BACKGROUND_FILL_COLOR

    SRW.SET_FOREGROUND_BORDER_COLOR

    SRW.SET_FOREGROUND_FILL_COLOR

    SRW.SET_TEXT_COLOR

    SRW.SET_BORDER_PATTERN

See also

Section 2.4.5, "About changing colors and patterns"

Topic "SRW built-in package" in the Reference > PL/SQL Reference > Built-in Packages section of the Oracle Reports online Help.

4.9.6.5 Modifying the color palette

To modify the color palette:

  1. First, make the color palette editable:

    • Choose Edit > Preferences, and set Color Mode to Editable, as described in Section 4.2.6, "Setting color palette preferences".

      Note:

      By default, color palettes are read-only.

    • Shut down and restart Oracle Reports Builder to enable the Editable mode.

  2. In the Paper Layout view, choose Format > Color Palette > Edit.

  3. In the Color Palette dialog box, modify the color palette as desired:

    • Click Edit to alter the settings of the current color.

    • Type a new name in Current Color, then click Rename to rename the current color.

    • Select Color to Edit contains the current color palette being used in the Report Editor for the current report. Select a color from the palette to alter it.

    • Click OK to apply your changes to the current report.

Note:

A report can have only one color palette.

See also

Section 2.4.5, "About changing colors and patterns"

Topics "Oracle CDE1 color palette", "Default color palette", and "Grayscale color palette" in the Reference > Color and Pattern Palettes section of the Oracle Reports online Help.

4.9.6.6 Importing or exporting a color palette

To import or export a color palette:

  1. First, make the color palette editable:

    • Choose Edit > Preferences, and set Color Mode to Editable, as described in Section 4.2.6, "Setting color palette preferences".

      Note:

      By default, color palettes are read-only.

    • Shut down and restart Oracle Reports Builder to enable the Editable mode.

  2. In the Paper Layout view, choose Format > Color Palette > Import or Format > Color Palette > Export.

  3. In the dialog box, specify the name and format of the file.

  4. Click OK.

Note:

A report can have only one color palette.

See also

Section 2.4.5, "About changing colors and patterns"

Topics "Oracle CDE1 color palette", "Default color palette", and "Grayscale color palette" in the Reference > Color and Pattern Palettes section of the Oracle Reports online Help.

4.9.6.7 Highlighting a value

To highlight a value in a report:

  1. In the Paper Layout view or Paper Design view, click the field that contains the value to be highlighted.

  2. Choose Format > Conditional Formatting.

  3. In the Conditional Formatting dialog box, click New to display the Format Exception dialog box.

  4. Select the field and define the condition(s) when the value should be highlighted.

  5. In the Format group box, select the Fill Color to be used to highlight the value.

    Note:

    If you can't select the condition you want to use in the dialog box, select the formatting you want and a placeholder condition. The condition can be edited in the PL/SQL Editor for the format trigger that is created.

  6. Click OK to close the Format Exception dialog box, then click OK again to close the Conditional Formatting dialog box. If the code compiles without errors, the new formatting is reflected in the Paper Layout view. The code is stored as a format trigger for the field.

Example

The following code determines the monthly compensation and changes the background color to red if the compensation has exceeded four thousand dollars a month and the employee is not a manager.

function R_G_EMPNOFormatTrigger return boolean is varcomm number;
begin
 if :comm is null then
   varcomm := 0;
 else
   varcomm := :comm;
 end if;
  if (:sal * 2 + varcomm > 4000) and :job != 'MANAGER' then
   srw.set_background_fill_color('red');
 end if;
 return (TRUE);
end;

See also

Section 2.1.6, "About conditional formatting"

Section 4.9.1.5, "Applying conditional formatting to a layout object"

4.9.6.8 Highlighting a row

To highlight an entire row:

  1. In the Paper Layout view, click the repeating frame that contains the fields that make up the rows to be highlighted.

  2. Choose Format > Conditional Formatting.

  3. In the Conditional Formatting dialog box, click New to display the Format Exception dialog box.

  4. Select the field(s) and define the condition(s) that describe the rows to be highlighted.

  5. In the Format group box, select the Fill Color to be used to highlight the row.

    Note:

    If you can't select the condition you want to use in the dialog box, select the formatting you want and a placeholder condition. The condition can be edited in the PL/SQL Editor for the format trigger that is created.

  6. Click OK to close the Format Exception dialog box, then click OK again to close the Conditional Formatting dialog box. If the code compiles without errors, the new formatting is reflected in the Paper Layout view. The code is stored as a format trigger for the repeating frame.

Example

The following code determines the monthly compensation and changes the background color to red if the compensation has exceeded four thousand dollars a month and the employee is not a manager.

function R_G_EMPNOFormatTrigger return boolean is varcomm number;
begin
if :comm is null then
  varcomm := 0;
else
  varcomm := :comm;
end if;

if (:sal * 2 + varcomm > 4000) and :job != 'MANAGER' then
  srw.set_background_fill_color('red');
end if;
  return (TRUE);
end;

See also

Section 2.1.6, "About conditional formatting"

Section 4.9.1.5, "Applying conditional formatting to a layout object"

4.9.6.9 Alternating row colors

To alternate the colors of either the text or the fill of a row:

4.9.7 Format Masks

This section provides procedures for the following tasks that you may perform as you work with format masks:

4.9.7.1 Specifying date and time format masks

The following tables describe the date and time format masks, and the suffixes you can add to date format masks:

Table 4-2 Date and time format masks

Format Mask Description

SCC or CC

Century, abbreviated; 'S' prefixes "BC" with (-)

SYYYY or YYYY

Year; 'S' prefixes "BC" date with a (-)

I or IY or IYY

Last 1, 2, or 3 digit(s) of year

Y or YY or YYY

Last 1, 2, or 3 digit(s) of year

Y,YYY

Year with comma

SYEAR or YEAR

Year, spelled out; 'S' prefixes "BC" date with (-)

RRRR or SRRRR

Year; 'S' prefixes "BC" date with a (-)

RR

Last 2 digit(s) of year

BC, AD, or B.C., A.D.

Century indicator

Q

Quarter of year (Jan-Mar= Quarter 1)

MM

Month in digits (Jan = 01)

MONTH or MON

Name of month, or 3-letter abbreviation

WW, IW

Week in year

W

Week in Julian days

J

Julian day; the number of days since January 1,4712 BC

DDD, DD, or D

Day in year, month, or week

DAY

Day of week fully spelled out (for example, MONDAY)

DY

Name of day, 3-letter abbreviation (for example, MON)

AM, PM, or A.M., P.M.

Meridian indicator

HH or HH12

Hour of day (1-12)

HH24

Hour of day (0-23)

MI

Minute

SS; SSSSS

Second in minute; seconds in day

FM

Toggles fill mode which replaces multiple spaces before or between dates, numbers, or words with a single space


The following suffixes may be added to the format masks:

Table 4-3 Date format mask suffixes

Suffix Description

TH

Suffixed number ("DDth" for "4th")

SP

Spelled out number ("DDSP" for "FOUR")

SPTH or THSP

Spelled and suffixed number ("DDSPTH" for "FOURTH")


Examples

Table 4-4 Date format mask examples

Sample Date Format Date Displayed

MM/DD/RR

03/04/09

DD MON RRRR

04 MAR 2009

Mon. DD, RRRR

Mar. 4, 2009

Day Month DD fmHH:MI AM

Monday March 4 11:35 AM

Dy Mon ddth fmHH24:MI:SS

Mon Mar 4th 23:35:22

Day "the" ddthsp "of" Month

Monday the fourth of March


4.9.7.2 Specifying number format masks

The following table describes the tokens you can use in creating a number format mask:

Table 4-5 Tokens for number format masks

Format Token Description

0

Prints one digit.

N

Prints one digit, unless it is a leading zero to the left of the decimal point or a trailing zero to the right of the decimal point.

*

Prints one digit, unless it is a leading zero to the left of the decimal point, in which case an asterisk (*) is printed. Trailing zeros to the right of the decimal point are printed.

9

Prints one digit, unless it is a leading zero to the left of the decimal point, in which case a space is printed. Trailing zeros to the right of the decimal point are printed.

+

Prints a leading plus (+) for positive values and a leading minus (-) for negative values. This token must lead the mask.

-

Prints a leading minus (-) for negative values and nothing for positive values. This token must lead the other tokens.

MI

Prints a minus (-) after negative values and a space after positive values. This token must trail the other tokens.

S

Prints a minus (-) for negative values and a plus (+) for positive values (wherever the S appears in the mask). This token must lead or trail the other tokens.

PR

Prints angle brackets (<>) around negative values and spaces around positive values. This token must trail the other tokens.

( )

Prints parentheses around negative values and spaces around positive values. The parentheses must surround the other tokens.

DB

Prints a "DB" after positive values. This token must trail the other tokens.

CR

Prints a "CR" after negative values. This token must trail the other tokens.

Y

Causes no sign symbol to be printed for negative or positive values.

V

Causes the number to be multiplied by 10N, where N is the number of 0, 9, *, and S tokens that appear to the right of the V.

EEEE

Causes the number to be printed in scientific notation. All digit tokens refer to digits of the mantissa. There must be exactly one digit to the left of the decimal point (displayed or implicit). The token EEEE prints as E followed by a plus (+), if the ordinate is positive or zero, and a minus (-), if the ordinate is negative, and two digits representing the ordinate (for example, E-99).

"string"

Prints the string between the double quotes. To have double-quotes inside the string, type double-quotes back to back ("").

. (period)

Prints a period (.) to separate the integral and fractional parts of a number.

D

Prints the local decimal character to separate the integral and fractional parts of a number.

, (comma)

Prints a comma (,) as the group/thousands separator.

G

Prints the local group/thousands separator.

$

Prints $

L

Prints the local currency symbol.

C

Prints the ISO currency symbol.

%

Prints %.

" "

Prints a blank space. (Do not include quotes in mask.)

v

Prints a blank space for all zero values, regardless of other tokens.

K

Prints a blank space.

<>

Delineates the beginning and ending of the decimal-aligned region (that is, that part of the number that you want aligned with the decimal point in the format mask). Angle brackets indicate that the number should always occupy the same amount of space. If necessary, values are padded with blanks to the left or right of the decimal point.

RN, rn

Prints values in uppercase or lowercase Roman numerals, respectively. You cannot enter any other tokens with this token.


Restrictions

  • For number format masks, if the actual value is longer than the specified format mask, the value will appear as a string of asterisks in the report output, regardless of the field's width. For example, if a fixed field's width is 8, the value is 1234567, and the format mask is <NNNNNN>, your output will be *******.

  • Similarly, if the number format mask causes the value to be larger than the field width, asterisks will appear in place of the value. For example, if a fixed field's width is 6, the value is 1234, and the format mask is -99999999, your output will be ******. This occurs because the format token 9 prints a blank for leading zeros to the left of the decimal. As a result, the value is too long to be displayed in a field of width 6.

  • If you do not specify a sign token in the format mask, positive values are preceded by a space and negative values are preceded by a minus (-).

  • After you create a format mask it will display in the list of values only if it is an appropriate format mask for the Datatype of the Source. That is, format masks for numbers are displayed when the Source is a number, and format masks for dates are displayed when the Source is a date.

  • Format masks that print spaces for zeros (for example, 9) increase the number of bytes per page taken up by your output.

Examples

Table 4-6 Number format mask examples

Sample Number Format Number Number Displayed

-0000

7934

"7934"

 

-7934

"-7934"

-00000

7934

"07934"

-NNNN

7639

"7639"

 

535

"535"

-NNN

7639

"****"

-****

7902

"7902"

-*****

7902

"*7902"

+NNNN

100

"+100"

 

-99

"-99"

(NNNN)

1600

" 1600 "

 

-800

"(800)"

NNNNPR

1600

" 1600 "

 

-800

"<800>"

NNNNMI

1600

"1600 "

 

-800

"800-"

NNNVNN

343

"34300"

N.NNEEEE

7369

"7.37E+03"

"SRW"-0000

7782

"SRW7782"

-$NNNN.NN

800

"$800"

 

1600

"$1600"

-%NNN

10

"%10"

-NN NNN.NN

3000

"3 000"

+KKNNNNN.00

1950

"+ 1950.00"

 

900

"+ 900.00"

$<NNNNN.00>

1200

"$1200.00"

 

500

"$500.00"

$<NNNNN.00> DB

1200

"$1200.00 DB"

 

-500

"$500.00"

$<NNNNN.00> CR

1200

"$1200.00"

 

-500

"$500.00 CR"


* The quotation marks will not appear in your output. They are used here to make it clear where there are leading or trailing spaces.

4.9.7.3 Applying a format mask to a numeric object

  1. To apply a format mask to a numeric object:

  2. In the Paper Design view, click the object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  3. To apply the currency format to the object, click the Currency button in the toolbar.

  4. To apply the percentage format to the object, click the Percentage button in the toolbar.

  5. To add commas to the value of the object, click the Commas button in the toolbar. To move the comma right or left, click the Remove Decimal Place button or the Add Decimal Place button.

  6. Choose Tools > Property Inspector.

  7. Under the Field node, verify the Format Mask property is set to the desired format.

  8. Set other properties as desired.

4.9.7.4 Applying a format mask to a date object

To apply a format mask to a date object:

  1. In the Paper Design view, click the object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Choose Tools > Property Inspector.

  3. Under the Field node, set the Format Mask property to the desired date format.

  4. Set other properties as desired.

4.9.7.5 Adding a custom format mask

To add a custom format mask to the default format masks list:

  1. Choose Edit > Preferences.

  2. In the Preferences dialog box, click Edit Masks.

  3. In the Format Masks dialog box, set Display to the type of format mask you want to add.

  4. In the Mask field, type the format mask to add, then click Add.

  5. Click OK.

    Now, you will see your new custom format masks in the list of values for the Format Mask property for fields and the Input Mask property for parameters.

4.9.7.6 Changing the format mask for multiple fields

To change the format mask for multiple fields at one time:

  1. In the Paper Layout view, click the fields you want to change.

  2. Choose Tools > Property Inspector.

  3. In the Property Inspector, set the Format Mask property to a new format mask.

4.9.8 Graphic or Image Objects

This section provides procedures for the following tasks that you may perform as you work with graphic or image objects:

4.9.8.1 Adding an image

To add an image to your report, perform the steps in any of the topics listed below.

For paper-based reports and JSP-based Web reports:

For paper-based reports only:

See also

Section 2.4.3, "About images"

4.9.8.1.1 Importing an image

Note:

This procedure applies to paper-based reports. For JSP-based Web reports, see the Usage notes, below.

These steps allow you to include images in the following formats: TIFF, JFIF, BMP, TGA, PCX, PICT, GIF, CALS, RAS, OIF, PCD. For images in other formats supported by Oracle Reports, including JPEG (all types, such as Progressive JPEG and Exif JPEG), PNG, BMP, TIFF, GIF, and CGM, see Section 4.9.8.1.2, "Linking an image object to a file" or Section 4.8.5, "Selecting an image from the database".

To import an image:

  1. In the Paper Layout view, choose Insert > Image and click the type of object you want to import.

  2. In the dialog box, specify the name and format of the file. Click OK.

  3. Move the object to the desired position.

Usage notes

This procedure is for paper-based reports only. If you want to include static images in your JSP-based Web reports, you can add HTML <img> tags in the Web Source view.

4.9.8.1.2 Linking an image object to a file

Notes:

This procedure applies to paper-based reports. File link objects are not implemented in JSP-based Web reports.

These steps, and the steps in Section 4.8.5, "Selecting an image from the database", allow you to include images in a wide variety of formats supported by Oracle Reports, including JPEG (all types, such as Progressive JPEG and Exif JPEG), PNG, BMP, TIFF, GIF, and CGM. For paper-based reports, you can also use Insert > Image to import an image from a file into the report layout for images in the following formats: TIFF, JFIF, BMP, TGA, PCX, PICT, GIF, CALS, RAS, OIF, PCD (see Section 4.9.8.1.1, "Importing an image", above).

To link an image object to a file:

  1. In the Paper Design view or Paper Layout view, click the File Link tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the file link object to display the Property Inspector.

  4. Under the File Link Boilerplate node:

    • Set the Source File Format property to Image.

    • Set the Source Filename property to the name of the file containing the image.

4.9.8.1.3 Linking an image object to a URL

Notes:

This procedure applies to paper-based reports output to an HTML or HTMLCSS file. This is unrelated to HTML that might be generated when you run a JSP-based Web report (when you click the Run Web Layout button in the toolbar, or choose Program > Run Web Layout). Additionally, file link objects are not implemented in JSP-based Web reports.

These steps, and the steps in Section 4.8.6, "Selecting an image URL from the database", allow you to include images in a wide variety of formats supported by Oracle Reports, including JPEG (all types, such as Progressive JPEG and Exif JPEG), PNG, BMP, TIFF, GIF, and CGM. For paper-based reports, you can also use Insert > Image to import an image from a file into the report layout for images in the following formats: TIFF, JFIF, BMP, TGA, PCX, PICT, GIF, CALS, RAS, OIF, PCD (see Section 4.9.8.1.1, "Importing an image", above).

To link an image object to a URL that points to an image to include in an HTML report:

  1. In the Paper Design view or Paper Layout view, click the File Link tool in the tool palette.

  2. Click and drag a rectangle.

  3. Double-click the file link object to display the Property Inspector.

  4. Under the File Link Boilerplate node:

    • Set the Source File Format property to Image URL.

    • Set the Source Filename property to the URL where the image is located with the required protocol.

Example 1: Image URL

HTTP://www.oracle.com/images/logo.gif

Example 2: Image URL containing user parameter

HTTP://&<P_SERVER_NAME>/images/logo.gif 

where P_SERVER_NAME is a user parameter of type CHAR.

At runtime, the end user can specify a value for the parameter (for example,
P_SERVER_NAME=www.oracle.us.com
for a dynamic URL link of http://www.oracle.us.com/images/logo.gif).

Example 3: URL to a file

FILE://c:/images/logo.gif

Note:

If you click Browse to find a file, Oracle Reports automatically prepends FILE:// to the returned path.

4.9.8.2 Adding a graph

To add a graph to your report, follow the steps in either of the following topics:

Usage notes

Inserting a graph with a once-per-group position in the Paper Design view of a matrix with group report causes Oracle Reports Builder to fail. As a workaround, insert the graph in the Paper Layout view, rather than the Paper Design view, when adding a graph to a matrix with group report.

See also

Section 1.6.6, "About the Web Source view"

Chapter 39, "Building a Report with Graphs"

4.9.8.2.1 Adding a graph to a paper-based report

To add a graph to your paper-based report:

  1. In the Paper Layout view, click the Graph tool in the tool palette.

  2. Drag a square in the area where the graph should appear to display the Graph Wizard.

  3. In the Graph Wizard, specify information for the graph. Click Help on any wizard page for assistance.

    Note:

    When you specify a graph title, subtitle, footnote, or axis title in the Graph Wizard, you can insert lexical references (to user parameters, system parameters, and columns) in the text. For example, in the Show Title field on the Title page of the Graph Wizard, type: titletext &<P_1> to insert the value of the user parameter P_1 into the title text at runtime. The angle brackets (<>) are required around the parameter or column name.

  4. Double-click the graph object you have created to display the Property Inspector, and set properties as desired.

    To customize your graph XML definition beyond the scope of the Graph Wizard, you can directly edit the XML in the graph's Graph Settings property. The full list of attributes available is defined in the DTD file, graph.dtd.

    Note:

    The graph.dtd is available in the following locations:

    • ORACLE_HOME\jlib\bigraphbean.jar

    • In Getting Started with Oracle Reports on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Documentation and click Search. In the list that displays, find the Documented Graph DTD.

  5. To re-enter the Graph Wizard, do either of the following:

    • Right-click the graph, and choose Graph Wizard.

    • Click the graph, then choose Edit > Settings.

4.9.8.2.2 Adding a graph to a JSP-based Web report

To add a graph to a JSP-based Web report:

  1. In the Object Navigator, double-click the view icon next to the Web Source node to display the source code in the Web Source view.

  2. Locate the section in the source code where you want to add the graph.

    Note:

    Previously adding some text such as "Place the graph here" to your Web page enables you to easily locate the correct position for your graph.

  3. Choose Insert > Graph.

  4. In the Graph Wizard, specify the information for the graph. Click Help on any tab page for assistance.

    Note:

    When you specify a graph title, subtitle, footnote, or axis title in the Graph Wizard, you can insert lexical references (to user parameters, system parameters, and columns) in the text. For example, in the Show Title field on the Title page of the Graph Wizard, type titletext &<P_1> to insert the value of the user parameter P_1 into the title text at runtime. The angle brackets (<>) are required around the parameter or column name.

  5. Click the Run Web Layout button in the toolbar (or choose Program > Run Web Layout) to display your report and graph in your Web browser.

    Note:

    If Netscape 7.0 is your default browser, and the browser does not display, set the registry key HKEY_CURRENT_USERS\Software\Oracle\Toolkit\Tkbrowser to the default browser location. Ensure that the BrowserName and the BrowserPath keys reflect the correct values. For example: BrowserName=Netscape 7; BrowserPath=C:\Program Files\Netscape\Netscape\Netscp.exe.

  6. To re-enter the Graph Wizard, place your cursor anywhere between the <rw:graph> and </rw:graph> tags in the Web Source view, then choose Edit > Settings.

    To customize your graph XML definition beyond the scope of the Graph Wizard, you can directly edit the XML in the Web Source view. The full list of attributes available is defined in the DTD file, graph.dtd.

Note:

The graph.dtd is available in the following locations:

  • ORACLE_HOME\jlib\bigraphbean.jar

  • In Getting Started with Oracle Reports on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Documentation and click Search. In the list that displays, find the Documented Graph DTD.

4.9.8.3 Editing a graph

To add a graph to your report, follow the steps in either of the following topics:

See also

Section 1.4.4, "About Graphs and the Graph Wizard"

Section 1.6.6, "About the Web Source view"

4.9.8.3.1 Editing a graph in a paper-based report

To edit a graph in a paper-based report:

  1. In the Paper Layout view, click the graph.

    Note:

    The graph is represented as a bar graph even if the graph is of another type.

  2. To edit the XML definition of the graph:

    • Right-click the graph, and choose Property Inspector.

    • In the Property Inspector, under the Graph node, click the Graph Settings property value field to display the Graph Settings dialog box. To customize your graph XML definition beyond the scope of the Graph Wizard, specify additional rw:graph tag attributes. The full list of attributes available is defined in the DTD file, graph.dtd.

      Note:

      The graph.dtd is available in the following locations:

      • ORACLE_HOME\jlib\bigraphbean.jar

      • In Getting Started with Oracle Reports on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Documentation and click Search. In the list that displays, find the Documented Graph DTD.

  3. To re-enter the Graph Wizard to redefine the graph, do either of the following:

    • Right-click the graph, and choose Graph Wizard.

    • Click the graph, then choose Edit > Settings.

4.9.8.3.2 Editing a graph in a JSP-based Web report

To edit a graph in a JSP-based Web report, do any of the following in the Web Source view:

  • Place your cursor anywhere between the <rw:graph> and </rw:graph> tags, then choose Edit > Settings to re-enter the Graph Wizard.

    Note:

    Any manual changes and additions you've made to the graph XML will be lost if you click Finish, which redefaults the graph to the definition in the Graph Wizard.

  • Delete and re-create the graph as follows:

    1. Delete all lines from the <rw:graph> tag to the </rw:graph> tag.

    2. Leaving the cursor in the position where the graph was cut, choose Insert > Graph and follow the Graph Wizard to re-create the graph.

  • Between the <rw:graph> and </rw:graph> tags that define the graph, make changes directly to the JSP and XML tags. This enables you to customize your graph XML definition beyond the scope of the Graph Wizard. The full list of attributes available is defined in the DTD file, graph.dtd.

Note:

The graph.dtd is available in the following locations:

  • ORACLE_HOME\jlib\bigraphbean.jar

  • In Getting Started with Oracle Reports on the Oracle Technology Network (OTN): on the Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Documentation and click Search. In the list that displays, find the Documented Graph DTD.

4.9.8.4 Adding a graph hyperlink

You can add a graph hyperlink to a graph in your paper-based Web report (output to PDF or HTML), or JSP-based Web report. When end users display the report on the Web, they can click the areas of the graph to drill down to additional linked information.

To add a graph hyperlink to a graph, follow the steps in either of the following topics:

See also

Section 2.2.6, "About graph hyperlinks"

Section 1.4.4, "About Graphs and the Graph Wizard"

Section 1.6.6, "About the Web Source view"

4.9.8.4.1 Adding a graph hyperlink to a paper-based report

For a paper-based Web report (for HTML or PDF output), you can add a graph hyperlink to a graph in either of the following ways:

  • Property Inspector

  • Graph Wizard

To specify a graph hyperlink in a paper-based report using the Property Inspector:

  1. In the Paper Layout view, display the Property Inspector for the graph.

  2. Set the Graph Hyperlink property to a hyperlink from any graph section to any object in your report output, another report, or any valid hyperlink destination.

    Examples:

    • A hyperlink from any graph section to any object in your report:

      #&<dept_id>

    • A hyperlink to another report:

      http://my_machine:8888/reports/myWebApp/Dept_Detail.jsp? p_deptid=&<deptid>+...

    • A hyperlink to any valid hyperlink destination:

      www.oracle.com

To specify a graph hyperlink in a paper-based report using the Graph Wizard:

  1. On the Define Hyperlink panel, use the examples shown on the panel to enter a hyperlink value to link areas of the graph to specified destinations.

  2. Click Finish.

After you have defined the graph hyperlink, generate your report to HTML, HTMLCSS, or PDF to test the graph hyperlinks. Refer to Section 4.7.5, "Generating HTML or HTMLCSS output" and Section 4.7.6, "Generating PDF output".

4.9.8.4.2 Adding a graph hyperlink to a JSP-based Web report

To add a graph hyperlink to a graph in a JSP-based Web report:

  • In the Web Source view of your report, modify the <rw:graph> JSP tag to include the graphHyperlink attribute.

    For example:

    graphHyperlink="http://my_machine:8888/reports/myWebApp/Dept_Detail.jsp? userid=hr/hr@mydb+server=myserver+p_deptno=&<deptno>"

After you have defined the graph hyperlink, click the Run Web Layout button in the toolbar (or choose Program > Run Web Layout) to display your report and graph in your Web browser, and click the graph hyperlinks to test them.

4.9.8.5 Creating a drawing object

To create a drawing object:

  1. In the Paper Layout view, click a drawing tool in the tool palette (for example, Rectangle, Ellipse, Polyline, and so on).

  2. To create a line, rounded rectangle, rectangle, ellipse, arc, or freehand object, click in the main area (canvas region) of the window and drag to create the object.

  3. To create a polygon or polyline, click in the main area (canvas region) of the window where you want each point of the object, then double-click to create the object.

  4. To draw constrained objects (that is, perfect circles and squares, and so on), hold down the constrain key (for example, the shift key) when drawing the graphic.

  5. Double-click the drawing object.

  6. In the Property Inspector, set the desired properties.

4.9.9 Page or Group Headers or Footers

This section provides procedures for the following tasks that you may perform as you work with page or group headers or footers:

4.9.9.1 Creating a text heading

To create an object or heading in the margin of a report:

  1. In the Paper Layout view, click the Edit Margin button in the toolbar.

    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.

  2. To adjust the margin, click the margin border, then drag a handle to the desired position. You can adjust the margin on all four sides of a report.

  3. Create required objects in the margin area. They will appear on all pages of the report.

  4. Click the Header Section, Main Section, or the Trailer Section buttons in the toolbar to reactivate the appropriate section of the body area of the report.

4.9.9.2 Creating a heading that includes database values

To create a heading that includes database values:

  1. Choose Tools > Report Wizard to re-enter the Report Wizard for the current report.

  2. On the Totals page, create any totals that you want to include in the heading.

    Note:

    Any totals that you intend to place in the margin area of your report must be report-level totals. Group totals (for example, the total for a department) placed in the margin will cause a frequency error when you run your report.

  3. On the Fields page, verify that the fields and totals you want to include in the heading are either available or displayed in the report.

  4. In the Paper Layout view, click the Margin button in the toolbar.

    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.

  5. For any values that require a format mask, create a hidden field object in the margin area (see Section 4.9.1.1, "Creating a field object"):

    • In the Property Inspector, under the Field node, set the Source property to the source column for the value, set the Visible property to No, and set the Format Mask property as desired.

    • Under the General Layout node, set the Horizontal Elasticity property to Variable.

      Note:

      If you do not need to specify a format mask, you can simply reference the value directly in Step 6, and you do not need to create this hidden field.

  6. Create a boilerplate text object in the margin area, and reference the field or report-level totals you want to include in the heading. See Section 4.9.2.1, "Creating a boilerplate object for text" and Section 4.9.2.5, "Referencing a field in boilerplate text".

See also

The example report in Chapter 17, "Building a Header with Database Values Report".

4.9.9.3 Creating a group header or footer

To create a header or footer above or below each group of records:

  1. In the Paper Layout view, click the Confine Off button and the Flex On button in the toolbar.

  2. Click frame that encloses the repeating frame for the group to which you want to add a header or footer, then drag and resize the frame to allow enough room to type the header or footer text.

    Tip:

    In the Object Navigator, under the Paper Layout node, expand the Body node to select the frame by name.

  3. Create a boilerplate text object for the header or footer text (see Section 4.9.2.1, "Creating a boilerplate object for text").

4.9.10 Margin, Header Page, or Trailer Page Objects

This section provides procedures for the following tasks that you may perform as you work with margin, header page, or trailer page objects:

4.9.10.1 Creating a margin object

To create an object or heading in the margin of a report:

  1. In the Paper Layout view, click the Edit Margin button in the toolbar.

    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.

  2. To adjust the margin, click the margin border, then drag a handle to the desired position. You can adjust the margin on all four sides of a report.

  3. Create required objects in the margin area. They will appear on all pages of the report.

  4. Click the Header Section, Main Section, or the Trailer Section buttons in the toolbar to reactivate the appropriate section of the body area of the report.

4.9.10.2 Creating a header page or trailer page object

With report sectioning, Header and Trailer pages are identical to Body pages. In effect, this means that the Header, Trailer, and Body are three sections of a report. The names of the sections are exposed under the Paper Design node in the Object Navigator as Header Section, Main Section, and Trailer Section. You can use the margin and body of the Header and Trailer sections to create a Header and Trailer "page" as in earlier releases of Oracle Reports.

  1. In the Paper Layout view, click the Confine Off button and the Flex On button in the toolbar.

  2. Click the repeating frame for the page, then drag and resize the frame to allow enough room to type the header or footer text.

    Tip:

    In the Object Navigator, under the Paper Layout node, expand the Body node to select the repeating frame by name.

  3. Create a boilerplate text object for the header or footer text.

4.9.11 Move Objects

This section provides procedures for the following tasks that you may perform as you move your report objects:

4.9.11.1 Moving multiple objects

To move multiple objects:

  1. Click or drag a box around the objects you want to move.

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Use the arrow keys on your keyboard to move the objects in the desired direction.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

4.9.11.2 Moving an object outside its parent

To move a child object outside its enclosing parent object:

  1. In the Paper Layout view or Paper Design view, click the Confine Off button in the toolbar.

  2. Click and drag the child object(s) as desired.

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

4.9.11.3 Adjusting parent borders automatically

To adjust parent borders as you move child objects:

  1. In the Paper Layout view, click the Flex On button in the toolbar.

  2. Click and drag the child object(s) as desired.

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  3. To move an object that aligns with another object in the horizontal or vertical direction (for example, a field and its label), hold down the Ctrl key as you drag the first object. To move both objects simultaneously, do not use the Ctrl key.

See also

Section 2.4.6, "About resizing objects"

4.9.11.4 Moving a column in report output

To move a column in report output:

  1. In the Paper Layout view or Paper Design view, click the column.

  2. Click the Flex On button in the toolbar

  3. Drag the column to the desired position.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

Chapter 4, "Changing columns labels or widths"

Chapter 4, "Changing the default layout spacing"

4.9.11.5 Offsetting detail objects in a group report

To offset the detail fields in a group above or group left report:

  1. In the Paper Design view, click the Flex On button in the toolbar.

  2. Select the detail objects and move them to the right.

  3. Click the Flex Off button in the toolbar.

See also

Section 1.3.2, "About group above reports"

Section 1.3.3, "About group left reports"

4.9.11.6 Aligning objects

To align objects:

  1. Click the objects you want to align.

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Choose Layout > Alignment.

  3. In the Align Objects dialog box, specify the desired alignment.

  4. Click OK.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

4.9.11.7 Changing object layering

To change the order in which objects are layered on top of each other:

  1. In the Paper Layout view, click the Confine Off button in the toolbar.

  2. Click the object you want to move.

  3. Choose one of the following items from the Arrange menu:

    • Bring to Front to move the object in front of all other objects.

    • Send to Back to move the object behind all other objects.

    • Move Forward to move the object in front of the object directly on top of it.

    • Move Backward to move the object behind the object directly underneath it.

See also

Section 2.4.7, "About moving and layering objects in the Paper Layout view"

4.9.11.8 Rotating a boilerplate object

You can only rotate boilerplate text and graphics. You cannot rotate other layout objects (repeating frames or fields).

To rotate a boilerplate object:

  1. Click the object(s) that you want to rotate.

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Click the Rotate tool in the tool palette.

  3. Drag a handle to rotate the object or group.

See also

Section 1.8.5, "About boilerplate objects"

4.9.12 Resize Objects

This section provides procedures for the following tasks that you may perform as you resize your report objects:

4.9.12.1 Resizing objects

To resize one or more objects:

  1. Click the object(s) that you want to resize.

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Set the size:

    • For a fixed size, drag the handle of one of the selected objects. All selected objects will change size accordingly.

    • Or, choose Tools > Property Inspector. In the Property Inspector, under the General Layout node, set the Vertical Elasticity and Horizontal Elasticity properties to Contract, Expand, Fixed, or Variable.

See also

Section 2.4.6, "About resizing objects"

Section 1.8.3, "About frame and repeating frame sizing"

4.9.12.2 Making multiple objects the same size

To make multiple objects the same size:

  1. Click the objects you want to size.

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Choose Layout > Size Objects.

  3. In the Size Objects dialog box, specify the desired settings. Click OK.

4.9.12.3 Resizing object borders

See Section 4.9.11.3, "Adjusting parent borders automatically".

4.9.13 Change Spacing

This section provides procedures for the following tasks that you may perform as you change spacing between your report objects:

4.9.13.1 Changing columns labels or widths

To change column labels or widths:

  1. Choose Tools > Report Wizard.

  2. In the Report Wizard, click the Labels tab.

  3. Change the values in the Labels and Width columns, as desired.

  4. Click Apply.

See also

Chapter 4, "Moving a column in report output"

4.9.13.2 Changing spacing within a text object

To change spacing within a text object:

  1. In the Paper Design view, click the object(s).

    Tip:

    To select multiple objects, click one object, then Shift-click all other objects. To select all objects, choose Edit > Select All.

  2. Choose Format > Text Spacing and select the desired spacing for the text object.

4.9.13.3 Changing the default layout spacing

To change the default layout spacing used by the Report Wizard when defaulting the report layout:

  1. Choose Tools > Preferences.

  2. In the Preferences dialog box, click the Wizards tab.

  3. To increase the space between objects and the objects they enclose, type larger values for Horizontal Gap and Vertical Gap.

  4. To increase the space between fields, type larger values in Horizontal Interfield and Vertical Interfield.

  5. Click OK to close the Preferences dialog box.

  6. For smaller spacings, choose View > Snap to Grid to toggle this setting off (no checkmark). When Snap to Grid is set on, defaulting the layout honors the layout spacing values, but then snaps to the closest grid point; the result may be that smaller changes to these values are not evident in the report output.

See also

Chapter 4, "Moving a column in report output"

4.9.13.4 Changing the spacing between all rows

To change the spacing between all rows using the Paper Design view:

  1. In the Paper Design view, click the second record.

  2. Drag the second record down to create the desired spacing between all rows in the report output.

To change the spacing between all rows using the Property Inspector:

  1. In the Paper Design view, click any field in the body of the report.

  2. Click the Select Parent Frame button in the toolbar.

  3. Choose Tools > Property Inspector.

  4. Under the Repeating Frame node, set the Vert. Space Between Frames (inches) property to the amount of blank space in inches to leave between row in the report output (for example, 0.25).

4.9.13.5 Adding blank lines between groups of rows

To add blank lines between groups of rows:

  1. Create a summary column (see Section 4.8.11, "Creating a summary column"). On the Totals page of the Data Wizard (or Report Wizard), select any field that appears in each row of output, and Count as the calculation. On the Fields page, remove the summary from the displayed fields column.

  2. Create a user parameter named SPACE (see Section 4.11.2, "Creating a user parameter"). In the Property Inspector, under the Parameter node, set the Datatype property to Number and the Initial Value property to the number of records you want in each group (for example, 5).

  3. In the Paper Layout view, click the Flex On and Confine Off buttons in the toolbar.

  4. Click the repeating frame for the group, then drag the handle on the bottom of the frame to create a space slightly larger than the space you want to add between groups of rows in the report output.

  5. Choose Tools > Property Inspector to display the Property Inspector for the repeating frame.

  6. Under the General Layout node, set the Vertical Elasticity property to Variable.

  7. Click the Rectangle tool in the tool palette.

  8. Draw a rectangle in the space under the record.

  9. Double-click the rectangle object.

  10. In the Property Inspector, under the Advanced Layout node, double-click the Format Trigger property value to display the PL/SQL Editor.

  11. In the PL/SQL Editor, define the PL/SQL for the format trigger. For example, the following PL/SQL code inserts blank space between groups of rows (displays a boilerplate rectangle when the row count divided by the value of SPACE leaves no remainder):

    function spacing return BOOLEAN is
    begin
      if :CountENAMEPerReport MOD :SPACE = 0 then
        return (true);
      else 
        return (false);
      end if;
    end;
    
  12. Hide the rectangle object:

    • On the Fill Color palette, click No Fill.

    • On the Line Color palette, click No Line.

4.9.14 Modify the Page Layout

This section provides procedures for the following tasks that you may perform as you modify the page layout of your report:

4.9.14.1 Adjusting margins

To adjust margins:

  1. In the Paper Layout view, click the Edit Margin button in the toolbar.

    Note:

    The margin area is defined by a thick black line that separates it from the body. If you create objects in the body portion of a report while displaying the margin area, you can only edit those objects when the margin is displayed.

  2. Click the margin border, then drag a handle to the desired position. You can adjust the margin on all four sides of a report.

4.9.14.2 Adding a page break

To add a page break:

  1. In the Paper Layout view, click any field that is part of the frame at which you want to insert a page break.

  2. Click the Parent Frame in the toolbar.

  3. Choose Tools > Property Inspector.

  4. To set a page break...

    • before the selected frame: under the General Layout node, set the Page Break Before property to Yes.

    • after the selected frame: under the General Layout node, set the Page Break After property to Yes.

    • after a certain number of rows of output on each page: under the Repeating Frame node, set the Maximum Records per Page property to the number of rows you want to display on each page.

  5. To display icons that identify where page breaks are set, choose View > Page Breaks in the Paper Layout view.

Usage notes

If you want to set a page break at a specific row of report output, you can create a hidden object (for example, a rectangle with No Fill and No Line) that formats only at the specific row. If you set the Page Break Before property to Yes for the rectangle object, you will get a page break after the row.