Skip Headers
Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports
11g Release 1 (11.1.1)

Part Number B32122-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

4.12 Define a Template

This section provides procedures for the following tasks that you may perform as you define a report template:

4.12.1 Creating a template

To create a template:

  1. In the Object Navigator, click the Templates node, then click the Create button in the toolbar.

  2. Define default template attributes for all report styles.

  3. Optionally, define override template attributes for a selected report style.

  4. To define system parameters, user parameters, report triggers, program units, and attached libraries for the template, double-click the associated nodes in the Object Navigator.

See also

Section 2.7.5, "About the Template Editor"

Section 2.7.1, "About templates"

Section 2.7.2, "About template attributes"

Section 2.7.3, "About applying templates"

Section 2.7.4, "About inheritance in templates"

4.12.2 Defining default template attributes

To define default attributes for report objects in a template that applies to all report styles:

  1. In the Object Navigator, expand the Templates node, then the Paper Layout node, then the Section node, then the Body node, then the Default node.

  2. To change default properties for the overall layout and spacing for report styles, double-click the properties icon next to the Default node to display the Property Inspector.

  3. To change default properties for frames, field labels/headings, fields, summary labels, and summaries (totals), fully expand the Default node, then double-click the properties icons to display the Property Inspector.

    Note:

    The Paper Layout view is synchronized with the Object Navigator; when you select a layout object, the associated node is highlighted in the Object Navigator. To select the parent frame for a layout object, click the object, then click the Select Parent Frame button in the toolbar to select the parent frame.

  4. In the Paper Layout view, select from the Report Style list to view the layout for individual report styles.

  5. To make further changes for the currently displayed report style, either return to the Object Navigator, or double-click an object to display the Property Inspector.

    Note:

    Any changes you make for an individual report style will override the attributes defined under the Default node.

See also

Section 2.7.1, "About templates"

Section 2.7.2, "About template attributes"

4.12.3 Defining override template attributes

To define override attributes for a selected report style:

  1. In the Object Navigator, expand the Templates node, then the Paper Layout node, then the Section node, then the Body node, then the Override node, then the node for the report style for which you want to define overrides (for example, Tabular, Group Left).

  2. To change default properties for the overall layout and spacing for a section of the selected report style, double-click the properties icon next to the Section (Level n) node to display the Property Inspector.

  3. To create more than the default number of sections for a particular report style, click a Section (Level n) node, then click the Create button in the toolbar.

    Note:

    Sections are mapped to groups in a report. For more information, see About template attributes.

  4. To delete a section for a particular report, click a Section (Level n) node, then click the Delete button in the toolbar.

    Note:

    You can only delete nodes down to the minimum requirement for the current report style.

  5. For each section for which you want to define overrides, fully expand the Section (Level n) node, then double-click the properties icons to display the Property Inspectors for the frames, field labels/headings, fields, summary labels, and summaries (totals).

    Note:

    The Paper Layout view is synchronized with the Object Navigator; when you select a layout object, the associated node is highlighted in the Object Navigator. To select the parent frame for a layout object, click the object, then click the Select Parent Frame button in the toolbar to select the parent frame.

  6. In the Paper Layout view, select from the Report Style list to view the layout for individual report styles.

  7. To make further changes for the currently displayed report style, either return to the Object Navigator, or double-click an object to display the Property Inspector.

    Note:

    Any changes you make for an individual report style will override the attributes defined under the Default node.

See also

Section 2.7.1, "About templates"

Section 2.7.2, "About template attributes"

4.12.4 Applying a template to a report

To apply a template to a report:

  1. In the Object Navigator, click the report or report section to which you want to apply a template.

    Note:

    If you select the node for the entire report in the Object Navigator, the template will be applied to the Main section of the report by default. To apply the template to a specific section of your report, select the node for that section in the Object Navigator.

  2. Choose Tools > Report Wizard.

  3. On the Template page, select a pre-defined template, or click Template file, and click Browse to open the desired template.

  4. Click Finish to apply the template to the current report section.

See also

Section 2.7.1, "About templates"

Section 2.7.3, "About applying templates"

4.12.5 Formatting the report title in a template

To set default attributes (such as font and color) for the title in a selected template:

  1. In the Object Navigator, expand the Templates node, then the Paper Layout node, then the Section node, then the Body node, then the Default node.

  2. Double-click the properties icon next to the Default node to display the Property Inspector.

  3. Under Title, modify the properties as desired.

