Pentaho 简明教程
Pentaho - Overview
What is Pentaho Reporting?
Pentaho Reporting 是一个套件(工具集合),用于创建关系和分析报表。使用 Pentaho,我们可以将复杂的数据转换成有意义的报表,并从中获取信息。Pentaho 支持以 HTML、Excel、PDF、文本、CSV 和 xml 等各种格式创建报表。
Pentaho Reporting is a suite (collection of tools) for creating relational and analytical reporting. Using Pentaho, we can transform complex data into meaningful reports and draw information out of them. Pentaho supports creating reports in various formats such as HTML, Excel, PDF, Text, CSV, and xml.
Pentaho 可接收不同数据源中的数据,包括 SQL 数据库、OLAP 数据源,甚至 Pentaho Data Integration ETL 工具。
Pentaho can accept data from different data sources including SQL databases, OLAP data sources, and even the Pentaho Data Integration ETL tool.
Features of Pentaho
Pentaho Reporting 主要包括报告引擎、报表设计器和商业智能 (BI) 服务器。它装载了以下特性:
Pentaho Reporting primarily includes a Reporting Engine, a Report Designer, a Business Intelligence (BI) Server. It comes loaded with the following features −
-
Report Designer − Used for creating pixel perfect report.
-
Metadata Editor − Allows to add user-friendly metadata domain to a data source.
-
Report Designer and Design Studio − Used for fine-tuning of reports and ad-hoc reporting.
-
Pentaho user console web interface − Used for easily managing reports and analyzing views.
-
Ad-Hoc reporting interface − Offers a step-by-step wizard for designing simple reports. Output formats include PDF, RTF, HTML, and XLS.
-
A complex scheduling sub-system − Allows users to execute reports at given intervals.
-
Mailing − Users can email a published report to other users.
-
Connectivity − Connectivity between the reporting tools and the BI server, which allows to publish the content directly to the BI server.
Pentaho - Installation
现在,让我们了解如何安装和配置 Pentaho Reporting Designer。
Let us now learn how to install and configure Pentaho Reporting Designer.
Prerequisites
Pentaho Reporting 引擎需要 Java 环境。因此,在安装 Pentaho Reporting 之前,请确保系统中安装了 Java。根据操作系统平台,使用下表中的命令验证 Java 安装情况。
The Pentaho Reporting engine requires Java environment. Therefore, before installing Pentaho Reporting, make sure you have Java on your system. Based on the platform you are working on, use a command from the following table to verify your Java installation.
OS |
Command |
Output |
Windows |
Open command prompt: >java -version |
java version "1.7.0_60" Java™ SE Runtime Environment (build 1.7.0_60b19) Java HotSpot™ 64-Bit Server VM (build 24.60-b09, mixed mode) |
Linux |
Open terminal: $ java –version |
java version "1.7.0_60" OpenJDK Runtime Environment (rhel-2.3.10.4.el6_4x86_64) OpenJDK 64-Bit Server VM (build 60.7-b01, mixed mode) |
Mac OS |
Open terminal: $ java –version |
java version "1.7.0_60" Java™ SE Runtime Environment (build 1.7.0_60b19) Java HotSpot™ 64-Bit Server VM (build 24.60-b09, mixed mode) |
如果系统中未安装 Java,请使用以下链接下载并安装 Java: Download and Install Java
If you do not have Java installed on your system, then download and install the same using the following link Download and Install Java.
Download Pentaho Reporting
使用以下链接下载 Pentaho Reporting Designer 最新版本。本教程使用版本 3.7.0。
Download the latest versions of Pentaho Reporting Designer using the following links. For this tutorial, we are using version 3.7.0.
OS |
URL link for download Pentaho Report Designer |
Windows |
|
Linux |
|
Mac OS |
Install Pentaho Reporting
下载文件后,您会找到一个名为 prd-ce-3.7.0-stable 的 Pentaho Reporting Designer 存档文件。该存档文件应按照下表所述的方式提取。
After downloading the files, you will find an archive file of Pentaho Reporting Designer named prd-ce-3.7.0-stable. That archive should be extracted as explained in the following table.
OS |
Installation Instructions |
Windows |
Extract the downloaded file prd-ce-3.7.0-stable.zip using an Unzip tool. Copy the extracted folder (prd-ce-3.7.0-stable) into c:\ directory. Open c:\prd-ce-3.7.0-stable\report-designer directory. Start Pentaho Reporting Designer by double-clicking on the reportdesigner.bat file. |
Linux |
Extract the downloaded file prd-ce-3.7.0-stable.tar.gz using the following command. $ tar –zxvf prd-ce-3.7.0-stable.tar.gz Copy the extracted folder (prd-ce-3.7.0-stable) into “/usr/local/” directory using the following command. # mv prd-ce-3.7.0-stable /usr/local/ Open “/usr/local/prd-ce-3.7.0-stable/report-designer” directory and start Pentaho Reporting Designer using the following commands. $ cd /usr/local/prd-ce-3.7.0-stable/report-designer $ report-designer.sh |
Mac |
Extract the downloaded file prd-ce-370-stable.tar.gz.You will find that folder in the Finder.Copy and Paste Pentaho Report Designer from Finer into /Application folder.Start Pentaho Report Designer using the following command.$ report-designer.sh |
Install Database Driver
Pentaho Reporting Designer 需要数据库连接才能生成关系报告,因此您需要有 JDBC 驱动程序才能与数据库通信。默认情况下,Pentaho 提供一些不同供应商的 JDBC 驱动程序,以支持不同的数据库,例如 MySQL、H2、HypersonicSQL、Hive 等。
Pentaho Reporting Designer requires a database connection to generate relational reports, therefore you need to have a JDBC driver to communicate with the database. By default, Pentaho provides some JDBC drivers of different vendors to support different databases such as MySQL, H2, HypersonicSQL, Hive, etc.
所有默认数据库驱动程序均可在 Pentaho Reporting Designer 的 /lib/ directory 中获得。如果您想要使用任何其他数据库,请下载相应的 JDBC 驱动程序并将其复制到 Pentaho Reporting Designer 的 /lib/ 目录中。否则,您可以使用 JDK 附带的 JDBC-ODBC 桥接驱动程序来使用 ODBC 驱动程序,此桥接驱动程序 (JDBC-ODBC) 适用于所有数据库服务器。
All the default database drivers are available in the /lib/ directory of the Pentaho Reporting Designer. If you want to use any other database, then download the respective JDBC driver and copy it into the /lib/ directory of Pentaho Reporting Designer. Otherwise, you can use ODBC driver via JDBC-ODBC bridge driver that comes with the JDK and this bridge driver (JDBC-ODBC) is suitable for all database servers.
本教程使用 MySQL 数据库服务器及其各自的驱动程序已随 Pentaho lib(Pentaho Reporting Designer 文件的 /lib/ 目录)文件下载。
For this tutorial, we are using MySQL database server and its respective drivers are already downloaded with the Pentaho lib (/lib/ directory of the Pentaho Reporting Designer) files.
Install Additional Fonts
Pentaho Reporting 使用不同的字体在报告中显示文本。在生成 PDF 文件时,Pentaho Reporting 引擎需要访问物理字体文件。报表引擎会在系统相关字体路径中搜索以查找所有可用的字体。除了这些字体之外,Java 运行时环境可能会提供其他字体,具体取决于 Java 和操作系统版本。
Pentaho Reporting uses different fonts to display text inside reports. When generating PDF files, the Pentaho Reporting Engine needs access to the physical font files. The reporting engine searches system dependent font paths to locate all usable fonts. In addition to these fonts, your Java Runtime Environment may offer additional fonts, depending on your Java and Operating system version.
如果您计划创建 PDF 文档并嵌入字体,请确保仅使用报表引擎可实际访问的字体。
If you plan to create PDF documents with embedded fonts, please ensure that you only use fonts that are physically accessible for the reporting engine.
无论操作系统如何,位于 JRE/lib/fonts/ 中的所有字体文件均始终可用于所有导出。
Regardless of your operating system, all font files located in JRE/lib/fonts/ are always usable for all exports.
Pentaho - Navigation
本章将提供一个有关 Pentaho 中提供的用户界面的简要介绍,以及如何在其中导航。
This chapter will provide a brief introduction on the user interfaces available in Pentaho and how to navigate through them.
The Welcome Screen
欢迎界面提供了两种方法来创建不同类型的报表。这两个选项是 Report Wizard 和 New Report 。
The welcome screen provides two ways to create reports of different types. Those two options are Report Wizard and New Report.
-
Report Wizard − It provides an easy-to-use four steps process that walk you through creating a new Report.
-
New Report − If you choose this option, then you can create customized reports based on your requirement.
Pentaho 有一组示例报表,可帮助您了解如何使用某个特定报表设计器。以下屏幕截图显示了 Pentaho 的欢迎页面。
Pentaho has a set of sample reports to help you figure out how to use a certain Report Designer. The following screenshot shows the welcome page of Pentaho.

