View source | Discuss this page | Page history | Printable version   

Reporting Server/Reporting Functional Integration


The Openbravo backoffice is integrated with the Jasper Reports Server in various ways: transparent automatic login using single-sign-on logic, providing access to the reports server without relogin, show reports within the Openbravo backoffice and report bursting. These integration topics are described in detail in this document.

See also this howto for step-by-step information on how to access reports from the backoffice/webpos.

Integration Module

The functionalities described in this document are provided by the org.openbravo.reporting.integration module. We are delivering this module as part of the 20Q1 release. This module has limited dependency requirements, use with previous versions of Openbravo could be possible and will be tried on an as-need basis.

For WebPOS to reporting integration the following module also should be installed within Openbravo:

Openbravo Reporting Configuration

The Openbravo server needs to know how to access the required Jasper Server installation. The Jasper server information is configured in the 'Reporting Configuration' window. Note, there can be maximum one reporting configuration record defined in the system.

Openbravo Jasper Reporting Config.png

The reporting configuration can be tested by clicking the test configuration in the top right.

Note: we only allow one reporting configuration record per installation.

Automatic Login, Organizational Filtering, Automatic User Creation

Openbravo by default supports automatic login from the Openbravo backoffice to the reports server. So a user who is logged into the backoffice does not need to login again when accessing the reports server through links in the backoffice.

When the user retrieves reports or navigates to the reporting server from the backoffice, then Openbravo will first send a login request to the reports server. The reports server will create the user (if he/she does not yet have a reports server user) and authenticate the user. On successful authentication the user is authorized to access reports and the reports server repository.

In this login action Openbravo also passes the allowed organizations of the user. This information is used within the reports server to accomplish organizational data filtering. So that a user can only see data from stores to which he/she has access.

The login action also uses roles and role mapping so that the user gets the right authorizations within the reports server. This is discussed in more detail in the next sections.

Preference to see data of all organizations

By default the reporting integration will make sure that the user can only see data of the organizations to which he/she has access. With a preference it is possible to override this behavior and designate specific users or roles to see data of all organizations. See the preference: 'Reporting Integration - Show data of all Organizations'. Set this preference to Y for relevant users or roles.

Openbravo Retail Reporting Preference All Orgs.png

Preference to enable access to reports in webpos

If the integration.retail module is installed it is possible to access reports also from Webpos. There is a preference to control who has access to the report functionalit, i.e. who will see the Reports/KPI menu option in WebPOS.

By default the reporting retail integration will enable it for all webpos users, but you can override it for specific users to prevent this.

Openbravo Retail Reporting Preference.png

Role handling and Role mapping

The reports server has a role definition which can be used to assign view and execute permissions by role.

Users will already have roles assigned to them within Openbravo. Therefore it makes sense to map Openbravo roles to Reporting Roles. This mapping and creation of reporting roles is done from the role mapping window.

When logging in from Openbravo by default a user will get the reports server ROLE_USER. This in addition to the role set in the role mapping window.

To get to a complete permission and role setup follow these steps:

  1. think of how you want to organize the reports in folders in the jasper repository to manage access to the reports.
  2. think of the roles you need for the envisioned folder and permission setup in the reporting server. Do not create these roles in the reporting server. That's done from the Openbravo backoffice through the Create Role button in the role mapping window.
  3. for each of the envisioned roles, define one or more role mappings within the Reporting Role Mapping window, choose sensible role names and select the corresponding Openbravo role. The reporting role does not yet have to exist in the reporting server, creation is done in the next step. One reporting role can be mapped to different Openbravo roles.
  4. create the role in the reporting server: when creating a role mapping record then also create the role in the reporting server through the Create Role button in the role mapping window. So do not create roles directly in the reporting server, this will not work as these are so-called internal roles which can not be used for single-sign-on/automatic login.
  5. now go to the folders in the repository and right click on the folder to set the correct permission for each role. See the screenshot above.

For more information on the role setting in the folder structure, see the next section.

Note: role inheritance is supported in this mapping. So you can define the mapping for a high level generic Openbravo role (e.g. Sales Rep Role) while the Openbravo users are linked to/using a specific role (e.g. Sales Rep Store 1 Role).

Openbravo Jasper Reporting Role Mapping button.png

Reporting Repository Folder Structure - Guide Lines - Jasper Access Definition

The mapped roles can be used to define access of different groups of users to different sets of reports. For example you can place all the sales reports in a specific folder and all warehouse reports in another folder. Then by giving the sales role access to the sales reports folder and the warehouse role only access to the warehouse reports folder, you can make different report sets visible to different users. For more information on role setting by repository folder, see the next section.

