Chapter 11. Custom Reports

Table of Contents

11.1. The Context Object
11.2. Creating a Report Template
11.2.1. Supported Parameter Types
11.2.2. Dealing with Parameters
11.3. Generating a Report
11.4. Example Report
11.4.1. Creating the Report Script
11.4.2. Creating a PDF Report Template
11.5. Creating a Chart
11.5.1. Pie Chart Report Script
11.5.2. Pie Chart Report Template
11.5.3. Embedding Images
11.5.4. Creating an Excel Report Template

Although Klaros-Test­management already offers a large number of predefined reports, these are often not sufficient if there are special requirements regarding content or layout. For this reason, the Klaros-Test­management Enterprise Edition can also be used to create your own reports. Figure 11.1, “The Report Generation Process” gives an overview of the reporting process.

The Report Generation Process

Figure 11.1. The Report Generation Process


Two user groups are involved in the generation of a report: Report Designer and User.

[Note] Programming Knowledge

To create custom reports, basic knowledge of the Java or Groovy programming languages and XML-based template creation with SeamPDF or SeamExcel is required.

This chapter covers the creation of user defined report templates so it primarily of interest to report designers. Section 9.2, “Reports” shows how users can generate reports from them.

11.1. The Context Object

The report script provides the data for the rendering of the layout template. It retrieves the data either directly from the object model de.verit.klaros.core.model or from the database via the HQL query language.

The resulting data for the layout template must then be stored in the Section E.2, “KlarosScript Interface” object which has been passed to the execute method.

If parameters are defined, they are available via the context object to both the report script and the layout template.

[Tip] Predefined Objects in the Context

The Section E.2, “KlarosScript Interface” object already contains predefined objects. For a list please refer to Section E.1, “The Klaros Report Context”.