The Main Toolbar
主工具栏位于窗口的顶部。请查看以下屏幕截图——最大化框是主工具栏。它包含执行以下操作的按钮——新建文件、打开文件、保存文件、发布报表、添加数据源、运行报表、选择对象、撤销、重做、剪切元素、复制元素、粘贴元素、删除选定的元素和切换字段选择器面板。
The main toolbar is at the top of the window. Take a look at the following screenshot – the maximized box is the main tollbar. It contains button to carry out the following actions − New File, Open File, Save File, Publish the Report, Add Data Source, Run the Report, Select Object, Undo, Redo, Cut Element, Copy Element, Paste Element, Delete Selected Element, and Toggle the Field-Selector Palette.

The Report Workspace
工作区是我们可以设计报表的中央工作区域。请查看以下屏幕截图——中间的白色区域是工作区。它分为五个区域——页眉、报表页眉、详细信息、报表页脚和页脚。
The workspace is the main working area where we can design the reports. Take a look at the following screenshot – the white area at the center is the workspace. It is divided into five bands − Page Header, Report Header, Details, Report Footer, and Page Footer.
-
Page Header − You can use any type of data here that is suitable to print on top of every report page. It does not allow any dynamic values or page breaks.
-
Report Header − The second band from top is the Report Header. It contains the report elements. It appears once per report, that is on the first page of the report.
-
Details − The Details band is the largest portion of your page because most of the report data is presented in this area.
-
Report Footer − Just like the Report Header, the Report Footer appears just once per report, that is on the last page of the report.
-
Page Footer − The last band is the Page Footer which appears at the absolute bottom of every page in the report.
您还可以为各种报表元素创建组。每个组在工作区内都有自己的页眉和页脚区域。
You can also create groups for various report elements. Each group has its own Header and Footer bands in the workspace.

The Structure Pane
结构选项卡与报表设计器右上角区域中的数据选项卡共用一个窗格。请查看以下屏幕截图;它显示了报表工作区中包含的每个元素的确切层次结构。
The structure tab shares a pane with the Data tab in the upper right section of the Report Designer. Take a look at the following screenshot; it shows the exact hierarchy of every element included in a report workspace.

The Data Pane
数据窗格使您能够添加数据源并查看每份报表中的各个查询、函数和参数。窗格顶部的三个按钮分别用于添加新的数据源、函数和参数。
The Data Pane enables you to add data sources and view individual queries, functions, and parameters in each report. The three buttons at the top of the pane are meant for adding new data sources, functions, and parameters, respectively.
-
Datasources − All the data sources and queries that you have defined for the current report will be listed here. If you want to add a new data source, then rightclick on the leftmost button (the yello cylinder) click add.
-
Functions − All the functions (mathematical and conditional) elements that you added to a report will be listed in this category. You can add a function by clicking the (fx) button.
-
Parameters − You can add a parameter to your report, which will enable the report readers to customize the content of the output.
请查看以下屏幕截图。
Take a look at the following screenshot.

The Style Pane
样式窗格显示结构窗格中任何给定项目的所有可视和位置样式选项。单击任何结构元素,样式窗格的组成将调整为显示按组列出的所有可用样式属性。仔细查看以下屏幕截图。
The style pane displays all the visual and positional style options for any given item in the structure pane. Click any structure element, and the composition of the Style Pane will be adjusted to show all the available style properties listed by group. Take a look at the following screenshot.

The Attribute Pane
属性窗格显示结构窗格中任何给定项目的低级属性的所有输入和输出选项。
The Attribute Pane displays all the low-level properties, and input and output options for any given item in the Structure Pane.

