Creating Report Templates

This chapter provides an overview of report template types and discusses how to:

See Also

Oracle BI Publisher Core Components Guide.

XML Publisher Classes

Click to jump to parent topicUnderstanding Report Template Types

Template design involves the construction of a report layout in a template file and is dependent upon what the core Oracle BI Publisher engines accept for processing.

The nature of the data plays a role in the selection of a template.

Note. Internet Explorer does not have native support for svg graphics; an SVGViewer must be installed for you to see charts in Internet Explorer. SVGViewer is available for free download on the Adobe website at http://www.adobe.com/svg/viewer/install/.

The following table lists and describes supported template types and provides guidelines for you to consider:

Template Type

Description

PDF Template

Reports are prerendered PDF forms that are populated with data at runtime.

Starting in PeopleTools 8.50 nested structures are supported. Nested structures should not be used for any reports that need to be backwards compatible.

This template type is suitable when you have existing PDF forms that you need to use to generate reports, such as government forms.

Generally, using this template type is faster than using RTF templates because no runtime rendering is involved.

Use PDF templates when:

  • You already have PDF templates that you must use (for example, government forms).

  • You have simple form-based reporting requirements with no complex formatting, that is, no charting, dynamic tables, dynamic repeated fields, and so forth.

RTF Template

Reports are full rendered, which means that the actual output is generated at runtime using XSLFO technology.

Report designers have full control of output formatting and can incorporate charts, dynamic tables, conditional formatting, and so forth.

Reports generation is generally slower than PDF-based reports because they involve real-time output rendering.

eText

eText templates are RTF-based templates that are used to generate flat-file text output that can be transmitted to a bank or other customer for Electronic Funds Transfer (EFT) or Electronic Data Interchange (EDI). Because the output is intended for electronic communication, these templates must follow specific format instructions for data placement.

Note. XML file is the recommended data source for eText templates because the requirements for eText templates are very specific. XML produced by PS Query data sources lacks the required structure for eText templates and is therefore not available.

See Oracle BI Publisher Core Components Guide, eText Templates.

XSL Templates

For more complex design requirements, a number of XSL and XSL-FO elements are supported for use with your XSL templates.

See Oracle BI Publisher Core Components Guide, XSL, SQL, and XSL-FO Support.

Note. Sample report templates are bundled with the BI Publisher Desktop, and available in <Installation Directory>\BI Publisher Desktop\samples.

Click to jump to parent topicUsing RTF Templates

RTF templates support most XSL functionality and can be designed with robust processing and formatting code.

This section discusses how to:

Click to jump to top of pageClick to jump to parent topicCreating RTF Templates

To create an RTF template using Microsoft Word:

  1. Download the delivered BI Publisher Template Builder plug-in for offline template design on the Reporting Tools, XML Publisher, Setup, Design Helper page to facilitate the insertion of application data tags into your RTF templates.

    The BI Publisher Template Builder is an extension to Microsoft Word that simplifies the development of RTF templates. While the Template Builder is not required to create RTF templates, it provides many automated functions that may increase your productivity.

    Note. You can choose to automatically view the Word Template Builder Tutorial File, Template Builder for Word Tutorial.doc, upon installing the plug-in. This document offers a quick and informative tutorial of the Template Builder.

    The Template Builder for Word Tutorial.doc is located in the \Template Builder for Word\doc directory of the folder where Oracle BI Publisher Desktop, BI Publisher Template Builder plug-in, was installed.

    Sample report templates are available in <Installation Directory>\BI Publisher Desktop\samples.

  2. Download the XML sample data file by clicking the Sample Data link on the Reporting Tools, XML Publisher, Report Definition page for a specified query.

  3. Load the sample data into the document by selecting Data, Load XML Data from the Microsoft Word Template Builder tool bar menu.

  4. Design your template in the RTF document.

    By using the downloaded XML sample data, you can insert the data field tags into your template rather than manually typing XSL-formatted tags.

    You can preview the template output with the sample XML data from the Oracle BI Publisher menu using Preview Template or select Preview from the Template Builder toolbar.

  5. Upload the completed template into the report definition by clicking the Upload button on the Reporting Tools, XML Publisher, Report Definition, Template page.

Note. Your data source XML structure should be designed to be as close as possible to the groupings used for in the actual report template structure; this improves runtime performance by preventing unnecessary XSL transformation. This is particularly applicable for reports with complex data structures and very large file sizes.

See Oracle BI Publisher Core Components Guide, Creating an RTF Template.

See “\\Word Template Builder\doc\Word Template Builder Tutorial.doc.”

See Working with Template Design Helpers, Creating Report Definitions.

Click to jump to top of pageClick to jump to parent topicIncorporating Sub-Templates

