4. Adding BI to Your Application

  1. Install the add-on in your project.

    • Double-click Add-ons in the CUBA project tree.

      addons
      Figure 27. Add-ons in CUBA project tree
    • Select Marketplace tab and find Business Intelligence add-on.

      bi addon
      Figure 28. Marketplace window
    • Click Install button and then Apply & Close.

      addon install
      Figure 29. Apply & Close button
    • Click Continue in the dialog.

      addon continue
      Figure 30. Confirm dialog

      The add-on corresponding to the used platform version will be installed.

  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 31. 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"