The Palette
调色板包含用于生成报表的所有元素。要添加元素,单击布局带以选择它,然后从调色板拖放一个元素到选定的带中。我们在下表中解释了每个报表元素的作用。
The palette contains all the elements that you can use to build a report. To add an element, click on a layout band to select it, then drag and drop an element from the palette to the selected band. We have explained the role of each of the report elements in the following table.
Element icon |
Element name |
Description |
Label |
A static text string. It cannot change dynamically. |
|
Text-Field |
A Textual report element and changed dynamically based on the query. |
|
Number-Field |
Displays dynamic numerical data from a query. |
|
Date-Field |
Handles date information form a query. |
|
Message |
An element that combines multiple static and dynamic report elements. |
|
Resource-label |
Static text string that maps to a resource bundle |
|
Resource-Field |
Dynamic text string that maps to a resource bundle, allowing you to localize any database field. |
|
Resource - Message |
Dynamic text string that concatenates data from multiple types, and dynamically maps to a resource bundle. |
|
Image-Field |
A reference to an image stored in a database. |
|
Image |
A static image embedded into a report. |
|
Ellipse |
A vector graphical element in the shape of eclipse. |
|
Rectangle |
A vector graphical element in the shape of rectangle. |
|
Horizontal-Line |
A vector graphical line, drawn horizontally. |
|
Vertical-Line |
A vector graphical line, drawn vertically. |
|
Survey-Scale |
A simple sliding scale chart element. |
|
Chart |
A chart or graph that shows your query results graphically. |
|
Simple-Barcodes |
A barcode chart element. |
|
Bar-Sparkline |
A Bar Sparkline chart element. |
|
Line-Sparkline |
A line Sparkline chart element. |
|
Pie-Sparkline |
A Pie Sparkline chart element. |
|
Band |
A method of grouping elements. |
|
Sub-Report |
An element that references another report. |
|
Table-Of-Content |
A table of content report element. |
|
Index |
An Index report element. |
看看下面的截图;左侧的高亮框是报表元素的调色板。
Take a look at the following screenshot; the highlighted box on the left side is the palette of reporting elements.

Pentaho - Data Sources & Queries
在本章中,我们将通过一个示例来了解如何使用 Pentaho Reporting Designer。我们将创建一个员工数据库报表,以便对每位员工进行快速概览。我们将通过添加数据源和向 Pentaho Designer 传递查询来创建我们的第一个报表。
In this chapter, we will learn to use the Pentaho Reporting Designer by taking an example. We will create a report on the employee database to produce a quick overview of every employee. We will create our first report by adding a data source and passing queries to the Pentaho Designer.
在使用 Pentaho Report Designer 之前,创建一个名为 employeedb 的数据库,并在该数据库中使用以下查询创建一个名为 employee 的表。
Before using Pentaho Report Designer, create a database named employeedb and in that database, create a table named employee using the following query.
CREATE TABLE 'employee' (
'id' integer NOT NULL,
'name' varchar(20),
'designation' varchar(20),
'department' varchar(20),
'age' integer,
PRIMARY KEY ('id')
)
将以下记录插入表中。
Insert the following records into the table.
Id |
Name |
Designation |
Department |
age |
1201 |
'satish' |
'writer' |
'Tuto_Write' |
24 |
1202 |
'krishna' |
'writer' |
'Tuto_Write' |
26 |
1203 |
'prasanth' |
'php developer' |
'Tuto_develop' |
28 |
1204 |
'khaleel' |
'php developer' |
'Tuto_develop' |
29 |
1205 |
'raju' |
'HTML developer' |
'Tuto_develop' |
24 |
1206 |
'javed' |
'HTML developer' |
'Tuto_develop' |
22 |
1207 |
'kiran' |
'Proof Reader' |
'Tuto_Reader' |
28 |
1208 |
'pravenya' |
'Proof Reader' |
'Tuto_Reader' |
30 |
1209 |
'mukesh' |
'Proof Reader' |
'Tuto_Reader' |
28 |
1210 |
'sai' |
'writer' |
'Tuto_writer' |
25 |
1211 |
'sathish' |
'graphics designer' |
'Tuto_designer' |
26 |
1212 |
'viswani' |
'graphics designer' |
'Tuto_designer' |
24 |
1213 |
'gopal' |
'manager' |
'Tuto_develop' |
29 |
1214 |
'omer' |
'manager' |
'Tuto_writer' |
32 |
1215 |
'shirjeel' |
'manager' |
'Tuto_Reader' |
32 |
如果你想操作表中包含的数据,最好的选择是使用 SQL。但如果你想根据数据创建报表,那么 Pentaho Reporting 是最佳选择。我们的任务是向 Pentaho Reporting 设计器工具传递一个 SQL 查询,并选择相应的字段(它们显示在报表中),然后在报表页的“详细信息”中显示它。
If you want to manipulate the data contained inside the table, the best choice is to use SQL. But if you want to create a report based on the data, Pentaho Reporting is the best option. Our task is to pass an SQL query to the Pentaho Reporting designer tool and select respective fields (which are presented in the report) and present it on the Details of the report sheet.
在继续之前,请确保你精通 Pentaho 中提供的所有导航选项(在上一章中进行了说明)。既然我们有一个数据源,那么让我们进一步了解如何使用 Pentaho 生成专业报表。
Before moving further, make sure you are well versed with all the navigation options available in Pentaho (explained in the previous chapter). Now that we have a data source, let us proceed further and try to understand how to use Pentaho to generate a professional report.
Steps to Generate a Report using Pentaho
按照以下步骤从头开始创建报表,无需使用报表设计向导。
Follow the steps given below to create a report from scratch without using Report Design Wizard.
Step 1 : Create a New Report
你可以通过单击欢迎窗格上的“新建报表”或转到“文件 → 新建”来创建新的报表定义文件。
You can create a new report definition file by clicking "new report" on the welcome pane or go to "File → new".

Step 2 : Add a Data Source
右侧的结构窗格提供报表的可视元素的视图。数据源的定义将在 Data 标签上;它允许定义报表数据来自何处以及在报表处理期间如何处理此数据。
The Structure Pane on the right-hand side provides a view of the visual elements of a report. The definition of the data source will be on the Data tab; it allows to define where the report data comes from and how this data is processed during the report processing.
报表通常以表格的形式显示由数据源提供的的数据,而报表定义定义如何对报表进行格式化或打印。如以下截图所示,从 structure pane 中选择 Data tab 。
A report generally displays the data that is supplied by a data source in the form of a table, whereas a report definition defines how the report is to be formatted or printed. As shown in the following screenshot, select the Data tab from structure pane.

在数据标签中,右键单击数据集并选择 JDBC 以添加数据源。通常,在选项列表中,你可以根据要求选择任何其他选项。这意味着,如果你有 XML 文件作为你的数据源,那么从列表中选择 XML 选项。看看以下截图。在这里,我们正在选择 JDBC 选项以将数据库添加为数据源。
In the Data tab, right-click on the Data Sets and select JDBC to add a data source. Generally, in the list of options, you can select any other option based on the requirement. It means, if you have an XML file as your data source, then choose XML option from the list. Take a look at the following screenshot. Here we are selecting the JDBC option to add a database as data source.

在选择 JDBC 选项作为数据源后,你将找到一个对话框,如以下截图所示。
After having selected the JDBC option as the data source, you will find a dialog box as shown in the following screenshot.
我们已经为数据源选择了 MySQL 数据库,因此我们必须选择对话框左侧面板中的 SampleData (MySQL) 选项(在给定的截图中标记为指针“1”)。指针“2”用于编辑连接语句和用于与数据库交互的 URL。
We have already chosen MySQL database for the data source, therefore we have to select the SampleData (MySQL) option in the left-side panel of the dialog box (marked as pointer "1") in the given screenshot. Pointer "2" is meant for editing the connection statement and URL to interact with the database.

