6 Developing BI Publisher Reports

Oracle Business Intelligence Publisher (BI Publisher) is a strategic enterprise reporting product that provides the ability to create and manage highly formatted reports from a wide range of data sources. You can design the layout of your BI Publisher reports using Microsoft Word or Adobe Acrobat then create the reports from different types of data sources.

Oracle Enterprise Manager Cloud Control is integrated with BI Publisher. Oracle recommends using BI Publisher to create reports for Enterprise Manager Cloud Control 12c and later. BI Publisher includes the Data Model Editor, which is a graphical user interface for building data models within the BI Publisher interface, and the Layout Editor, which is a design tool that enables you to create report layouts within BI Publisher.

This chapter includes the following topics:

6.1 Introduction to Oracle BI Publisher

Plug-in developers:

  1. Develop reports using data models and report templates.

    For more information about developing a report, see "Developing a Report".

  2. Stage and deploy reports.

    For more information about staging and deploying reports, see "Using the Enterprise Manager EDK for Staging and Deploying BI Publisher Reports".

6.1.1 Assumptions and Prerequisites

This chapter assumes you are familiar with the following:

  • Management repository views against which you can write your own queries.

  • Familiarity with BI Publisher.

6.2 Training and Resources

Before you start to develop a BI Publisher report, you should take advantage of the training and reference resources available from Oracle:

6.3 About the Report Data Source

The EMREPOS data source is available from the BI Publisher server configured for use with Enterprise Manager reports. The EMREPOS data source connects to the MGMT_VIEW account in the Management Repository and establishes the proper security context (VPD) for the Enterprise Manager user logged on to BI Publisher.

As a security measure, BI Publisher reports that use the EMREPOS data source have read-only access to the public MGMT$VIEW and GC$ views, and not to the underlying Enterprise Manager tables. This model also supports sharing report queries with Enterprise Manager users who might want to use the Enterprise Manager-provided reports as a basis for their own reports.

6.4 Developing a Report

By default the reports and data models in the Enterprise Manager Cloud Control folder are read only. Develop your own reports in your local folders and then have a BI Publisher system administrator put the finished reports in a shared folder, outside of the Enterprise Manager Cloud Control folder.

To develop a BI Publisher report:

  1. Develop your data model, based on SQL queries against the Management Repository.

    The following components are required to develop a BI Publisher report:

    • Data model

    • Report template

    • Sub template

    First, develop your data model, based on SQL queries against the Management repository, then design the layout of your report (the template) using Microsoft Word for Windows. Your template refers to one of the two common Oracle subtemplates: Portrait or Landscape.

    Review the following reports for examples of this:

    Enterprise Manager Cloud Control -> EM Sample Reports -> Targets of Specified Type
    
    Enterprise Manager Cloud Control -> EM Datamodels -> Targets of Specified Type
    
  2. Develop and test the SQL queries for report data and input parameters.
  3. Create a data model in BI Publisher for your data queries.
  4. Create parameters in BI Publisher for your report parameters.
  5. Create a report layout for your report.

    Start with the sample landscape or portrait layout RTF file provided with the Extensibility Development Kit (EDK).

  6. Create and test your report.

    Download the report and data model using BI Publisher. The download option is located on the 'more...' link under the name of each report/data model.

  7. Export the report file (.xdoz) and data models (.xdmz) from BI Publisher into local files.

6.5 Using the Enterprise Manager EDK for Staging and Deploying BI Publisher Reports

