Preparing the development environnement

Creating a workspace

When you first launch Eclipse BIRT, you will need to create a workspace to hold your BIRT reporting projects. We recommend that you create a workspace directory that is separate from the Eclipse BIRT installation (system) directory. This type of configuration will allow you to change the BIRT version easily without affecting your project folders.

After creating the workspace and before starting to design any report, you must create a BIRT project containing two main directories:

  • /reports: Contains all your reports (.rptdesign files).
  • /Resources: Contains any files or components that will be made accessible to your reports through relative paths.

Creating a new project

To create a BIRT report project, select “File > New > Other projects”, then, in the wizard window, select “Report project”:

../_images/100000000000030C0000029D554D9D2B.png

After creating the project, add your two main folders with a right-click on the project displayed in the “Navigator” tab panel:

../_images/1000000000000565000001F097833544.png

Now, copy the contents of the reports (/usr/share/centreon-bi/reports) and Resources (/usr/share/centreon-bi/Resources) directories on the reporting server into the two folders you created in your project.

The resources folder

For each BIRT project created in this workspace, you will need to define, in project properties, the location of the corresponding Resources folder.

This will allow the shared components (e.g., datasources, data sets, report parameters and layout components from BIRT libraries, but also BIRT report templates and image or flat files) to be referenced in reports through the “Resource Explorer” panel:

../_images/10000000000003340000018F33DF4032.png

Each component imported from “Shared resources” into the report (.rptdesign file) will be referenced through a relative path. This will enable you to migrate your project into another workspace or Centreon MBI reporting server without indicating the full path of your installed workspace.

For example, if your workspace is located in C:\Documents\username\Centreon-Bi-Workspace\MyFirstProject\, only the subfolders and files in your project “MyFirstProject” need to be set.

To define the shared-resource folder in the project environment, right-click on your project in the Navigator panel, then select Properties. Set the resource folder as “<Current Project Folder>/Resources/”. Because the pattern “<Current Project Folder>” is a variable that will be set automatically by Eclipse, there is no need to write the project path explicitly.

../_images/10000000000003600000025556C97DB4.png

Note

You will have to repeat this procedure every time:

  • You export and import the project into another workspace.
  • You create a new project.

Connecting to databases

Introduction

Information for connecting to databases are defined in the following two files:

  • /etc/centreon-bi/cbis-profile.xml
  • /etc/centreon-bi/reports-profile.xml

Copy both of these files to your workstation.

In each of these .xml files, you must update the IP addresses for both the Centreon database (“Centreon”) and for the Centreon storage database (“Censtorage”).

  • cbis-profile.xml file should contain the addresses of the monitoring database server.
  • reports-profile.xml should contain the addresses of the reporting database server.

Update the username and the password of these files, if necessary.

From your workstation, grant the appropriate privileges for the defined users to connect to the above servers.

Configuring the L2_datasources library

Warning

Never upload the L2_Datasource.rptlibrary file to your reporting server. This will delete the configuration for connection to the MySQL server and cause Centreon MBI (for ETL & report generation) to crash.

All standard reports use the library L2_datasources to connect to data. Therefore, this library must point to the appropriate servers (monitoring DB and the reporting DB servers).

You must then link the L2_datasource library to the updated profile files on your workstation.

To do so, double click on the library L2_datasource. The library opens in your workspace.

../_images/db_conn_1.png ../_images/db_conn_2.png

Click on “Outline” and expand the “Datasources”.

../_images/db_conn_3.png

The datasources used in Centreon MBI standard reports are listed.*

Double click on the “Datasource” Centreon, and the below pop-up opens:

../_images/db_conn_4.png

In “Connection Profile Store” select the path to the report-profile.xml file on your workstation, and validate.

The following pop-up opens:

../_images/db_conn_5.png

All the datasources present in the file are listed.

In this example, two datasources are listed: - Censtorage - Centreon

Select Centreon then click on the “BIRT JDBC Datasource”.

../_images/db_conn_6.png

The information defined in the XML file is read.

Click on “Test Connection”. A pop-up appears, displaying the message “Connection successful”.

../_images/db_conn_7.png

Note

In case of an error message indicating a missing driver, add the MariaDB driver ( .jar) from the “Manage drivers” menu.

../_images/db_conn_8.png ../_images/db_conn_9.png

This operation should only be performed once for the project.

Repeat the same procedure for these datasources: centreon_storage, centreon_live et centreon_storage_live.

datasource profile file profil to use
Censtorage reports-profile.xml Censtorage
Centreon_Live cbis-profile.xml Centreon
Censtorage_Live cbis-profile.xml Censtorage

Generating a standard report

To generate a standard report from the interactive development environnement, double click on the report to open it.

../_images/gen_report_1.png

Once the report is open, click on “View report” to select the output format:

../_images/gen_report_2.png

A pop-up opens, asking for the report parameters to be filled in.

../_images/gen_report_3.png

The report will be generated according to the parameter criteria selected, in the desired output format.

../_images/gen_report_4.png