以下截图显示了一个对话框,其中您可以定义连接语句和用于数据库的 URL。我们需要在以下截图中执行四个操作(使用指针突出显示)。
The following screenshot shows a dialog box where you can define your connection statement and the URL for the database. We need to carry out four operations on the following screen (which are highlighted using pointers).
-
In the connection type list, select MySQL − We have already chosen MySQL as the database (data source).
-
In the Access list, select Native (JDBC) − Through JDBC connection, we can access the database.
-
In the Settings section, we must mention the Host Name (localhost), Database name (employeedb), port number (3306), username (root), and the password (as per you system).
-
Test the connection statement by clicking the Test button.
最后,单击 OK 按钮确认数据库连接。
Finally, click the OK button to confirm the database connection.

Step 3 : Add a Query
查看以下截图。该对话框展示了通过数据库连接可用的已保存查询。
Take a look at the following screenshot. The dialog box presents the available saved queries available through the database connection.
-
The Available Queries block on the right side of the dialog box displays a list of all the available queries.
-
The Query Name block displays the selected query name which is selected in the above available queries list.
-
The Query block displays the query statement. If no queries are available or if you want to create a new query, click the “+” button which is highlighted as pointer “1” in the following screenshot.

在单击 “ + ” 按钮时,可以通过在 Query Name 块上编辑名称(如 select_all_records ),在 Query 块中使用以下查询语句来创建查询。
While clicking the “+” button, you can create a query by editing a name on the Query Name block as select_all_records and use the following query statement in the Query block.
SELECT
employee.id,
employee.name,
employee.designation,
employee.department,
employee.age
FROM
employee
LIMIT
15
添加查询后,您应该获得以下对话框。单击预览按钮。
After adding the query, you should get the following dialogue box. Click the preview button.

单击预览按钮后,您将在一个单独的对话框中找到所有 employee 表记录,如下截图所示。单击 close 按钮。
After clicking the preview button, you will find all the employee table records in a separate dialog box as shown in the following screenshot. Click the close button.

然后,单击 OK 按钮提交查询。提交查询后,您将在右侧结构窗格中的查询名称下方找到所有表字段名称及其数据类型,如下截图所示。此处,最大化的框是位于屏幕右侧的结构窗格。
Then, click the OK button to submit the query. After submitting the query, you will find all the table field names and their datatypes under the query name on the right-side structure pane, as shown in the following screenshot. Here, the maximized box is the structure pane which is placed on the right side of the screen.

到目前为止,我们已向 Pentaho 报表设计器添加了一个数据源和一个查询。现在,我们必须向工作空间添加元素以创建报表。同样的示例在下一章 " Reporting Elements " 中得到扩展。
We have so far added a data source and a query to the Pentaho Reporting Designer. Now, we have to add elements into the workspace to create a report. The same example is extended to the next chapter "Reporting Elements".
Pentaho - Reporting Elements
大多数报表元素都可以通过从数据窗格拖放它们到工作空间上的任何一个分段(大多数是详细信息分段)轻松添加。
Most reporting elements can easily be added by dragging and dropping them from the Data pane to any of the bands on the workspace (mostly Details band).
让我们继续上一个章节中的相同示例。我们在其中向报表设计器添加了一个数据源和一个查询。在此,我们将基于查询产生的输出设计报表。
Let us continue with the same example taken from the previous chapter. There we have added a data source and a query to the Reporting Designer. Here we will design the report based on the output produced by the query.
产生的查询字段是报表元素,它们在以下屏幕截图中突出显示。它们是 − id 、 name 、 designation 、 department 和 age 。
The resultant query fields are the reporting elements which are highlighted in the following screenshot. Those are − id, name, designation, department, and age.
Adding Reporting Elements
将查询添加到报告设计器后,产生的字段将出现在数据窗格中,如下截图所示。
After adding the query to the Reporting designer, the resultant fields appear in the data pane, as shown in the following screenshot.

现在,将必需字段(想要在报表中显示的字段)从 Structure Pane(结构面板)拖动到主工作区中心的 Details Band(详细信息带)。
Now, drag the required fields (fields you want to display in the report) from the Structure Pane into the Details Band at the center of the main workspace.
查看以下屏幕截图。它显示了从结构面板中拖动年龄字段的方向。
Take a look at the following screenshot. It shows the direction to drag the age field from the structure pane.

在 Details band(详细信息带)中排列好所有字段后,可以通过单击视图按钮(在上图中以 “ 1 ” 标明)查看报表视图。
After arranging all the fields in the Details band, you can see the report view by clicking the view button which is pointed as “1” in the above screenshot.
单击视图按钮后,结果报表将如下图所示。在工作区中,您将找到所有字段的值(这些字段在详细信息选项卡中指定)。
After clicking the view button, the result report will be as shown in the following screenshot. In the workspace, you will find the values of all the fields (which are specified in the Details tab).

现在,如果您想返回到设计模式,请单击下图中标为 “ 1 ” 的设计符号。
Now, if you want to go back to the design mode, then click the Design symbol marked as “1” in the following screenshot.

Pentaho - Page Footer Fields
报告的每一页包含两个特殊区域。在每一页顶部,您将会找到 page-header 区域。而在页面底部,您将会找到 page-footer 区域。剩余页面可用于实际报表内容。
Each page of a report contains two special areas. At the top of every page, you will find the page-header area. And at the bottom of the page, you will find the page-footer area. The remaining page is available for the actual report content.
Adding Page Footer Fields in Pentaho
页脚标签页用于提供一些属性和功能。例如,您可以使用页脚标签页来 print the max value of the age field at the bottom of the page 。报表引擎通过使用报表功能来实现这些特性。
The page footer tab is used to present some attributes and functions. For example, you can use the page footer tab to print the max value of the age field at the bottom of the page. The reporting engine allows these features by using reporting functions.
查看以下屏幕截图。此处,结构窗格中的“数据”选项卡包含一个符号 fx(标记为“ 1 ”)。它是“添加”功能按钮。单击此按钮可向报表中添加不同的函数。
Take a look at the following screenshot. Here the Data tab in the structure pane includes a symbol fx (marked as “1”). It is the add function button. Click this button to add different functions into the report.

然后,您将会找到一个对话框,其中包含按不同组隔离的不同函数。若要打印页脚中的员工最大年龄,我们应该选择 Summary 组中的 Maximum 函数,该函数在以下屏幕截图中标记为“ 1 ”。选择它并单击 OK 。
Then, you will find a dialog box with different functions segregated into different groups. To print the maximum age of an employee at the page footer, we should choose the Maximum function in the Summary group which is marked as “1” in the following screenshot. Select it and click OK.