Openbravo Jasper Folder Permissions.png

The following guidelines should be followed when setting up the folder structure in the reporting server repository:

By following the above setup new roles/users will not encounter unexpected authorization issues.

Navigate from the backoffice directly to the Reports Server

When single sign on is configured it is possible to navigate directly from the Openbravo backoffice to the Reports Server.

Openbravo Open Jasper server.png

Report Listing

It is possible to directly show/open reports within the Openbravo backoffice. For this visit the 'Reports Server Report Listing' window. It will search for all the reports within the base reports folder (see the Reporting Configuration) and display them. Reports are only shown if the user has access to the report based on the current role of the user and the role mapping (see above section on role mapping).

Openbravo Reports Server Report Listing.png

To open a report, select a record and then click the 'Open Report' button.

Openbravo Open Reports Server Report Listing.png

Report Bursting

Jasper Reports Server allows you to schedule reports to be send by email or generated on designated file locations. The reports bursting functionality of Openbravo allows you to use this functionality for a large set of users. The main features of our report bursting functionality:

Report Bursting Main Steps

The main steps in the report definition are:

The report schedules can easily be regenerated from the Openbravo backoffice when new users have been introduced or roles change.

Create a template job within Jasper/Openbravo Reports Server

The first step is to create a report schedule in Jasper. This report schedule is the template for the report schedule for each individual user. Set the timing, the type of output (pdf, xls etc.) and the email subject and body text. After saving the template schedule check the schedule id. Note: the template report job does not have to be enabled.

Openbravo Jasper Report Schedule.png

Note: one not-yet-supported feature is to generate the report on different file locations for different users. In this release the main idea is to send reports by email.

Create Report Bursting Definition in Openbravo Backoffice

The report bursting definition in the Openbravo backoffice has several parts:

Each of these parts is discussed here.

The Report Bursting Definition Header

The report bursting definition header allows you to specify a name and description and then two additional important fields:

Openbravo Jasper Report Burst Definition.png
The Report Bursting Variables

A main feature of report bursting is that each receiver of a report will get a report with his/her own personalized content. For example, a sales rep will only get the sales data for the tickets which he/she created, a store manager will only get a report for his/her store. To accomplish this the assumption is that the report has parameters to customize the content. For example as shown below.

Openbravo Jasper Report Parameters.png

The idea is that in the report bursting definition you can generate specific values for these parameters based on the user which will receive the report. The parameters are generated/set using the Report Bursting Variables tab which links Openbravo user specific variables to report parameters.

Openbravo Jasper Report Burst Variables.png

The variable name should correspond to the technical name of the parameter in Jasper. To find out the name you can just try one and press save, the error message will show you the available parameter names (see below). Based on the report parameters of your report as you defined them in Jasper you should be able to see what name correspond to what parameter.

Within the Jasper report template check also what value Jasper uses for the parameter, this depends on the report definition. This can be for example the name or the search key for a record.

With this knowledge you can then select which value of the user can be used to set the relevant parameter in the report schedule. You can use a so-called property path through the entity model starting from the user. The entity model is described here. The format of the parameter is always: '${user.[PROPERTY_PATH]}'. See the examples in the screenshot above.

Openbravo Jasper Report Burst Variables Name.png
Updating Report Schedules

Updating the report schedules is done by clicking the 'Update Report Schedules' button in the top. This action will create new report jobs for new users and remove report jobs of non-included users.

Note: check the paragraph, discussing a common error, further below.

To regenerate all report jobs, first remove them with the remove report jobs and then regenerate.

Remove and update report jobs are comparatively light actions so you can do them several times without issues.

Generated jobs will be prefixed with the template job name and suffixed with the user name.

Openbravo Jasper Report Burst Report Jobs.png

The resulting report jobs within Jasper:

Jasper Report Burst Report Jobs Generated.png

When you would go into the jasper report job you will find that several parameters are now set to the user specific values making the content personalized for the receiving user.

Jasper Report Burst Report Jobs Generated Variables.png

A possible error message when generating schedules is shown below. This error message occurs when the start date of the interval definition of the template job is in the past. Login into the jasper reports server to update the template schedule start date on the schedule tab.

Jasper Report Burst Report Jobs Generate Error.png

Retrieved from ""

This page has been accessed 18,027 times. This page was last modified on 1 March 2022, at 22:54. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.