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”:
After creating the project, add your two main folders with a right-click on the project displayed in the “Navigator” tab panel:
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:
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.
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¶
Information for connecting to databases are defined in the following two files:
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¶
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.
Click on “Outline” and expand the “Datasources”.
The datasources used in Centreon MBI standard reports are listed.*
Double click on the “Datasource” Centreon, and the below pop-up opens:
In “Connection Profile Store” select the path to the report-profile.xml file on your workstation, and validate.
The following pop-up opens:
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”.
The information defined in the XML file is read.
Click on “Test Connection”. A pop-up appears, displaying the message “Connection successful”.
In case of an error message indicating a missing driver, add the MariaDB driver ( .jar) from the “Manage drivers” menu.
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|
Generating a standard report¶
To generate a standard report from the interactive development environnement, double click on the report to open it.
Once the report is open, click on “View report” to select the output format:
A pop-up opens, asking for the report parameters to be filled in.
The report will be generated according to the parameter criteria selected, in the desired output format.