一旦您单击 Ok 按钮,该函数将被添加到“结构”窗格中的“函数”标签,该标签位于屏幕右侧。
Once you click the Ok button, the function will be added to the Functions label in the Structure Pane which is placed at the right side of the screen.
一旦您选择已添加的函数(即“最大值”),您将会在“结构”窗格下方找到另一个窗格,其中包含该函数的属性。
Once you select the added function (i.e. Maximum), you will find another pane below the structure pane containing the properties of that function.
查看以下屏幕。最大化框包含两个指针(指针 1 和指针 2)。
Take a look at the following screen. The maximized box contains two pointers (Pointer 1 and Pointer 2).
-
Pointer 1 − Select the function in the data tab of the structure pane.
-
Pointer 2 − Edit the Field name in the properties section by selecting the age field from the dropdown list. It is because we have to print the maximum age of an employee.

现在,该函数已经准备好定制属性了。现在,您可以将该函数用作页脚属性来添加到报表中。
Now, the function is ready with the customized properties. Now you can use that function in your report as a page footer attribute.
查看以下屏幕截图。它再次包含两个指针(指针 1 和指针 2)。
Take a look at the following screenshot. Again, it contains two pointers (Pointer 1 and Pointer 2).
-
Pointer 1 − Select and drag the Maximum function from the Structure pane to the page footer band in the workspace, as shown in the following screenshot. Now the design of your report is ready.
-
Pointer 2 − Select the Preview button on the left side of the screen.

查看以下屏幕。它显示了报表的预览。员工的最大年龄已标记出来并显示在最大化框中。
Take a look at the following screen. It shows the preview of the report. The maximum age of an employee is marked and shown in a maximized box.

Pentaho - Groups
Pentaho 提供各种功能和特性,可将原始数据转换成有意义的信息。在此,我们将了解如何使用其中一项功能 Groups 。您可以使用此功能将原始行集数据分隔到组中,以便用户轻松理解报表。
Pentaho offers various functionalities and features to convert raw data into meaningful information. Here, we will learn how to use one such feature Groups. You can use this feature to segregate raw row-set data into groups so that the user can easily understand the report.
-
Grouping is a great way to divide long lists of data along meaningful separators.
-
With groups, you can keep similar items together and visually separate these items from other groups of items.
-
You will also need groups to perform various aggregations over the data, like printing the number of items in a group or calculating sums or averages.
Adding Groups in Pentaho
我们已经有一个基于员工数据的报告了。这里的查询是根据“部门”对所有员工记录进行分组。按照下面给出的步骤来满足给定的要求。
We already have a report based on the employee data. Here the query is to group all employee records according to "department". Follow the procedure given below to fulfill the given requirement.
首先,通过单击结构窗格上的 Add group 按钮来启动流程。 Add group 按钮在以下屏幕截图中标记为“1”。
First of all, you start the process by clicking the Add group button on the Structure pane. The Add group button is marked as "1" in the following screenshot.

单击添加组按钮,您将获得一个选项列表。然后,从列表中单击 Add group 选项。
You will get a list of options by clicking the Add group button. Then, click the Add group option from the list.
单击添加组后,您将发现一个对话框,您可以使用该对话框从给定的可用字段中添加组字段。
After clicking Add Group, you will find a dialogue box using which you can add a group field from the given available fields.
查看以下屏幕截图。我们在对话框中突出显示了三个活动,我们将其标记为 1、2 和 3。
Take a look at the following screenshot. The three activities are highlighted in the dialog box which we have marked as 1, 2, and 3.
-
Pointer 1 − Enter a user-defined name for this group.
-
Pointer 2 − Select the department field from the available fields list.
-
Pointer 3 − Click the arrow (→) button so that the selected field gets copied to the selected Fields list.
在选定的字段列表中选择该部门字段,然后单击确定进行确认。
Select that department field in the selected fields list and click OK to confirm.

添加组后,您将在结构窗格的结构选项卡中找到它。您还将在工作区中找到 Group Header 和 Group Footer 带。
After adding the group, you will find it in the Structure tab of the Structure pane. And you will find the Group Header and Group Footer bands in the workspace.
查看以下屏幕截图。通过将报表设计器左侧调色板上的标签图标拖到组头中,为您的报表添加一个静态标签(在屏幕截图中,此活动已标记为“ 1 ”)。
Take a look at the following screenshot. Add a static label to your report by dragging the label icon from the palette on the left side of the Report Designer into the group header (in the screenshot, this activity has been marked as “1”).
通过双击标签,您可以对其进行编辑并将名称更改为 Department 。通过使用格式化工具栏或格式化调色板(分别标记为“3”和“4”),您可以更改标签的格式。
By double-clicking the label, you can edit it and change the name to Department. By using the Formatting Toolbar or the Formatting Palette (marked as "3" and "4" respectively), you can change the format of the label.

现在让我们继续进行。将结构窗格切换到数据选项卡。从结构窗格中选择部门字段并将其拖动到组头(此活动在以下屏幕截图中标记为“ 1 ”)。要查看报表的预览,请单击屏幕左侧的预览按钮,该按钮在以下屏幕截图中突出显示并标记为“ 2 ”。
Let us now proceed further. Switch the Structure pane to Data tab. Select and drag the department field from the Structure pane to the Group Header (this activity is marked as “1” in the following screenshot). To see a preview of your report, click the preview button on the left side of the screen which is highlighted and marked as “2” in the following screenshot.

单击预览按钮后,您将找到结果报告,如图所示以下屏幕截图所示。您会发现记录现在已按部门分组。
After clicking the preview button, you will find the result report as shown in the following screenshot. You will find the records have now been grouped together according to department.

