Chapter 11. Custom Reports

Table of Contents

11.1. The Context Object
11.2. Creating a Report
11.3. Supported Parameter Types
11.4. Dealing with Parameters
11.5. Generating a Report
11.6. Example Report
11.6.1. Creating the Report Script
11.6.2. Creating a PDF Report Template
11.7. Creating a Chart
11.7.1. Pie Chart Report Script
11.7.2. Pie Chart Report Template
11.7.3. Embedding Images
11.7.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.

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 de.verit.klaros.scripting.KlarosContext 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 de.verit.klaros.scripting.KlarosContext object already contains predefined objects. For a list please refer to Section E.1, “The Klaros Report Context”.