To deploy BI Publisher reports from a plug-in to a BI Publisher web application:

  1. Create a metadata file that adheres to the following schema:

    emcore/source/oracle/sysman/emSDK/ip/bipublisherreport/BIPublisherReport.xsd
    

    The following is an example of a report metadata file:

    <?xml version = '1.0' encoding = 'UTF-8' ?>
    <BIPublisherReports
            xmlns="http://www.example.com/DataCenter/BIPublisherReport">
            <ReportFile relativePath="emreports" fileName="tvmlrb104a.jar"/>
            <ReportFile relativePath="emreports" fileName="tvmlrb104b.jar"/>
    </BIPublisherReports>
    
  2. Stage the BI Publisher reports, which are ZIP files with the extension .xdoz (report definition) or .xdmz (report data model, that is, SQL) into one or more JAR files. These files are referenced in the previous metadata file.

    The $ORACLE_HOME/sysman/jlib/emreports.jar file provides an example.

    $ unzip -l emreports.jar
    Archive:  emreports.jar
    Label: EMGC_MAIN_LINUX_110220
      Length      Date    Time    Name
    ---------  ---------- -----   ----
            0  02-20-2011 23:08   META-INF/
           71  02-20-2011 23:08   META-INF/MANIFEST.MF
            0  02-20-2011 23:08   bipublisherreports/
            0  02-20-2011 23:08   bipublisherreports/EM Datamodels/
         4776  02-20-2011 23:08   bipublisherreports/EM Datamodels/Usage Trend Report.xdmz
         4854  02-20-2011 23:08   bipublisherreports/EM Datamodels/Usage Summary Report.xdmz
         5008  02-20-2011 23:08   bipublisherreports/EM Datamodels/Charge Trend Report.xdmz
         7344  02-20-2011 23:08   bipublisherreports/EM Datamodels/Consolidation Reports.xdmz
         5043  02-20-2011 23:08   bipublisherreports/EM Datamodels/Charge Summary Report.xdmz
            0  02-20-2011 23:08   bipublisherreports/Chargeback/
        52291  02-20-2011 23:08   bipublisherreports/Chargeback/Charge Trend Report.xdoz
        66994  02-20-2011 23:08   bipublisherreports/Chargeback/Charge Summary Report.xdoz
        26505  02-20-2011 23:08   bipublisherreports/Chargeback/Usage Trend Report.xdoz
       112150  02-20-2011 23:08   bipublisherreports/Chargeback/Usage Summary Report.xdoz
            0  02-20-2011 23:08   bipublisherreports/Consolidation Planner/
        50114  02-20-2011 23:08   bipublisherreports/Consolidation Planner/Consolidation Reports.xdoz
    ---------                     -------
       335150                     16 files
    
  3. Create your plug-in JAR files.

    The first directory in each JAR file must be bipublisherreports. All of the data models for the reports must be in the same subdirectory, EM_Datamodels, just under the bipublisherreports directory. For example:

    1. The plug-in, which contains all of the metadata files and BI Publisher report JAR files is installed dynamically (for metadata Plug-ins) using the plug-in environment.

    2. The BI Publisher report JAR files are placed in a subdirectory of the metadata/bipublisherreport directory and referenced in the metadata file (emreports).

    3. The BI Publisher reports for both platform and plug-ins are deployed to a BI Publisher web application (either at plug-in installation time or sometime later when BI Publisher is installed).

      Plug-in reports are deployed when BI Publisher is integrated with Enterprise Manager using the configureBIP script or sometime later using one of the following EMCLI verbs:

      • * emcli setup_bipublisher (see Help for usage details)

      • * emcli deploy_bipublisher_reports[-force]

        This last verb deploys the EM System reports (and optionally Extensibility Development Kit plug-in loaded reports) to a previously setup EM to BI Publisher relationship (using setup_bipublisher). It can also be used to upload a reports JAR file (located on the Oracle Management Server (OMS) filesystem). The operation will not overwrite existing BI Publisher reports in the EM Reports folder unless -force is used in the command.

        The following options are available:

        Option Description

        [-pluginid]

        In addition to Enterprise Manager system reports, you can use this option to deploy any subsequently loaded plug-in based BI Publisher reports.

        [-pluginversion]

        This options limits the plug-ins to a specific version.

        [-reportsjarfile]

        Use this option to deploy a single Enterprise Manager reports JAR file that contains one or more BI Publisher reports. This JAR file is located relative to the OMS's $ORACLE_HOME. directory.

        For example, the syntax for the emct plug-in is:

        emcli deploy_bipublisher_reports -pluginid=oracle.sysman.emct -pluginversion=12.1.0.0.0
        

        Note:

        Do not use overlapping folders from different JAR files and PLATFORM JAR files. Doing this causes reports from the different JAR files to be placed in the same BI Publisher folder. If the same report name is referenced in multiple JAR files, there is no way of knowing which one will be deployed last.