此时的报表看起来不太吸引人。您可以使用格式化工具栏或格式化调色板添加一抹色彩并使标题更具效果。
The report does not look very appealing at this stage. You can add a touch of color and make the heading more effective using the Formatting Toolbar or the Formatting Palette.
你现在已准备好使用 Pentaho 生成不同类型的报表。只需按照迄今为止讨论的步骤操作,并尝试使用 Pentaho 中提供的所有功能和选项即可。
You are now ready to generate different types of reports using Pentaho. Just follow the steps discussed so far and try to use all the features and options available in Pentaho.
Pentaho - Chart Report
chart ,也称为 graph ,是数据的图形表示形式。Pentaho Reporting Designer 提供了多种图表类型。您可以使用 Pentaho Reporting Designer 调色板中提供的 “chart-element” 选项设计图表。
A chart, also called a graph, is a graphical representation of data. Pentaho Reporting Designer offers a wide variety of chart types. You can design a chart using the “chart-element” option available in the palette of Pentaho Reporting Designer.
创建图表需要三个要求:
There are three requirements to create a chart −
-
A data-collector to extract the charting-data from the data sources.
-
A chart-expression to produce a chart from the collected data.
-
A report element to display the resulting chart object.
现在让我们举一个示例,尝试理解在 Pentaho 中创建图表的过程。
Let us now take an example and try to understand the process of creating charts in Pentaho.
下表包含有关三个汽车品牌特征的数据。我们将使用条形图描述这些数据。
The following table contains data regarding the features of three car brands. We will depict this data using a bar chart.
Car |
Speed |
User Rating |
Mileage |
Safety |
Fiat |
1 |
3 |
5 |
5 |
Audi |
5 |
6 |
10 |
4 |
Ford |
4 |
2 |
3 |
6 |
首先,根据给定的表数据创建一个名为 car 的表。我们使用 MySQL 数据库作为数据源。将该(数据源)添加到 Pentaho Reporting Designer。我们在 “Pentaho - Data Sources and Queries”(Pentaho - 数据源和查询)一章中已经讨论了如何向 Pentaho Reporting Designer 添加数据源和查询。
First of all, create a table named car based on the given table data. We are using MySQL database as the data source. Add that (data source) to the Pentaho Reporting Designer. We have already discussed how to add a data source and a query to the Pentaho Reporting Designer in the chapter "Pentaho – Data Sources and Queries".
Steps to Create a Chart in Pentaho
现在,按照给定的步骤基于给定场景创建图表。
Now, follow the steps given below to create a chart based on the given scenario.
Step 1 - Add a Query
查询将从表 car 中检索所有记录。因此,查询应该如下所示:
The query will retrieve all the records from the table car. Therefore the query should be as follows −
Select
car.id,
car.name,
car.speed,
car.user_rating,
car.millage,
car.safety
From
car
LIMIT
3
以下屏幕截图显示了如何将给定的查询添加到数据源中。
The following screenshot shows how to add the given query to the data source.

Step 2 - Add an Image to the Page Header
这是一个可选步骤,但很重要,因为图像在提升报表美观方面起着重要作用。
This is an optional step, however it is important because images play an important role in improving the aesthetics of a report.
查看以下屏幕截图。我们在此处重点介绍了以下五项活动:
Take a look at the following screenshot. We have highlighted the following five activities here −
-
After adding a query, you will find the query fields on the Structure pane. From the Structure pane, select the respective fields, drag and drop into the Details tab of the report workspace.
-
The Details tab presents only the field values. Add those respective heading Labels to the Report Header tab by selecting the label field from the palette.
-
Add an image taken from the palette and place it on the Page Header Tab. Add another label in the Page Header for Report Heading and use a suitable heading, for example CAR – CHART, for effective presentation. Double-click on the image element – you will find a dialogue box called Edit Content.
-
You have two options to insert an image. Either link the image URL to the report or embed the image into the report. We chose to embed the image by selecting the option “Embed in Report”.
-
Download some sample car image from the internet to put into the Page Header. Click on the button to locate the sample car image with the location URL. Click the OK button to confirm.

Step 3 - Add Chart into Report Footer
通过点击在左侧调色板中选择并将其拖到报表中来添加图表。它在以下屏幕截图中标记为“1”。双击报表页脚中的柱状图元素。
Add the chart by clicking select and dragging it from the left-side palette to the Report. It is marked as "1" in the following screenshot. Double-click on the Bar chart element on the Report Footer.

Step 4 - Add Chart Properties
在双击图表元素后,你将发现一个对话盒,其中你必须提供收集到的详细信息和图表表达式详细信息。
After double-clicking on the chart element, you will find a dialogue box where you have to provide the data collected details and chart expression details.
看看以下的屏幕截图。选项卡 Primary Data Source 包含两个标记 −
Take a look at the following screenshot. The tab Primary Data Source contains two markers −
-
Marker “1” is a dropdown list where you have to select the Category Set Data Collector.
-
Marker “2” is also a dropdown list of the category-column where you have to select the name field.

主数据源中有三个部分: Common 、 Series 和 Group 。在此,我们不需要在组部分中添加任何内容,因为我们在查询中未使用任何组。
There are three sections in the Primary Data Source − Common, Series, and Group. Here, we don’t require to add anything on the Groups section because we are not using any Groups in our query.
Common − 此部分中有两个字段 − category-column 和 value-column 。我们在上面的部分中,已经用 name 字段填充了类别列值。第二个是 value-column 。
Common − There are two fields in this section − category-column and value-column. We already filled the category-column value with the name field in the above section. The second one is value-column.
点击空值,你将找到一个对话框,如下面的屏幕截图所示。其中标记了两个活动(1 和 2)。
Click on the empty value; you will find a dialogue box as shown in the following screenshot. There are two activities (1 and 2) marked in it.
-
Click the (+) button to add the value fields in the column.
-
By clicking on the empty value, you will find a dropdown list from where you need to select the speed field.

重复上述两个活动来将用户评分、里程和安全字段添加到列中。在添加所有这些字段之后,屏幕将显示如所示。点击确定来确认。
Repeat the above two activities to add user_rating, mileage, and safety fields into the column. After adding all these fields, the screen will appear as shown below. Click OK to confirm.

主数据源部分中的下一列是序列部分。
The next column in the Primary Data source section is the Series section.
Series − 在序列字段中,点击按值分类选项。你将找到一个对话框,如下面的屏幕截图所示。其中有两个标记(1 和 2)。
Series − In the Series field, click the series-by-value option. You will find a dialogue box as shown in the following screenshot. There are two markers (1 and 2) in it.
-
Click the (+) button to add a new field in the column.
-
By double-clicking on it, you can edit that field.
针对诸如速度、用户评级、里程和安全等字段名称,重复这两项活动。
Repeat these two activities for adding field names such as Speed, User Rating, Mileage, and Safety.
这些是用户自定义名称,用于报告图表中的特定部分中显示。但此处需要按照 Common 部分中值列字段中指定的相同顺序。按照如下方式在所有字段添加后单击 OK 。
These are the user-defined names to present in the particular section of report chart. But here you have follow the same order that you have given on the Value-column fields in the Common section. Click OK after adding all the fields as shown below.

添加所有部分后,将会获得如以下屏幕截图中所示的 Edit Chart 对话框。 Bar Chart 窗格包含用于更改图表格式的不同属性。
After adding all the sections, you will get the Edit Chart dialogue box as shown in the following screenshot. The Bar Chart pane contains different properties which are used for changing the chart format.
在条形图的 General 部分中,我们已经将 3-D 值更改为 true (标记为“1”)。单击“确定”以确认图表属性。
In the General section of the Bar Chart, we have changed the 3-D value as true (marked as "1"). Click OK to confirm the chart properties.

单击格式化工具栏上的“预览”按钮,以查看报告预览。它将显示如下面的屏幕截图所示 −
Click on the Preview button on the Formatting Toolbar to see a preview of the report. It will appear as shown in the following screenshot −

