Added by Steven Barkdull, last edited by Steven Barkdull on Jun 10, 2008  (view change)

Labels:

documentation documentation Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Applying a Template to Your Report

To apply a template to your report, select a template from the Templates list on the first page of the wizard.

Location of the Template definition files

The Adhoc Reporting template definitions are in the system folder of the solution repository. More specifically, if you are using the Pentaho Preconfigured Install (PCI), the Adhoc Reporting templates are in:

/pentaho-solutions/system/waqr/templates

Creating Your Own Template

To create your own template, start by creating a new folder in /pentaho-solutions/system/waqr/templates. The fastest way to create your own template may be to copy and modify one of the templates that ships with the PCI. Each template definition has its own folder (Basic, Fall, Pentaho, Spring, etc.) Each folder must have the following files:

  1. index.xml: which identifies:
    • the name of the template as it will be displayed in the Adhoc Reporting UI
    • the name of the image file which will be displayed in the Adhoc Reporting UI
    • whether the template is "visible" or not in the Adhoc Reporting UI
    • the name of the jfreereport template file
    • the name of the xreportspec template file

(the contents of the index.xml file should be fairly self explanatory)

  1. An image file, for instance thumbnail.png. This image file is displayed in WAQR when the template is selected from the template list.
  1. A jfreereport template file, for instance jfreereport-template.xml. This template contains information that is used to specify:
    • report header/footer
    • page header/footer
    • header/footer font name
    • header/footer font size
    • header/footer text color
    • header/footer alignment
    • watermark

The Adhoc Reporting Interface's field (pageheader, pagefooter, reportheader and reportfooter) values are substituted within the template with the parser-config tags

${pageheader}

${pagefooter}

${reportheader}

${reportfooter}

  1. An xreportspec template file, for instance report.xreportspec. (This is a Pentaho Report Design Wizard report file.)
  • This template allows the following to be specified within a report:
    • Group Header/Footer Font Type, Font Size, Font Style, Font Color and Background Color.
<group-header-font-name>Arial</group-header-font-name>

<group-header-font-style>1</group-header-font-style>

<group-header-font-size>12</group-header-font-size>

<group-header-font-color>black</group-header-font-color>

<group-footer-font-name>Arial</group-footer-font-name>

<group-footer-font-style>1</group-footer-font-style>

<group-footer-font-size>12</group-footer-font-size>

<group-footer-font-color>black</group-footer-font-color>

    • Column Header Font Type, Font Size, Font Style, Font Color and Background Color
<column-header-font-style>0</column-header-font-style>

<column-header-font-size>10</column-header-font-size>

<column-header-font-color>#ffffff</column-header-font-color>

<column-header-gap>1</column-header-gap>

<column-header-top-gap>1</column-header-top-gap>

<use-column-header-background-color>true</use-column-header-background-color>

<column-header-background-color>#000000</column-header-background-color>

    • Details Font Type, Font Size, Font Style and Font Color
<items-font-name>Arial</items-font-name>

<items-font-style>0</items-font-style>

<items-font-size>8</items-font-size>

<items-font-color>#000000</items-font-color>

    • Gridlines (Horizontal or Vertical) enabled, line size and line color on the details band
<use-horizontal-gridlines>false</use-horizontal-gridlines>

<use-vertical-gridlines>false</use-vertical-gridlines>

<horizontal-gridlines-color>#c0c0c0</horizontal-gridlines-color>

<vertical-gridlines-color>#c0c0c0</vertical-gridlines-color>

    • Row Band enabled and color of band.
<use-row-banding>true</use-row-banding>

<row-banding-color>#e7e7e7</row-banding-color>

    • Grand Summary Label Text, Background and alignment.
<grand-totals-label>Grand Total</grand-totals-label>

<grand-totals-horizontal-alignment>left</grand-totals-horizontal-alignment>

<use-dummy-group-footer-background-color>true</use-dummy-group-footer-background-color>

<dummy-group-footer-background-color>#000000</dummy-group-footer-background-color>

To create your own template, you may want to begin by copying and modifying one of the existing templates. Much of the contents of the 2 template definition files (jfreereport-template.xml and report.xreportspec) should be obvious.

Keep in mind that, with the exception of the index.xml file, you can name the other files anything you want. However these names must be identified in the index.xml file.

Localizing Templates

TODO

Caveat Regarding Changing Templates in an Existing Report

If you edit an existing report, and change the template applied to the report, the following properties from the template will overwrite what you have specified in your report:

  • Report Description
  • Page Orientation
  • Page Format

These properties are specified on page 4 of the wizard. So after changing templates, be sure to check page 4 of the wizard to make sure that it contains the information you wanted.

Caveat Regarding Changing a Template Definition

Since templates are applied to a report when the report is created, you cannot change a template definition and expect the new properties to show up in existing reports that use this template. In order to apply the new template to your report, you will have to edit the report, leave the specified template selected, and save the report.