Using RTF Templates

RTF templates back up most XSL functionality and tin can be designed with robust processing and formatting code.

This section discusses how to:

  • Create RTF templates.

  • Incorporate sub-templates.

  • Include images.

  • Alter default template font.

  • Use drilling URL in RTF template.

To create an RTF template using Microsoft Word:

  1. Download the delivered BI Publisher Template Architect plug-in for offline template blueprint on the Reporting Tools, BI Publisher, Setup, Pattern Helper folio 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, information technology provides many automatic functions that may increase your productivity.

    Notation: Yous tin can choose to automatically view the Word Template Builder Tutorial File, Template Architect for Word Tutorial.dr., upon installing the plug-in. This document offers a quick and informative tutorial of the Template Builder.

    The Template Builder for Give-and-take Tutorial.medico is located in the \Template Architect for Word\doc directory of the binder 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 Information link on the Reporting Tools, BI Publisher, Report Definition page for a specified query.

  3. Load the sample data into the document by selecting Information > Load XML Information from the Microsoft Word Template Builder tool bar bill of fare.

  4. Pattern your template in the RTF document.

    Past using the downloaded XML sample information, yous tin 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 information from the Oracle BI Publisher card using Preview Template or select Preview from the Template Builder toolbar.

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

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

See Report Designer's Guide for Oracle Business Intelligence Publisher, "Creating RTF Templates."

Run into "\\Discussion Template Builder\doc\Give-and-take Template Builder Tutorial.doc."

See Working with Template Blueprint Helpers, Creating Report Definitions.

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

Yous must use specific syntax to:

  • Create sub-templates.

  • Import sub-templates.

  • Telephone call sub-templates.

Run into Maintaining Sub-Templates.

Creating Sub-Templates

Within a single sub-template file, multiple sub-template components can exist available. Showtime and stop 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 exist:

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

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

Importing Sub-Templates

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

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

where sub-template_NAME is the registered sub-template ID in the Content Library.

For instance:

                <?import:psxmlp://STDHEADER?>              

This syntax must exist inNormal text.

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

See Maintaining Sub-Templates.

Calling Sub-Templates

Identify the post-obit 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 proper name of the component that you want to use in the sub-template file.

Note: Principal templates calling nonexistent or inactive sub-templates cause an error message to be issued indicating the reason for the problem. This mistake data is incorporated into Process Scheduler error handling likewise equally into online viewing or previewing of the report.

Encounter Running BI Publisher PeopleSoft Query Reports.

Testing a Sub-Template in Microsoft Word

You lot should examination your template and sub-template using Template Builder before uploading to PeopleTools to brand your sub-template is attainable to your template on the file organisation.

Utilize the post-obit 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, yous tin change the import statement back to make the sub-template bachelor to the principal template in PeopleTools environment:

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

  • Inserting images.

  • Importing images.

  • Rendering paradigm field data (BLOB).

Inserting Images

To direct insert a .jpg, .gif, or .png prototype file into a template:

  1. Select Insert > Moving picture > From File while the template is open up in Microsoft Word.

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

  3. Salvage the template.

Annotation: Oracle recommends that you use the Microsoft Word Insert menu option to insert the image, because the additional backdrop that you demand to set up for the RTF template to correctly generate reports with those images are automatically ready past means of this method. Additionally, dragging and dropping an image onto a template creates a link to the local auto being used and may cause problems when the study is generated.

Importing Images

To import an prototype 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 bodily .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 main template at the appropriate location using the following syntax:

                        <?phone call-template:logo2x.five?>                  

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

See Incorporating Sub-Templates.

Rendering Image Field Data (Hulk)

BI Publisher supports the rendering of BLOB (Base64 encoded) data fields in an XML file.

To render an epitome at runtime, add together the following syntax in a Grade Field Help Text box :

                <fo:instream-strange-object content-blazon="paradigm/jpg"> <xsl:value-of select="IMAGE_ELEMENT"/> </fo:instream-foreign-object>              

where prototype/jpg is the MIME blazon of the image (other MIME types are prototype/gif and prototype/png) and IMAGE_ELEMENT is the element containing BLOB (Base64 encoded) data in the XML file.

Too, yous can specify height and width attributes for the image to set its size in the published study. Y'all can specify meridian and width attributes in inches, pixels, centimeters, or by pct. BI Publisher scales the paradigm to fit the size that you ascertain. The post-obit examples illustrate the attributes for height and width of an image:

Image size attributes in inches:

                <fo:instream-foreign-object content-type="image/jpg" pinnacle="3 in" width="iv in">              

Epitome size attributes in pixels:

                <fo:instream-foreign-object content-blazon="image/jpg"  meridian="300 px" width="400 px">              

Epitome size attributes in centimeters:

                <fo:instream-foreign-object content-type="paradigm/jpg"  height="3 cm" width="4 cm">              

Image size attributes as a percentage of the original dimensions:

                <fo:instream-strange-object content-type="image/jpg"  acme="300%" width="300%">              