可以通过使用不同类型的数据模型以及向图表属性提供不同的值,在报告中实现不同类型的图表。Pentaho 几乎在报告设计器中提供了 18 种类型的图表。
You can implement different types of charts in your report by using different types of data models and by providing different values to the chart properties. Pentaho provides almost 18 types of charts in the report designer.
Pentaho - Formatting Report Elements
将报告元素放在工作空间中后,可以使用不同的方式对其进行格式化。Pentaho Reporting Designer 提供了各种功能来根据我们的要求对报告元素进行格式化。
Once you have placed a report element in the workspace, it can be formatted in different ways. Pentaho Reporting Designer provides various features to format the reporting elements as per our requirement.
Text Formatting
所有基于文本的元素,例如文本、数字、日期和标签,都可以使用出现在报表画布正上方的格式化工具栏轻松格式化。
All the text-based elements such as text, number, date, and labels can be easily formatted using the Formatting Toolbar that appears just above the Report Canvas.
来看一看下面的截图。在这里,我们已标记并突出显示了三个对象:
Take a look at the following screenshot. Here, we have marked and highlighted three objects −
-
Selected Report Element
-
Formatting toolbar
-
Style Pane tab for formatting the report elements
首先,在工作空间上选择报表元素。此后,可以使用格式化工具栏或样式选项卡窗格中的属性以多种方式对该元素进行格式化。
First of all, select the Report Element on the workspace. Thereafter, you can format that element in many ways using the Formatting toolbar or using the properties from the Style Tab pane.

Adding Hyperlinks
Pentaho Report Designer 允许您向报表数据添加超链接。在这里,我们将举一个通用示例来说明如何在报表中添加超链接。
Pentaho Report Designer allows you to add hyperlinks to your report data. Here we will take a general example to explain how to add hyperlinks in your report.
假设我们已在 employee 表中添加了一个查询以获取字段的 ID、名称和职责,我们还向报表工作空间添加了这些字段。在这里,我们的要求是使用超链接将职责字段的各个值作为参数值传递给 www.google.co.in 。
Assume that we have already added a query in the employee table to fetch the fields’ id, name, and designation. We have also added these fields to the Reporting workspace. Here our requirement is to pass the individual values of the designation field to www.google.co.in as a parameter value using a hyperlink.
首先,在工作空间中选择职责字段。右键单击它,并从列表中选择超链接。来看一看下面的截图。
First, select the designation field in the workspace. Right click on it and select Hyperlink from the list. Take a look at the following screenshot.

单击超链接选项后,您将找到一个对话框,您必须在其中提供详细信息,例如超链接位置、URL、目标、参数名称和值。
After clicking the Hyperlink option, you will find a dialog box where you have to provide details such as Type of the hyperlink location, URL, Target, Parameter name, and Value.
请查看以下屏幕截图。这里,我们已标记并突出显示以下 5 个活动:
Take a look at the following screenshot. Here we have marked and highlighted the following five activities −
-
Provide the type of Hyperlink Location. Generally there are four types of locations − Self − Linking to the same report field. URL − Provide a URL for that reference location. Pentaho Repository − If you install Pentaho Repository, then provide that file URL in the localhost (Login is required). Manual Link − Create a link or a formula manually and provide it as Hyperlink. For this example, we have used URL type location.
-
Provide the URL of the website or the file. For this option, we have used https://www.google.co.in.
-
Provide the Target location, that is, _TOP, _BLANK, or _PARENT. We have used “_TOP”. If you want to provide any information to the user when the mouse pointer moves over the hyperlink text, then type the information in the tooltip box which is placed just beside the Target box.
-
Select the plus (+) symbol to add a Parameter name and value to the parameter list.
-
Provide a Parameter name and a value to the URL of the Hyperlink. Here we have used “q” as the Parameter name and Designation field as the Parameter value.
最后,单击确定以确认超链接属性。
Finally, click OK to confirm the Hyperlink properties.

单击格式化工具栏中的预览按钮以预览报表。单击预览按钮后,您将找到以下屏幕截图。将鼠标指针放在任何职位值(HR 或 Admin)上,以查看其特定 URL。
Click the Preview button on the formatting toolbar to see a preview of the report. After clicking the Preview button, you will find the following screenshot. Place the mouse pointer on any designation value – either HR or Admin – to see its respective URL.

在此 Pentaho 报表设计器预览中,超链接用于将用户重定向到另一个 URL。为此,您必须通过单击主工具栏上的运行按钮(在以下屏幕截图中标记为“1”)在此 HTML 上运行此报表,并选择其上的 HTML 选项。
In this Pentaho Report Designer preview, the hyperlink is meant for redirecting the user to another URL. For that, you have to run this report on HTML by clicking the Run button on the Main toolbar (marked as "1" in the following screenshot) and select the HTML option on it.
请查看以下屏幕截图。有不同的用于运行报表的选项,但我们选择以 HTML 格式显示报表。
Take a look at the following screenshot. There are different options for running the report, but we have chosen to display the report in HTML format.

选择 HTML 选项后,您将在单独的 HTML 页面中找到报表数据,如下面的屏幕截图所示。单击任何职称值以了解超链接如何在 Pentaho Reporting 中工作。
After selecting the HTML option, you will find the report data in a separate HTML page, as shown in the following screenshot. Click on any Designation value to understand how a hyperlink works in Pentaho Reporting.

Row Banding
Pentaho 报表设计器有一个行条带属性,允许您为报表的交替行着色。让我们看一个之前的示例以了解其工作方式。
Pentaho Report Designer has a row banding property that allows you to color the alternate rows of your report. Let us take our previous example to understand how it works.
将元素添加到工作空间后,单击报表工作空间 → 转到格式菜单 → 选择行条带。请查看以下屏幕截图。
After adding the elements into the workspace, click the report workspace → go to the Format menu → select Row Banding. Take a look at the following screenshot.

选择行条带选项后,您会找到一个对话框。在此,您可以从下拉列表中选择一种颜色。我们选择了红色和绿色作为交替颜色。现在,单击确定按钮进行确认。请查看以下屏幕截图。
After selecting the Row Banding option, you will find a dialog box. Here, you can select a color from the dropdown list. We have selected red and green as the alternate colors. Now, click the OK button to confirm. Take a look at the following screenshot.

单击预览按钮查看报表如何交替显示行颜色。它将如下面的屏幕截图所示出现。
Click the Preview button to see how your report appears with alternate row colors. It will appear as shown in the following screenshot.