When designing a template, you can incorporate one or more sub-templates into your primary template.

You must use specific syntax to:

See Maintaining Sub-Templates.

Creating Sub-Templates

Within a single sub-template file, multiple sub-template components can be available. Start and end template indicators must exist to distinguish these various components.

<?template:component_name?> <?end template?>

For example, syntax of a sub-template file containing two components could be:

<?template:peoplesoft?> Pleasanton Campus 500 Oracle Lane Pleasanton, CA 94488 <?end template?> <?template:logo2x.5?> Oracle_Logo <?end template?>

where <?template:peoplesoft?> is the start template indicator of the component peoplesoft and <?template:logo2x.5?> is the start template indicator of the component logo2x.5. Each <?end template?> tag indicates the end of its respective component.

Importing Sub-Templates

To import a sub-template file that is stored in the Content Library, place the following syntax at the top of the primary template file:

<?import:psxmlp://sub-template_NAME?>

where sub-template_NAME is the registered sub-template ID in the Content Library, for example: <?import:psxmlp://STDHEADER?>. This syntax must be in Normal text.

Note. The sub-template reference is defined only in the RTF template. The sub-template must be defined in Content Library; however, the relationship to templates using the sub-template is not defined in the database. Developers must be aware of the sub-template relationships when modifying the RTF sub-template.

See Maintaining Sub-Templates.

Calling Sub-Templates

Place the following syntax in the primary template file in the location where the desired text or XSL instructions from the sub-template file should appear:

<?call-template:peoplesoft?>

In the preceding sample code peoplesoft is the name of the component that you want to use in the sub-template file.

Note. Primary templates calling nonexistent or inactive sub-templates cause an error message to be issued indicating the reason for the problem. This error information is incorporated into Process Scheduler error handling as well as into online viewing or previewing of the report.

See Running XML Publisher PeopleSoft Query Reports.

Testing a Sub-Template in Microsoft Word

You should test your template and sub-template using Template Builder before uploading to PeopleTools to make your sub-template is accessible to your template on the file system.

Use the following syntax when importing:

<?import:file:C:///Template_Directory/subtemplate_file.rtf?>

Notice the triple slashes and the use of the actual file name instead of template ID.

When your design is complete, you can change the import statement back to make the sub-template available to the main template in PeopleTools environment:

Click to jump to top of pageClick to jump to parent topicIncluding Images

BI Publisher supports a number of methods for including images in your reports:

Inserting Images

To directly insert a .jpg, .gif, or .png image file into a template:

  1. Select Insert, Picture, From File while the template is open in Microsoft Word.

  2. Select the desired .jpg, .gif, or .png file to insert into the template.

  3. Save the template.

Note. Oracle recommends that you use the Microsoft Word Insert menu option to insert the image, because the additional properties that you need to set for the RTF template to correctly generate reports with those images are automatically set by means of this method. Additionally, dragging and dropping an image onto a template creates a link to the local machine being used and may cause problems when the report is generated.

Importing Images

To import an image from a sub-template file:

  1. Embed the .jpg, .gif, or .png into the sub-template file.

    For example,

    <?template:logo2x.5?> Oracle_Logo <?end template?>

    where Oracle_Logo is the actual .jpg, .gif, or .png.

  2. Import the sub-template file that includes the image by including the following syntax at the top of the primary template file:

    <?import:psxmlp://sub-template_NAME?>

    In this code sample, sub-template_NAME is the registered sub-template ID in the Content Library.

  3. Add the calling details in the primary template at the appropriate location using the following syntax:

    <?call-template:logo2x.5?>

    In this code sample, logo2x.5 is the name of the component that contains the image in the sub-template file.

See Incorporating Sub-Templates.

Click to jump to top of pageClick to jump to parent topicChanging Default Template Font

The output report from RTF template uses template-level default fonts for empty report spaces and empty table cells. If the default font size does not match the font height used in a template, a final report could look different from user expectations. In this case, the user can change the template default font either in design time or runtime:

Click to jump to top of pageClick to jump to parent topicUsing Drilling URL in RTF Template

Drilling URLs are supported in XML Publisher reports with a data source of PS Query or Connected Query.

Note. Drilling URLs are supported only in RTF templates.

To use a drilling URL in a XML Publisher report:

  1. Create the query with the drilling URL defined as a field.

    See Drilling URL in Oracle PeopleSoft Query.

  2. Create an RTF template.

  3. In the RTF template map one or more fields to the fields that contain drilling URL.

  4. If the XML Publisher report is run in Process Scheduler using an application engine program, you will need to add additional code to identify the process instance for the application engine program before processing the report. The process instance can be retrieved from the state record PSXPQRYRPT_AET. This call is needed to set a drilling URL during Query or Connected Query execution.

    &ProcessInstance=PSXPQRYRPT_AET.PROCESS_INSTANCE; &oRptDefn.ProcessInstance = &ProcessInstance; &oRptDefn.ProcessReport("", "", %Date, "");

  5. When you click the drilling URL in the report depending on the drilling URL type, one of the following occurs:

See Also

Oracle Business Intelligence Publisher User’s Guide, Creating an RTF template, Template Features, Hyperlinks

Click to jump to parent topicUsing PDF Templates

This section discusses how to:

See Associating Templates.

Click to jump to top of pageClick to jump to parent topicWorking with PDF Templates

PDF templates do not require an external plug-in for offline template design. A mapping feature for XML data element tags is enabled when the PDF template file is uploaded to the Reporting Tools, XML Publisher, Report Definition, Template page. The XML Publisher PDF mapping functionality enables you to match existing form fields in a PDF template with sample data field tags.

You only need to do mapping, if the form field names in the PDF template do not match the tag names in the XML data. This is usually the case when you are using a third-party PDF template (such as government form) and when it is not easy to customize the tag names in XML data to match the PDF form fields.

Observe the following guidelines when working with PDF templates regardless of whether you are mapping PDF template fields or tags:

Processing PDF Templates

The Oracle BI Publisher Core Engine adheres to the following rules when processing PDF templates:

Using Full Path Mapping

The PeopleSoft implementation for PDF mapping supports full path mapping. Full path mapping is not supported in the BIP Server. Full path mapping should only be used when you have no control on the structure and names of your XML data tags. For you to use full path mapping, the data source definition must include sample XML with no schema.

Note. Full path mapping is available only for PeopleTools 8.50 and later. It is not backward compatible.

Click to jump to top of pageClick to jump to parent topicCreating PDF Templates

To create a PDF template without mapping tags using Adobe Acrobat:

  1. Design your template in the PDF document as documented in the Oracle BI Publisher Core Components Guide.

    Be sure that the PDF template field names match the XML data tags.

  2. Upload the completed template into the Report Definition by clicking the Upload button on the Reporting Tools, XML Publisher, Report Definition, Template page.

Note. BI Publisher supports Adobe Acrobat 5.0 (PDF specification version 1.4). If you are using a later version of Adobe Acrobat, use the File, Reduce File Size option to save your file as Adobe Acrobat 5.0-compatible.

See Oracle BI Publisher Core Components Guide, Creating a PDF Template.

Click to jump to top of pageClick to jump to parent topicMapping Data Tags

Third parties most often supply PDF templates in which the form fields already exist inside the form template. For the XML data element tags to know where they should print within the PDF template, a mapping is required between the field elements from the data source and the form field elements in the PDF template. Once a PDF form with editable form fields is mapped to the XML sample data fields, the template is ready for use by XML Publisher.

Prior to being able to perform this mapping, some XML Publisher-specific pre-processing of the file is required. This processing requires the existence of an open sample data and the report’s data source. Adobe Standard or above and version 6 or above is required for the template mapping. In the event that the PDF form does not have form fields, the form field and tags can be inserted using the Designer or Professional versions of Adobe. The form field tags can then be mapped to the sample data tags.

To create a PDF template by mapping data element tags using Adobe Acrobat:

  1. Upload the PDF template file to be mapped by clicking the template file Upload button on the Reporting Tools, XML Publisher, Report Definition, Template page.

  2. If you are using full path mapping, select the Full Path Mapping check box.

  3. Generate the file to be mapped by clicking the map file Generate button.

    Generate creates a map-enabled PDF, with the following naming convention. The plug-in enables you to access the data tags by embedding a JavaScript plug-in inside the PDF template.

  4. Visually map the data tags to the form’s field tags.

    The mapping exercise is performed offline within the Adobe Acrobat application.

  5. Save the file.

    The generated file name indicates the type of mapping, as previously defined in step 2.

  6. Upload the mapped PDF file on the Reporting Tools, XML Publisher, Report Definition, Template page by selecting the map file Upload button.

    When uploaded to the server, the mapping information is stored in the database along with the PDF form template.

Note. If the PDF template’s field names are the same as the data source's data tag names, then no mapping or uploading of a map file is required.

Note. PDF file security has to allow editing and saving for the mapping to be completed. The ability to perform these functions depends on the Adobe version that you are working with.

Note. If no map file exists for your PDF file, selecting the Preview button on the Reporting Tools, XML Publisher, Report Definition, Template page will not show any data because the form fields names do not match XML data tag names.

XML Publisher and Adobe

XML Publisher provides the following features within Adobe: