As promised, the rest of this chapter will get you rolling with hands-on exercises for learning BI Publisher. Here, the goal is to step through the critical parts for setting up a BI Publisher 12c environment, creating a report or two, and preparing a report for delivery. Along the way, we will highlight features that you should keep an eye out for, research on your own at a later date, or simply understand to make your development cycles easier.
Let's start with administration. Because without that, there isn't much else you, or any of your users, will be able to do.
This section gets away from the theory and core explanations that you've read so far. You will take a step-by-step journey through a real-world implementation. This includes how to assess the Fusion Middleware Security application roles, create several data sources, and ensure that application roles have access to the desired data sources. All of this effort prepares you for creating an actual BI Publisher--sorry (!)--Published Reporting report.
Getting to the Administration page is the first step in this process. Start by following these steps:
http://<server_ name>:<default_port>/analytics/
,with the WebLogic administrator user credentials.From the BI Publisher Administration page, verify the existing application roles available from FMW Security. Again, FMW Security aims to manage all privileges by application roles as a more streamlined way of organizing users from multiple identity providers. It is also an open standard way of authorization:
Notice how an application role, which doesn't show here, is the authenticated user role. This application role has special properties within Fusion Middleware Security. Special consideration should be taken before removing this role from the Enterprise Manager Fusion Middleware Control application roles panel. But if your project's security calls for stringent control and you need to remove this role, please note that this will immediately affect the BI Consumer application role and all other principals related to it.
As a prerequisite to this chapter, you should have already deployed a database to your relational database management system. This exercise will make reference to the database dump conducted against OBIEE. The JDBC connection information should be similar if you are using a MySQL database, or in our case, an SQl Server DB:
AdventureDB
.
In order to use any type of file as a data source with BI Publisher, the potential data source filesystem location must be declared as a data source, using the same principle as creating any other connection. The interesting thing about the filesystem data source is that you have to assign a top-level filesystem directory as the source, and not the individual file itself, in the Administration page. At a later time, this allows you to either upload the file or leverage a file that exists in the data source directory as a feed for your reports. To keep it simple, let's create a File data source in a readily available path on your server:
Alternatively, if we had our own file we could click on the Add Data Source button and add a name in the Data Source Name field. Then in the Full Path of the Top-level Directory field, enter the folder that is located on the server where you have installed Oracle BI Publisher. On a Linux system, this may be /home/<user>/
, for example.
If you are using an MS Windows OS, it may be necessary to enter the directory path using forward slashes and not the standard back slashes. This is usually due to the Java OS agnostic escaping of special characters of which a Nix system is already compliant when it comes to the handling of a directory path syntax.
After creating several data sources, there is a simple way to verify the data source assignment privileges for each application role:
Be aware that the session timeout settings differ in BI Publisher when compared to Oracle BI Foundation Presentation services. You may be conducting configurations in the BI Publisher Administration page via Oracle BI Presentation services and notice that some commands don't function properly. This may be due to your BI Publisher session timing out. If so, click on the Administration link in the global header again and navigate to Manage BI Publisher once more.
Now that the data sources have been created, the data model modeling can begin. Th following is a standard initial process:
During the creation of data sources, enter proper descriptions, and keep notes as to why the data sources were created. Due to the ease of adding data sources without enterprise top-down guidance, as in the Oracle BI metadata repository RPD, it is easy to have superfluous or nonutilized data sources cluttering the tool. Part of a BI Publisher administrator's duties may be to design a solid security model that restricts the number of users who can build a data model in order to keep the number of data models in the system manageable. On that note, let's get cracking with creating our first simple data model.
This exercise and the remainder of the development exercises will take place in the Oracle BI Presentation Services portal. Although the BI Publisher environment /xmlpserver application can be used for development, our examples follow the principle that the two environments are fully integrated and the most common entry point to the system will be the OBIEE Presentation services.
As with Object Orient Programming (OOP), all Oracle BI artefacts should be organized in a way that common artefacts are grouped together and made able to be easily repurposed whenever possible. Oracle BI Publisher 12c provides this capability to reuse data models across multiple reports. Let's begin by creating the container folder:
BI Publisher Reports
when the New Folder prompt appears.BI Publisher Reports
under the Shared Folders
catalog directory. In the next step, we will create a data model and add it to this folder.In this section, you will create a single data model for the finance reports that we will create soon:
Finance
.
Untitled
value to Finance
.BI Publisher Reports
folder, which you created in the previous exercise, from the the dialog box on the left-hand side of the page.A data model can hold one or more related or unrelated data sets. Data sets are the means to which the data we wish to populate reports is organized. The first data set to create is one that allows the data in our AdventureWorks database to be joined logically. Even though a relationship may exist at the physical database via a primary key/ foreign key relationship, it must still be logically represented in BI Publisher. This logical representation of the relationships allows the GUI interface to manage and optimize queries, parameterization, and so on. Follow the next steps to create a simple data set for the main report that you will create.
Finance
in the Namefield.The Query Builder window will open and the data source's available objects will be listed on the left pane of the window:
Note that we can see the warehouse physical tables. You can also swap between DB catalogs and schema, and search for objects in the left pane. Click on the following tables in the left pane of the window to bring them into the main panel of the Query Builder: FactFinance
, DimOrganization
, DimDate
, DimScenario
, DimDepartmentGroup
, and DimAccount
.
Join the tables with their respective relationships by clicking on the empty box corresponding to the column of each table where a relationship exists:
DimOrganization
table.FactFinance
table.
DimOrganization
table.FactFinance
table:select dg.DepartmentGroupName, d.CalendarYear, sum(f.Amount) from DimDepartmentGroup dg, DimDate d, FactFinance f where ( dg.DepartmentGroupKey = f.DepartmentGroupKey and d.DateKey = f.DateKey ) group by dg.DepartmentGroupName, d.CalendarYear
Each data set has the ability to represent columns with an alias just like in a standard SQL. Using the Query Builder, the names that would ultimately be shown to report developers and report viewers are the physical data source column names. However, they can be changed in the data set, so that these business names are there by default when development starts:
null
to Revenue
DepartmentGroupName
to Department
CalendarYear
to Year
By default, an SQL data set is static. That is to say that the current logic you have coded in your SQL statement will not change or be dynamically filtered. Static reports are too rigid to be effective in today's enterprise. So, parameterization or the ability to change a data set by passing a variable to replace a filtered value within the query creates a dynamic result. One or more parameter variables can be created for a data model. A parameter can be created explicitly just as you created a data set by selecting the option in the left pane and then creating the parameter in the main editor, or it can be done using the Data Set Editor itself. Now we'll conduct an exercise using the latter approach:
where d.CalendarYear = 2013
:p_year
and d.CalendarYear
= :p_year
.:
before p_year
) and click on the OK button.
p_year
:
A parameter is now in place to dynamically adjust the SQL query result set. A good idea is to provide a drop-down list, or similar, to allow for selecting one or more values to manipulate our new dynamic query. In BI Publisher, this is commonly referred to as a list of values. A list of values can be a hardcoded static list defined once, or it can stem from a data source query. This example uses the former approach. To create a static list of values follow these instructions:
LOV_YEAR
in the Name
field.
p_year
parameter is associated with the dataset, but now the list of values, LOV_YEAR
, needs to be associated to the parameter. This is fairly straightforward and one of the last steps in wrapping up this data model exercise:2006
in the Default Value column field.p_year
on the left pane of the Data Model Editor.p_year
row:Year
Once you are satisfied that the data model is complete for your data requirements (or even during the course of your iterative development), it is always a good idea to look at the data that now stems from your creation. BI Publisher looks at this as sampling your data. This sample data has three purposes. The first allows you to see that your data set has been created correctly and allows you to test your parameterizations and other properties on a small scale. The second allows you to see your data represented in XML format, which is ultimately how BI Publisher data is put together so that it can then leverage open standards for formatting, and so on. The third, is that, a sample data file will be saved in XML format, so that it can then be used to assist you in creating your reports without having to send repetitive queries back to the underlying data source.
The third point highlights a key distinction from report development with OBIEE's ad-hoc analysis tool versus the production reporting of BI Publisher. With OBIEE's Interactive Reporting, the focus is mostly on the consumption of data. So, even when developing the report, the query attempts to ping the underlying data source each time the analysis request is displayed. BI Publisher has a heavier focus on aesthetics. So, leveraging a sample data file prevents overhead and keeps an emphasis on production report development.
To get at the sample data, follow these instructions:
sample.xml
file:
Just like the Data Model Editor, which handles the configuration of data sources by using a Dynamic HyperText Markup Language (DHTML) web-based interface, a complementing report design tool within BI Publisher--Layout Editor--also uses DHTML. Historically,BI Publisher users were relegated to using software suite (for example, MS Word) plugins in order to create templates to layout reports and ultimately publish those reports for consumption. Now, the same pixel-perfect layout and design efforts can be achieved in full Web 2.0 glory using the Layout Editor.
Some argue that using the software plugins to develop BI Publisher templates provides more control than what the Layout Editor currently provides. This is debatable.
Each time you attempt to create a published report in Oracle BI 12c, you will be prompted to select an existing data model, create a new one, or upload a spreadsheet to leverage as the data model.
You've created a simple data model in the exercise shown in the preceding section, so that it won't be a problem. After that selection is made, you'll be prompted to select a layout that defines the initial format of your report. You can create a new template, select from a set of very generic starter templates, upload an existing template, or have BI Publisher generate the layout for you based on the structure of the selected data model. You will use the latter option by following these steps:
Finance1
file and click on the OK button.Finance1
data model file from the Shared Folders/BI Publisher Reports
folder:BI Publisher Reports
folder. Of course, you should organize folders in a manner that is logical to your individual project requirements.Departmental Finance Report
in the Namefield by replacing any existing default text.
Revenue per Group
in the Template Name field:
The report is now at a stage where we could start modifying column names and representation to make the report more meaningful. We could also add charts. Using the basic functionality and nice autogenerate feature of the Layout Editor, you saw how easy it is to leverage an existing data model to build a quick report. You can see that a published report can contain one or more layouts. Those layouts can stem from templates designed using the Layout Editor or from an uploaded template from one of the software plugins. The standard data format for a template is a Rich Text Format (RTF) file noted by the RTF file extension. This published report could now be embedded in an Oracle BI dashboard in the /analytics portal for user consumption or for quick export to MS Excel, if one is only after the data.
We have gone through a basic example in creating and publishing a report. Go ahead and experiment!
Oracle BI Publisher 12c has the capability to retrieve and analyze data on the way users interact with the tool. As a mainly web- based consumption tool for reporting, users are always logging in to the system, viewing reports, and spending time analyzing data. It's clear that there is a need, from both security compliance and performance improvement perspectives, to collect information regarding how users are using the tool. Since BI Publisher 12c is integrated with Oracle Fusion Middleware, it can leverage the Fusion Middleware Audit Framework.
Spelunking through log files for this information is in the past. The auditing system information can be dumped to a file's system log or a relational database. Clearly with the relational database as the repository, BI Publisher, or some other reporting tool, can easily consume that data feed and put up some quality auditing analytics. This is fairly straightforward to set up and configure. This exercise will walk you through how to achieve this ancillary configuration.
This is fairly straightforward. Two files need to be configured so that BI Publisher can recognize the change for capturing and writing the audit information. The following steps should take place on the server where BI Publisher and the Oracle BI server are installed:
xmlp-server-config.xml
file. This file is located down the long directory path of $BI_HOMEuser_projectsdomainsbifoundation_ domainconfigbipublisherrepositoryAdminConfiguration
.xmlp-server-config.xml
file using WordPad or a similar program.MONITORING_ENABLED AUDIT_ENABLED
xmlp-server-config.xml
file directly before the closing </xmlpConfig>
tag: <property name="AUDIT_JPS_INTEGTRATION" value="true" />
xmlp-server-config.xml
file.Your file should look a bit like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <xmlpConfigxmlns="http://xmlns.oracle.com/oxp/xmlp"> <property name="SAW_SERVER" value=""/> <property name="SAW_SESSION_TIMEOUT" value="90"/> <property name="DEBUG_LEVEL" value="exception"/> <property name="SAW_PORT" value=""/> <property name="SAW_PASSWORD" value=""/> <property name="SAW_PROTOCOL" value="http"/> <property name="SAW_VERSION" value="v4"/> <property name="SAW_USERNAME" value=""/> <property name="MONITORING_ENABLED" value="true"/> <property name="AUDIT_ENABLED" value="true"/> <property name="AUDIT_JPS_INTEGRATION" value="true"/> </xmlpConfig>
The FMW Audit Framework will now need to have reference to how BI Publisher handles the collection of its auditing information. Copying the existing BI Publisher audit events file to the common directory, where auditing information can be read, is done in a few simple steps:
$BI_HOMEoracle_commonmodulesoracle. iau_12.2.2components
.xmlpserver
in this path and using the native OS make a directory command, for example, mkdir xmlpserver
.component_events.xml
file from $BI_HOMEuser_projects domainsbifoundation_domainconfigbipublisherrepository AdminAudit
.component_events.xml
file to the xmlpserver
directory created in step 2.3.140.188.244