Pentaho - Functions
报表的每一页都包含一个 Page-header 区域和一个 Page-footer 区域。其余页面可供实际报表内容使用。
Each page of a report contains a Page-header area and a Page-footer area. The remaining page is available for the actual report content.
页脚选项卡用于显示一些属性和功能。例如,我们可以打印页脚中员工年龄字段的最大值。报表引擎允许通过使用功能实现这些功能。
The page footer tab is used to present some attributes and functions. For example, we can print the max value of the age field of an employee in the Page-footer. The reporting engine allows these features by using functions.
让我们使用我们在前几章中使用的相同的 employee 表。将所有字段添加到报表工作区后,我们现在在页脚选项卡中添加一个函数来找出员工的最大年龄。
Let us use the same employee table which we have used in the previous chapters. After adding all the fields into the report workspace, let us now add a function into the Page-footer tab to find out the maximum age of an employee.
按照以下步骤将一个预定义函数添加到您的报表中。
Follow the steps given below to add a predefined function to your report.
Step 1 - Click the Function Button (fx)
查看以下屏幕截图。此处,结构窗格中的“数据”选项卡包含一个符号 fx(标记为“ 1 ”)。它是“添加”功能按钮。单击此按钮可向报表中添加不同的函数。
Take a look at the following screenshot. Here the Data tab in the structure pane includes a symbol fx (marked as “1”). It is the add function button. Click this button to add different functions into the report.

Step 2 - Select a Particular Function
然后,您将会找到一个对话框,其中包含按不同组隔离的不同函数。若要打印页脚中的员工最大年龄,我们应该选择 Summary 组中的 Maximum 函数,该函数在以下屏幕截图中标记为“ 1 ”。选择它并单击 OK 。
Then, you will find a dialog box with different functions segregated into different groups. To print the maximum age of an employee at the page footer, we should choose the Maximum function in the Summary group which is marked as “1” in the following screenshot. Select it and click OK.

一旦您单击 Ok 按钮,该函数将被添加到“结构”窗格中的“函数”标签,该标签位于屏幕右侧。
Once you click the Ok button, the function will be added to the Functions label in the Structure Pane which is placed at the right side of the screen.
Step 3 - Define a Field Name
一旦您选择已添加的函数(即“最大值”),您将会在“结构”窗格下方找到另一个窗格,其中包含该函数的属性。
Once you select the added function (i.e. Maximum), you will find another pane below the structure pane containing the properties of that function.
查看以下屏幕。最大化框包含两个指针(指针 1 和指针 2)。
Take a look at the following screen. The maximized box contains two pointers (Pointer 1 and Pointer 2).
-
Pointer 1 − Select the function in the data tab of the structure pane.
-
Pointer 2 − Edit the Field name in the properties section by selecting the age field from the dropdown list. It is because we have to print the maximum age of an employee.

Step 4 - Add a Function to Report Workspace
现在,该函数已经准备好定制属性了。现在,您可以将该函数用作页脚属性来添加到报表中。
Now, the function is ready with the customized properties. Now you can use that function in your report as a page footer attribute.
查看以下屏幕截图。它再次包含两个指针(指针 1 和指针 2)。
Take a look at the following screenshot. Again, it contains two pointers (Pointer 1 and Pointer 2).
-
Pointer 1 − Select and drag the Maximum function from the Structure pane to the page footer band in the workspace, as shown in the following screenshot. Now the design of your report is ready.
-
Pointer 2 − Select the Preview button on the left side of the screen.

Step 5 - Check Preview
查看以下屏幕。它显示了报表的预览。员工的最大年龄已标记出来并显示在最大化框中。
Take a look at the following screen. It shows the preview of the report. The maximum age of an employee is marked and shown in a maximized box.

Pentaho - Additional Functions
下表提供了您可以在报表中使用的其他函数列表。
The following table provides an additional list of functions that you can use in your reports.
Common Functions |
S.No. |
Function Name |
Purpose |
1 |
Open Formula |
Enables you to create your own custom Open Formula function using the built-in Formula Editor. |
2 |
Page |
Count the number of page used in report before rendering. |
3 |
Total Page Count |
List the total number of pages in the rendered report. |
4 |
Page of Pages |
Prints the current page number along with the total number of pages in the render report. |
Report Functions |
S.No. |
Function Name |
Purpose |
1 |
Is Export Type |
Tests whether the given export type has been selected for this report. |
2 |
Row Banding |
Alternates the background color of each item band in a group. |
3 |
Hide Repeating |
Hides equal values in a group. Only the first changed value is printed. |
4 |
Hide Page Header and Footer |
Hides the page header and footer bands when the output type is not pageable. |
5 |
Show Page Footer |
Only shows the page footer on the last page rendered in the report. |
Summary Functions |
S.No. |
Function Name |
Purpose |
1 |
Sum |
Calculates the sum of the selected numeric column. |
2 |
Count |
Counts the total number of items contained in a group. If no group is specified, all items in the entire report are counted. |
3 |
Count by Page |
Counts the total number of items contained in a group on one rendered page. If no group is specified, all items on the entire page are counted. |
4 |
Group Count |
Counts the total number of items in the selected groups. If no group is specified, all items in all groups are counted. |
5 |
Minimum |
Identifies the lowest or smallest value in a group. |
6 |
Maximum |
Identifies the highest or largest value in a group. |
7 |
Sum Quotient |
Performs simple division on the sum totals from two columns and returns a numeric value. |
8 |
Sum Quotient Percent |
Performs simple division on the sum totals from two columns and returns a percentage value. |
9 |
Calculation |
Stores the result of a calculation. This function is used in groups. |
10 |
Count of pages |
Counts items on a page according to the specified criteria. This value is reset to zero when a new page is reached. |
11 |
Sum of Pages |
Adds all of the specified items on one page and produces a total. This value is reset to zero when a new page is reached. |
Running Functions |
S.No. |
Function Name |
Purpose |
1 |
Sum |
Calculates a running total sum of the specified column. |
2 |
Count |
Count the items in a group or in a report. |
3 |
Group Count |
Counts the number of groups in a report. |
4 |
Count Distinct |
Counts the distinct occurrences of a certain value in a column. |
5 |
Average |
Calculates the average value in a given column. |
6 |
Minimum |
Identifies the lowest or smallest value in a column. |
7 |
Maximum |
Identifies the highest or largest value in a column. |
8 |
Percent of Total |
Calculates the percentage value of a numeric column. The total sum is divided by the number of items counted. |
Advanced Functions |
S.No. |
Function Name |
Purpose |
1 |
Message Format |
Formats text according to the Java Message Format specification. |
2 |
Resource Message Format |
Formats text from a resource bundle according to the Java Message Format specification. |
3 |
Lookup |
Maps a string from one column to another string. |
4 |
Indirect Lookup |
Returns a value from a mapped field. |
5 |
Resource Bundle Lookup |
Performs a resource-bundle lookup using the value from the defined field as a key in the resource bundle. |
6 |
Open Formula |
Enables you to create your own custom Open Formula function using the built-in Formula Editor. |