4. Adding BI to Your Application

  1. Include the add-on in your project.

    • If your project does not use other CUBA Premium Add-ons, add the following lines to the buildscript.repositories section of your build.gradle:

      buildscript {
          // ...
          repositories {
              // ...
              maven {
                  url 'https://repo.cuba-platform.com/content/groups/premium'
                  credentials {
                      username(rootProject.hasProperty('premiumRepoUser') ?
                          rootProject['premiumRepoUser'] : System.getenv('CUBA_PREMIUM_USER'))
                      password(rootProject.hasProperty('premiumRepoPass') ?
                          rootProject['premiumRepoPass'] : System.getenv('CUBA_PREMIUM_PASSWORD'))
                  }
              }
          }
    • Open your project in CUBA Studio.

    • Edit Project properties and on the App components panel click the plus button next to Custom components.

    • In the Custom application component dialog, enter coordinates of the BI add-on:

      • Artifact group: com.haulmont.addon.bi

      • Artifact name: cuba-bi-global

      • Version: 1.4.0

        Select the add-on version compatible with the CUBA platform version used in your project:

        Platform Version Add-on Version

        6.5.x

        1.1.1

        6.6.x

        1.2.1

        6.7.x

        1.2.3

        6.8.x

        1.2.4

        6.9.x

        1.3.0

        6.10.x

        1.4.0

        For example:

        bi component
        Figure 27. BI add-on
  2. Add cuba.web.mainTabSheetMode property to your web-app.properties file in order to keep report content while switching application tabs:

    cuba.web.mainTabSheetMode = MANAGED
  3. Register your BI report in the BI > BI Reports screen provided by the add-on. Click Create and set the path to your Pentaho report:

    bi create
    Figure 28. BI Reports screen

    The list of roles allows you to make the report available to certain users only. If the list is empty, the report is available to all.

    Now users can run the report in the BI > Run BI Reports screen.

  4. Another option is to embed BI reports to application screens using the biComponent visual component provided by the add-on. For example:

    <cubabi:biComponent id="biComponent"
                        height="100%"
                        reportPath=":home:admin:ProductsByTypeAndLocation.saiku"
                        width="100%"/>

    The reportPath attribute is the path to the report file in Pentaho User Console. Also, add the cubabi namespace to the xmlns attribute of the window element:

    xmlns:cubabi="http://schemas.company.com/cubabi/0.1/ui-component.xsd"