Chapter 4. Report Tutorial

Table of Contents

4.1. Development Environment
4.2. Preparing the Data for the Report
4.3. Create the Layout of the Report

This tutorial will show how to create reports for Klaros-Test­management. Please note that custom reports are only available in Klaros-Test­management Enterprise Edition. Basic knowledge in Java programming and XML might be helpful to understand this tutorial. An example of the resulting report can be found here. The complete code can be downloaded here, feel free to modify it to your needs.

4.1.  Development Environment

The first step in this tutorial will describe how to set up a development environment to help with creating reports. We recommend using Eclipse as the development framework.

Create a project to contain your reports

  • Open Eclipse and right click into the Project Explorer

  • In the menu then select New -> Other.

  • In the dialog select Java Project as shown in the picture then click on Next.

    The Wizard Selection Screen

    Figure 4.1. The Wizard Selection Screen

  • In the next dialog enter a title for your project (e.g. ReportTutorial ) and press Finish.

    The New Project Wizard

    Figure 4.2. The New Project Wizard

  • The Package Explorer in Eclipse should now show your new project.

    The Package Explorer

    Figure 4.3. The Package Explorer

Set up the Project

  • First, create a subfolder to hold your XML files. Right click on your project and select New -> Folder. In the dialog enter xml in the Folder name field and click on Finish.

    Creating a New Folder

    Figure 4.4. Creating a New Folder

  • Add the Klaros-Test­management scripting library to your build path. Right click on our project and select Properties. In the dialog click on Java Build Path, select the Libraries tab and then click on Add External JARs....

    The Build Path Setting Screen

    Figure 4.5. The Build Path Setting Screen

  • In the following dialog navigate to your Klaros-Test­management installation folder. From there navigate to the webapps/klaros-web/WEB-INF/lib folder and select the klaros-model-x.y.z.jar and klaros-scripting-x.y.z.jar, then click the "open" button.

    Selecting an External Jar

    Figure 4.6. Selecting an External Jar

  • Finally click on the OK button in the Build Path dialog. You now have an additional entry in your project named Referenced Libraries.

    The Package Explorer

    Figure 4.7. The Package Explorer