Note: BI Publisher supports rendering of images in all output formats—PDF, HTML, RTF, and XLS.

Query and Connected Query data sources containing paradigm fields generate the binary base64 encoded information string for these image fields in the generated XML file provided the query's Image Fields belongings is set correctly.

If yous are using a Query or Connected Query information source, follow these steps for the underlying query containing the paradigm field:

  1. Open up a query definition (Reporting Tools, Query, Query Managing director).

  2. Click the Properties link.

  3. In the Image Fields group box, select Paradigm Information.

  4. Click OK, and save the query.

Encounter Viewing and Editing Query Properties, Setting Image Fields.

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

  • Design fourth dimension

    Set the xdo.cfg for the font. For example, gear up the default font for a specific written report to be Helvetica, size viii: <holding name="rtf-output-default-font">Helvetica:viii</belongings>

  • Runtime

    Use PeopleCode to set the font. For example, gear up the default font for a specific report to be Times New Roman with height 10:

                      &asPropName = CreateArrayRept("", 0); &asPropValue = CreateArrayRept("", 0); &asPropName.Button(""rtf-output-default-font"); &asPropValue.Push button(""Times New Roman:10"); &oRptDefn.SetRuntimeProperties(&asPropName, &asPropValue);                

Drilling URLs are supported in BI 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 BI Publisher study:

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

    See Defining Query Drilling URLs

  2. Create an RTF template.

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

    • Highlight the field where you lot want to place the drilling URL.

    • Select Insert (from the Give-and-take menu), Hyperlink or use Ctrl+K.

    • In the Insert Hyperlink dialog box, enter the URL link in Address field.

      Each URL link should be divers as {URL_FIELD}, where URL_FIELD is the unique field name for the expression that contains a specific drilling URL.

      Image: Insert Hyperlink dialog box

      This example illustrates the fields and controls on the Insert Hyperlink dialog box.

      Insert Hyperlink dialog box
    • Use the Target Frame push button button to select how this URL link will be opened, either in the same window or in the new window

      Notation: The URL value does not need to be added to the report, as long as the unique field proper noun (data file that contains the URL) is mapped to a field in the study.

  4. If the BI Publisher report is run in Process Scheduler using an application engine programme, yous will demand to add additional code to place the procedure instance for the application engine program earlier processing the report. The process instance can be retrieved from the country 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 lot click the drilling URL in the report depending on the drilling URL type, i of the following occurs:

    • For Query URL, the Query results are displayed.

    • For Component URL, the appropriate PeopleSoft page is opened.

    • For External URL, the external page is opened.

See Report Designer'southward Guide for Oracle Business Intelligence Publisher

The data entered in an RTE (Rich Text Enabled) long edit field is stored in the PeopleSoft database every bit formatted HTML data. BI Publisher reports are capable of displaying this HTML formatted information in the output report without requiring any special conversion, as had been required in previous PeopleTools releases. The Oracle BI Publisher core engine natively supports the use of HTML formatted data fields in an RTF report template.

See Understanding Rich Text Editor Data in BI Reporting.

Yous can embed custom Printer Command Language (PCL) lawmaking to enable font selection for secure check printing (that is, to invoke the MICR font used for bank account codes and the cheque'southward secure signature fonts). To embed PCL commands in the file that is printed, use the BI Publisher commands described below in your RTF template in the specific position on the page where you want the PCL commands to render.

RTF templates can exist created with PCL hardcoded lines, which means that a user can directly specify the exact PCL command to exist included at a specific visual position on a PCL page.

In the template, include the following syntax at the position where you desire to print the text.

              <pcl><control><esc/>(pcl command)</control>(text or data field)<sp/> (text or data field)</pcl>            

where:

<pcl></pcl>: indicates the first and end of the custom PCL control sequence and the text to impress using the custom control.

<command></command>: indicates the get-go and stop of the PCL sequence.

<esc/>: include <esc/> betwixt <control> and </control> to escape character (ASCII 0x1b) in the output.

<sp/>: inserts a space.

This example illustrates the PCL command sequence in a RTF template.

Image: RTF template

RTF template with embedded PCL code

RTF template with PCL embedded code

For PCL printing, a report follows the following process:

  • Creating the report

    For PCL outputs, during the report creation process, the RTF template will be populated with the XML data and then a PDF report will be created. In the resulting PDF, the PCL command sequence specified in the RTF template will yet be displayed equally regular text with the XML information replaced in the fields.

    Annotation: Only the PDF report with the embedded PCL command sequence is stored in Study Manager. The PCL file is removed from the server unless the psxp_debug belongings is enabled. However, if a password is required to open up or modify the PCL file, the PCL file will be removed even when the psxp_debug property is enabled.

  • Printing the PDF report

    When the PCL file is sent to a printer where the MICR fonts and the Troy Signatures are installed, the PCL command sequence is replaced with banking company account code and signature.