PDF and Excel export customizations
Analyzer allows you to customize the appearance and content of your PDF and Excel outputs.
The complete list of properties that you can change are in the file comments. You can find the file here at server/pentaho-server/pentaho-solutions/system/analyzer/analyzer.properties.
You can test your customizations to analyzer.properties
in real
time by refreshing the cache for the Analyzer
report you are modifying using the menu action.
PDF and Excel settings
You can customize the appearance of your company's PDF and Excel exports from Analyzer in a number of ways. For example, Analyzer PDF exports can be personalized with a company logo and a cover page, and you can change the default font used to generate PDFs.
Customizing the PDF cover page
You can customize the PDF cover page with the following
analyzer.properties
.
Property | Description |
renderer.pdf.cover.hide | Generates the PDF export without a cover page. (Default value:
false ) |
renderer.pdf.cover.image | Generates the PDF export with a custom cover image. The gray boxes in the title background of the report’s cover page can
be hidden by setting
renderer.pdf.cover.hideTitleBackground The cover image is anchored in the bottom left corner of the page.
The image is not scaled based on the export page size. Specify the file name of
the image and type, no path, and place the image file in the
If you want to design a cover page with a specific page size and
image orientation, then you can override the default renderer.pdf.cover.image. For each page size and orientation (see
below), the provided image width and height completely fill the cover page. When
setting the property to use for the size and orientation, you should replace the
“width x height” value in the property with the file name and type of the image,
for example renderer.pdf.cover.image.letter.landscape
|
Customizing the PDF logo
You can customize the PDF logo with the following
analyzer.properties
.
Property | Description |
renderer.logo.image | Adds a custom logo image to a PDF export. The logo image is placed on the
bottom left corner of every page. This image should have no padding and a white
background. If the PDF includes a cover page, the logo is placed bottom center on
that page. You need to specify the image file name and type, no path, and place
the image file in the
/pentaho-solutions/system/analyzer/resources/ directory.If you want to set a logo image specific to a page size, then you can override the default renderer.logo.image property with the desired size value:
|
renderer.logo.image.hideOnCover | Hides the logo on the cover page when set to
true . Useful when the cover page already includes a custom
background image. (Default value:
false ) |
Set default fonts for PDF export
Procedure
Stop the Pentaho User Console and Pentaho Server.
Navigate to the pentaho/server/pentaho-server/pentaho-solutions/system/analyzer/ directory and open the analyzer.properties file with any text editor.
Uncomment the renderer.pdf.font.path line.
renderer.pdf.font.path=C:/WINDOWS/Fonts/MSGOTHIC.TTC,1
Replace the value of this line with the TrueType font or collection that you want to use as the default. If you are specifying a collection, you must put a ,1 after the font name, as shown in the above example. This does not apply to individual fonts (TTF files).
renderer.pdf.font.path=/usr/share/fonts/truetype/freefont/FreeSans.ttf
Save and close the file, and restart the Pentaho Server.
Results
Removing report attributes
PDF and Excel exports from Analyzer, by default, include information such as the report creator, report
name, folder location, filters used, and fields used. As shown in the table below, you can
exclude some or all of this information from an export by setting the value of its property
to true
in analyzer.properties
.
Property | Description |
renderer.metadata.hide.aboutThisReport | Removes the “About this report” section. (Default value =
false ) |
renderer.metadata.hide.filterSummary | Removes the “Filter summary” section. (Default value =
false ) |
renderer.metadata.hide.fieldsUsed | Removes the “Fields used” section. (Default value =
false ) |
You can retain the "About This Report" section and customize the items it contains by setting the value for the associated property, as described in the following table.
Property | Description |
renderer.metadata.hide.aboutThisReport.name
| Removes the “report name” field. (Default value =
false ) |
renderer.metadata.hide.aboutThisReport.description | Removes the “report description” field. (Default value =
false ) |
renderer.metadata.hide.aboutThisReport.creator | Removes the “report creator” field. (Default value =
false ) |
renderer.metadata.hide.aboutThisReport.location | Removes the “report location” field. (Default value =
false ) |
renderer.metadata.hide.aboutThisReport.createdOn | Removes the “creation date” field. (Default value =
false ) |
renderer.metadata.hide.aboutThisReport.cube | Removes the “cube annotation” field. (Default value =
false ) |
Removing a data table and report worksheet
PDF and Excel exports of an Analyzer chart report, by default, also include a data table and report
worksheet. You can exclude the data table and / or the report worksheet from PDF and Excel
exports of a chart report by setting the value of the associated property to
true
, as described in the following table.
Property | Description |
renderer.pdf.dataTable.hide | Excludes the data table from a chart report exported to PDF. (Default value =
false ) |
renderer.excel.dataTable.hide | Excludes the data table and report worksheet from a chart report exported to
Excel. (Default value =
false ) |
Creating custom headers and footers
Headers and footers can be customized to include static text such as disclaimers
and copyright information, or dynamic text such as the current user and date. These header
and footer templates, defined in Analyzer's
resource message files, can be localized into different languages. Analyzer's resource message files are in the
pentaho-solutions/system/analyzer/resources
directory. The base resources
file is messages.properties
. The table below describes each message
file.
localizationService.cache.resource.bundle=false
in the
analyzer.properties
file for immediate pickup by Analyzer of changes to the
message*.properties
files. For performance reasons, this setting should
only be performed in development environments.
Message file | Description |
RendererPDFHeaderTemplate | Header template that appears in top-left corner of a PDF.
(Default value = %report ) |
RendererPDFFooterTemplate | Footer template that appears in bottom-right corner of a PDF.
(Default value = Page %pageCurrent of %pageTotal ) |
RendererExcelHeaderTemplate | Header template that appears on the first line of each Excel worksheet. |
RendererExcelFooterTemplate | Footer template that appears after the content on each Excel worksheet. |
When a PDF and Excel export is generated, the tokens described in the table below are replaced in the template text.
Token | Description |
%report | Current report name. |
%user | Username of session exporting the report. |
%date | Date and time when report was exported. |
%pageCurrent | Current page number (PDF only). |
%pageTotal | Total page number (PDF only). |
Theming a pivot table
If you modify the system theme or add a new theme that changes the styles on the
HTML pivot table, the PDF and Excel pivot tables can inherit the same background and font
colors. To enable this feature, renderer.dataTable.inheritTheme
must be set
to true
in analyzer.properties
.
The following pivot table items can be themed in PDF and Excel exports.
When generating the PDF or Excel export, the following CSS rule sets are used by the theme-specific CSS file to customize the pivot table.
Number | Pivot table item | CSS selector | CSS declarations A | Example |
1 | Level headers |
.pivotTable .columnHeaders .columnheading |
background-color color |
Education Level Name Product Family |
2 | Level member property headers |
.pivotTable .columnHeaders .columnPropHeading |
background-color color | Yearly Income |
3 | Measure headers |
.pivotTable .columnHeaders .metric |
background-color color | Unit Sales |
4 | Level members |
.pivotTable .columnHeaders .member |
background-color |
Graduate Degree Food 1997 |
5 | Total members and cells |
.pivotTable .cells .colSubTotal |
background-color | Cells under Graduate Degree Total and Food Total |
6 | Grand total cells |
.pivotTable .cells .colGrandTotal |
background-color | Cells under Grand Total |
A CSS declarations for background-color and color must be
specified using hex notation, such as |
The example below shows a pivot table that was themed by modifying the ruby theme
in the pentaho-solutions/system/analyzer/styles/themes/ruby/anaRuby.css
file.
If you are customizing the HTML pivot table, use the following reference which
lists the corresponding CSS selectors for each pivot table item. Many of these items also
support :hover
selection style changes. The CSS rule sets used to style the
PDF and Excel pivot tables are a subset of the CSS selectors listed below.
<cache>
to false
in the
pentaho-solutions\system\analyzer\settings.xml
file.
Number | Pivot table item | CSS selectors |
1 | Level headers |
.pivotTable .columnHeaders .columnheading .pivotTable .rowLabelHeaders TD |
2 | Level member property headers |
.pivotTable .columnHeaders .columnPropHeading .pivotTable .rowLabelHeaders .rowPropHeader |
3 | Measure headers |
.pivotTable .columnHeaders .metric |
4 | Level members |
.pivotTable .columnHeaders .member .pivotTable .rowHeaders .inner .pivotTable .rowHeaders .outer |
5 | Total members and cells |
.pivotTable .columnHeaders .memberSubTotal .pivotTable .rowHeaders .subTotal .pivotTable .cells .colSubTotal .pivotTable .cells .rowSubTotal |
6 | Grand total cells |
.pivotTable .cells .colGrandTotal |
Set pivot table minimum font size
Procedure
Navigate to the
pentaho/server/pentaho-server/pentaho-solutions/system/analyzer/
directory and open theanalyzer.properties
file with any text editor.Locate renderer.pdf.font.table.min.
renderer.pdf.font.table.minSize=3
Replace the value with the smallest font size that you want used for exported pivot tables.
Save and close the file.
Test your changes by refreshing the cache or by restarting the Pentaho Server.
Results
Customize the logo on Excel exports
To add a custom logo, follow the steps below.
Procedure
Navigate to the
pentaho/server/pentaho-server/pentaho-solutions/system/analyzer/
directory and open theanalyzer.properties
file with any text editor.Locate renderer.excel.logo.image
renderer.excel.logo.image=
Specify the image file name and type, with no path.
For example,my_favorite_logo.jpg
Place the image file in the
/pentaho-solutions/system/analyzer/resources/
directory.Save and close the file.
Test your changes by refreshing the cache or by restarting the Pentaho Server.
Results
Customize the font on Excel exports
To change the font, follow the steps below.
Procedure
Navigate to the
pentaho/server/pentaho-server/pentaho-solutions/system/analyzer/
directory and open theanalyzer.properties
file with any text editor.Locate renderer.excel.font.name.
renderer.excel.font.name=Verdana
Specify the name of the font.
(Default
= Verdana
Save and close the file.
Test your changes by refreshing the cache or by restarting the Pentaho Server.
Results
Your Excel exports from Analyzer will now use the font.