To set the placement and override attributes (such as font and color) for the title in a selected template:

  1. In the Paper Layout view of the template, create a boilerplate text object for the title in the margin.

  2. Size and position the title, and modify the color and text attributes as desired.

  3. Double-click the title object to display its Property Inspector.

  4. Under General Information, set the Name property to B_OR$REPORT_TITLE.

See also

Section 2.1.1, "About report titles"

Section 2.7.1, "About templates"

4.12.6 Adding items and objects to a template

To add items and objects to a template:

  1. In the Paper Layout view of the Template Editor, click the Margin button in the toolbar to display the margin area.

  2. Create objects in the margin of your template. You cannot create objects in the body of a template.

See also

Section 2.7.5, "About the Template Editor"

Section 2.7.1, "About templates"

Section 2.7.2, "About template attributes"

Section 2.7.4, "About inheritance in templates"

4.12.7 Modifying objects in the template margin

To modify objects in the margin of a template:

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

  2. Modify objects in the margin of your template.

See also

Section 2.7.5, "About the Template Editor"

Section 2.7.1, "About templates"

Section 2.7.2, "About template attributes"

Section 2.7.4, "About inheritance in templates"

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

Template objects can be modified using the same techniques as report objects. To change the color or pattern of objects in a template, however, you use the template Property Inspector, rather than the Color tools in the tool palette:

  • The Fill Pattern property defines the pattern to use for the space enclosed by the objects. You can define the background and foreground colors of the fill pattern using the Foreground Color and Background Color properties.

  • The Edge Pattern property defines the pattern to use for the borders of the objects. You can define the background and foreground colors of the edge pattern using the Edge Foreground Color and Edge Background Color properties.

  • The Text Color property specifies the text color to use for the object(s).

See also

Section 2.4.5, "About changing colors and patterns"

Section 4.9.6.2, "Changing colors"

Section 4.9.6.3, "Changing patterns"

Section 2.7.1, "About templates"

4.12.9 Adding a template to the pre-defined templates list

To add your own template to the list of predefined templates in the Report Wizard:

  1. In a text editor (for example, Wordpad), open the preferences file:

    • On Windows, open $ORACLE_INSTANCE\config\FRComponent\frcommon\tools\admin\CAUPREFS.ORA (user preferences) if it exists; otherwise, open $ORACLE_INSTANCE\config\FRComponent\frcommon\tools\admin\CAGPREFS.ORA (global preferences).

    • On UNIX, open your_home_directory/prefs.ora (user preferences) if it exists; otherwise, open $ORACLE_INSTANCE/config/FRComponent/
      frcommon/tools/admin/prefs.ora
      (global preferences).

  2. Scroll down to the template descriptions identified by Reports.xxx_Template_Desc (where xxx specifies a report style: Tabular, BreakAbove, BreakLeft, FormLetter, Formlike, MailingLabel, Matrix, MatrixBreak).

  3. For each report style for which the template is defined:

    • To the Reports.xxx_Template_Desc list, add the description that you want to appear on the Template page of the Report Wizard.

    • To the corresponding Reports.xxx_Template_File list, add the file name of your template in the same position as the addition you made to the description list.

  4. Copy the template file (filename.tdf) to ORACLE_HOME/REPORTS/TEMPLATES.

To include a sample image of your template in the Report Wizard:

  1. Copy or create the .bmp file you want to use as the image for the template and name it yyy.bmp, where yyy is the file name of your template.

  2. Copy each .bmp file to ORACLE_HOME/REPORTS/TEMPLATES.

See also

Section 2.7.1, "About templates"

Section 2.7.3, "About applying templates"

4.12.10 Creating an HTML template for a report portlet

To create and use an HTML template for a report that can be published on an Oracle Portal page:

  • See the How To Create a Report Portlet Template in Getting Started with Oracle Reports white paper, available on the Oracle Technology Network Oracle Reports page (http://www.oracle.com/technology/products/reports/index.html). Click Getting Started. In the list of topic sections on the left, click Index. On the Index page, in the Collateral Type list, choose White Papers & How To Documents, and click Search. In the list that displays, click Creating a Report Portlet Template.

See also

Section 2.7.1, "About templates"

Section 2.7.3, "About applying templates"