Implementation Guide for Oracle Self-Service E-Billing > Using the Reporting Engine > Components Used by the Reporting Engine >

Creating a PDF Template for Reporting


Oracle Self-Service E-Billling provides preconfigured PDF templates for reporting (listed in Table 39). You can also define additional templates to present other reports in PDF.

To create a PDF template for reporting

  1. Download and install Oracle Business Intelligence(BI) Publisher:

    http://www.oracle.com/technetwork/middleware/bi-publisher/downloads/index.html

  2. Download the existing or new report in XML format and use this file to create a new PDF template (an RTF) file. See the Template Builder for Word Tutorial in Oracle BI Publisher for assistance creating the RTF template. Training is also available on the Oracle Technology Network.
  3. Using the toolbar in Oracle BI Publisher, load the report XML file.
  4. Use Microsoft Word formatting and Oracle BI Publisher insert functions to add fields, tables, charts, and conditional formatting to the template appropriate for your organization. Save the file as an RTF.
  5. After you create the template file filename.rtf (where filename is the name of the report template), copy the file to EDX_HOME/template/pdf/filename_ll_CC.rtf, where ll_CC is your default system language code, from the EDX_SYS_LANG table in the OLTP database.
  6. If the application supports multiple languages, you can translate your template and name it using the different language code. For example, if you support Spanish (es_ES) as well as American English (en_US), create a template called filename_en_US.rtf and create a translated template called filename_es_ES.rtf.
  7. In EDX_HOME/config/rpt/*.xml, add the following line in <downloadlist> tag for the new report:

    <download name="global.dropdown.pdf" type="pdf" description="PDF download" templateId="PDF_TEMPLATE"/>

  8. Add the following line in the <templates> tag for the report, where ll_CC is the default language:

    <template id="PDF_TEMPLATE" downloadable="true" name="template/pdf/filename_ll_CC.rtf"/>

    NOTE:  You do not need to specify additional languages in the XML. Oracle Self-Service E-Billling finds the template that corresponds with the selected language.

Predefined Context Variables

When you call the IReportActionHelper.execute() method to generate reports, the reporting engine puts a list of predefined context variables into the report context, which are then available to the Velocity template.

Table 40 lists some of the variables that you can use. If the overwrite flag is Y, then you can pass a variable with the same name through ReportContext to overwrite the default values set by ReportActionHelper.

Table 40. Predefined Context Variables
Name
Type
Over write?
Description

form

Action Form

No

This is the struts ActionForm object currently being processed.

gifDir

String

Yes

The directory where the image files used by report are saved, for example, the paging arrow images. It is default to "_assets/images.

link

String

No

This is the URL link base of this page and it is equivalent to the html <base> tag. The default value is:

HttpServletRequest.getContextPath() + HttpServletRequest.getServletPath()

The URL is similar to the following:

http://host:port/<web-root>/report.do

user

IUser of UMF

Yes

The current user logged in. IUser is passed in as a session variable, USER_PROFILE. If it is not in the session, Oracle Self-Service E-Billling does not put it in the context. User is just used for query purposes and its absence does not affect the functionality of the reporting. For example, for some reason, you might not use UMF IUser and you can use your own user object.

NOTE:  Some templates, like report_header.vm, might expect IUser to get user name and if you do not supply IUser, the template might not display user name properly.

contact Profile

IContactProfile of UMF

Yes

The contactProfile is a profile of IUser named as contact_profile. Oracle Self-Service E-Billling uses it to retrieve the user's first name and last name and is currently only used in report_header.vm. The absence of this information does not affect the function of Reporting Engine.

locale

String

Yes

The default value set by ReportActionHelper is the from http session: session.getAttribute("org.apache.struts.action.LOCALE").

NOTE:  This locale is put into session by the Struts framework.

reportId

String

No

The report ID of current report.

transformer

ITransformer

No

You can use transformer object to do work such as formatting data.

Never call ITransformer.writeTemplate() in the template.

reportConfig

IReportConfig

No

Represents the report configuration.

dataSourceConfig

IDataSourceConfig

No

Represents the data source configuration.

dataSource ColumnConfigs

A list of IDataSource ColumnConfig

No

Represents the list of data source column configurations.

transformerConfigs

ITransformerConfig

No

Represents the transformer configuration.

 

transformer ColumnConfigs

A list of ITransformer ColumnConfig

No

Represents the list of transformer column configurations.

operationGroup Configs

A list of IOperation GourpConfig

No

Represents the list of operation groups defined inside calculator for the transformer.

chartConfigs

A list of IChartConfig

No

Represents the list of chart configurations for the transformer.

templateConfigs

A list of ITemplateConfig

No

Represents the list of template configurations for the transformer.

rowlist

IReportList

No

Represents the original data retrieved from the data source. The data could be sorted and so the order could be changed. Though you cannot overwrite this variable, you can certainly change the content of the list.

groupSet

Set

No

To support grouping, the transformer maintains a Map of List objects. In the case of no grouping, there is only one entry in the map, the key is the report name, and the value is the List returned from data source; In the case of grouping, the original list from the data source is regrouped into multiple lists. Each list has the same group value, and the group value becomes the map key. This variable is looped through in report_body.vm to build the HTML table.

dataMap

Map

No

This is the map of group keys to the List as described previously.

reportContext

ReportContext

No

The ReportContext object used to generate reports.

NOTE:  Note: You cannot overwrite reportContext, but you can change the content.

URLEncoder

URLEncoder

No

This is a wrapper class around java.net.URLEncoder, because Velocity cannot invoke a static method directly through class name, and java.net.URLEncoder does not have a constructor. Use this class to encode the parameter values you passed through the URL.

Implementation Guide for Oracle Self-Service E-Billing Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Legal Notices.