Oracle® Fusion Middleware: Data Modeling Guide For Oracle Business Intelligence Publisher
Oracle® Fusion Middleware: Data Modeling Guide For Oracle Business Intelligence Publisher
Oracle® Fusion Middleware: Data Modeling Guide For Oracle Business Intelligence Publisher
12c (12.2.1.4.0)
E91497-05
August 2021
Oracle Fusion Middleware Data Modeling Guide for Oracle Business Intelligence Publisher, 12c (12.2.1.4.0)
E91497-05
Contributors: Oracle Business Intelligence Publisher development, quality assurance, and product
management teams.
This software and related documentation are provided under a license agreement containing restrictions on
use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your
license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,
transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse
engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is
prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If
you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on
behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software,
any programs embedded, installed or activated on delivered hardware, and modifications of such programs)
and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end
users are "commercial computer software" or "commercial computer software documentation" pursuant to the
applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use,
reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or
adaptation of i) Oracle programs (including any operating system, integrated software, any programs
embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle
computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the
license contained in the applicable contract. The terms governing the U.S. Government’s use of Oracle cloud
services are defined by the applicable contract for such services. No other rights are granted to the U.S.
Government.
This software or hardware is developed for general use in a variety of information management applications.
It is not developed or intended for use in any inherently dangerous applications, including applications that
may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you
shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its
safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this
software or hardware in dangerous applications.
Oracle, Java, and MySQL are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are
used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc,
and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered
trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products,
and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly
disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise
set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be
responsible for any loss, costs, or damages incurred due to your access to or use of third-party content,
products, or services, except as set forth in an applicable agreement between you and Oracle.
Contents
Preface
Audience ix
Documentation Accessibility ix
Related Documentation and Other Resources x
Conventions x
iii
Entering SQL Queries 2-3
Creating Non-Standard SQL Data Sets 2-5
Using the SQL Query Builder 2-8
Overview of the Query Builder 2-8
Understanding the Query Builder Process 2-9
Supported Column Types 2-9
Adding Objects to the Design Pane 2-10
Removing or Hiding Objects in the Design Pane 2-10
Specifying Query Conditions 2-10
Creating Relationships Between Objects 2-12
Saving a Query 2-13
Editing a Saved Query 2-14
Adding a Bind Variable to a Query 2-15
Adding a Bind Variable Using a Text Editor 2-15
Adding Lexical References to SQL Queries 2-16
Defining SQL Queries Against the Oracle BI Server 2-18
Notes for Queries Against Oracle Fusion Applications Tables 2-19
Creating a Data Set Using a MDX Query Against an OLAP Data Source 2-20
Creating a Data Set Using a MDX Query 2-20
Using MDX Query Builder 2-21
Understanding the MDX Query Builder Process 2-21
Using the Select Cube Dialog 2-22
Selecting Dimensions and Measures 2-22
Adding Dimension Members to the Slicer/POV Axis 2-23
Performing MDX Query Actions 2-23
Applying MDX Query Filters 2-24
Selecting MDX Query Options and Saving MDX Queries 2-24
Creating a Data Set Using an Oracle BI Analysis 2-26
Additional Notes on Oracle BI Analysis Data Sets 2-27
Creating a Data Set Using a View Object 2-27
Additional Notes on View Object Data Sets 2-28
Creating a Data Set Using a Web Service 2-28
Web Service Data Source Options 2-29
Creating a Data Set Using a Simple Web Service 2-29
Creating a Data Set Using a Complex Web Service 2-32
Additional Information on Web Service Data Sets 2-33
Creating a Data Set Using an LDAP Query 2-33
Creating a Data Set Using a XML File 2-35
About Supported XML Files 2-35
Using a XML File Stored in a File Directory Data Source 2-35
Uploading a XML File Stored Locally 2-36
iv
Refreshing and Deleting an Uploaded XML File 2-37
Creating a Data Set Using a Content Server 2-38
Creating a Data Set Using a Microsoft Excel File 2-38
Options for Uploading Excel Files to BI Publisher 2-39
About Supported Excel Files 2-39
Accessing Multiple Tables per Sheet 2-39
Using a Microsoft Excel File Stored in a File Directory Data Source 2-40
Uploading a Microsoft Excel File Stored Locally 2-41
Refreshing and Deleting an Uploaded Excel File 2-42
Creating a Data Set Using a CSV File 2-43
About Supported CSV Files 2-44
Creating a Data Set from a Centrally Stored CSV File 2-44
Uploading a CSV File Stored Locally 2-45
Editing the Data Type 2-46
Refreshing and Deleting an Uploaded CSV File 2-46
Creating a Data Set from an HTTP XML Feed 2-47
Creating a Data Set from an HTTP XML Data Set 2-47
Using Data Stored as a Character Large Object (CLOB) in a Data Model 2-48
How the Data Is Returned 2-49
Additional Notes on Data Sets Using CLOB Column Data 2-51
Handling XHTML Data Stored in a CLOB Column 2-51
Retrieving XHTML Data Wrapped in CDATA 2-51
Wrapping the XHTML Data in CDATA in the Query 2-52
Testing Data Models and Generating Sample Data 2-52
Including User Information Stored in System Variables in Your Report Data 2-53
Adding the User System Variables as Elements 2-54
Sample Use Case: Limit the Returned Data Set by User ID 2-54
Creating Bind Variables from LDAP User Attribute Values 2-55
3 Structuring Data
Working with Data Models 3-1
About Multipart Unrelated Data Sets 3-1
About Multipart Related Data Sets 3-3
Guidelines for Working with Data Sets 3-5
Features of the Data Model Editor 3-6
About the Interface 3-7
Creating Links Between Data Sets 3-10
About Element-Level Links 3-10
About Group-Level Links 3-11
Creating Element-Level Links 3-11
v
Deleting Element-Level Links 3-11
Creating Group-Level Links 3-12
Deleting Group-Level Links 3-14
Creating Subgroups 3-14
Move an Element Between a Parent Group and a Child Group 3-16
Creating Group-Level Aggregate Elements 3-16
Creating Group Filters 3-21
Performing Element-Level Functions 3-23
Setting Element Properties 3-24
Sorting Data 3-25
Performing Group-Level Functions 3-25
The Group Action Menu 3-26
Editing the Data Set 3-27
Removing Elements from the Group 3-27
Editing the Group Properties 3-27
Performing Global-Level Functions 3-28
Adding a Global-Level Aggregate Function 3-29
Adding a Group-Level or Global-Level Element by Expression 3-30
Adding a Global-Level Element by PL/SQL 3-31
Using the Structure View to Edit Your Data Structure 3-32
Renaming Elements 3-33
Adding Value for Null Elements 3-33
Function Reference 3-33
vi
Using the Flexfield Parameter to Pass Values to a Flexfield Defined in the Data
Model 4-14
Referencing the Flexfield in the SQL Query 4-15
Passing a Range of Values 4-16
6 Adding Flexfields
About Flexfields 6-1
Using Flexfields in Your Data Model 6-2
Adding Key Flexfields 6-2
Entering Flexfield Details 6-3
Adding Descriptive Flexfields 6-7
Including Descriptive Flexfield Reference in SQL Queries 6-8
vii
9 Performance Best Practices
Know Oracle WebLogic Server Default Time Out Setting 9-1
Best Practices for SQL Data Sets 9-1
Only Return the Data You Need 9-2
Use Column Aliases to Shorten XML File Length 9-2
Avoid Using Group Filters by Enhancing Your Query 9-2
Avoid PL/SQL Calls in WHERE Clauses 9-3
Avoid Use of the System Dual Table 9-3
Avoid PL/SQL Calls at the Element Level 9-3
Avoid Including Multiple Data Sets 9-4
Avoid Nested Data Sets 9-4
Avoid In-Line Queries as Summary Columns 9-5
Avoid Excessive Parameter Bind Values 9-5
Tips for Multi-value Parameters 9-6
Group Break and Sorting Data 9-7
Limit Lists of Values 9-8
Working with Lexicals/Flexfields 9-8
Working with Date Parameters 9-10
Run Report Online/Offline (Schedule) 9-10
Setting Data Model Properties to Prevent Memory Errors 9-11
Query Time Out 9-11
DB Fetch Size 9-12
Scalable Mode 9-12
SQL Pruning 9-13
SQL Query Tuning 9-14
Generate Explain Plan 9-14
Explain Plan for a Single Query 9-14
Explaining Plan for Reports 9-15
Guidelines for Tuning Queries 9-16
Tips for Database Tuning 9-17
viii
Preface
Welcome to Release 12c (12.2.1.4.0) of the Data Modeling Guide for Oracle Business
Intelligence Publisher.
Oracle BI Publisher is an enterprise reporting solution for authoring, managing, and delivering
all your highly formatted documents, such as operational reports, electronic funds transfer
documents, government PDF forms, shipping labels, checks, sales and marketing letters, and
much more.
Audience
This guide describes how report authors use BI Publisher's data model editor to fetch and
structure the data for use in the many different types of report layouts that BI Publisher
supports.
The following table provides more information about using BI Publisher for other business
roles.
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility
Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.
ix
Preface
Conventions
This document uses text conventions, summarized below.
Convention Meaning
boldface Boldface type indicates graphical user interface elements associated
with an action, or terms defined in text or the glossary.
italic Italic type indicates book titles, emphasis, or placeholder variables for
which you supply particular values.
monospace Monospace type indicates commands within a paragraph, URLs, code
in examples, text that appears on the screen, or text that you enter.
x
New Features for Data Model Designers
This preface describes changes to the Oracle BI Publisher data model designer.
• See New Features and Changes for Oracle BI Publisher 12c (12.2.1.1.0).
• See New Features and Changes for Oracle BI Publisher 12c (12.2.1).
xi
1
Using the Data Model Editor
This topic describes the components and features supported by the data model editor.
Topics:
• What Is a Data Model?
• Components of a Data Model
• Features of the Data Model Editor
• About the Data Source Options
• Process Overview for Creating a Data Model
• Launching the Data Model Editor
• Setting Data Model Properties
• Manage Private Data Sources
1-1
Chapter 1
Features of the Data Model Editor
Data set types that can use thee full range of data model editor functions
The full range of data model editor functions are supported for these data set types:
• SQL queries submitted against Oracle BI Server, an Oracle Database, or other
supported databases. BI Publisher can retrieve the metadata information from
these SQL queries.
1-2
Chapter 1
Process Overview for Creating a Data Model
Data set types that can use partial data model editor functions
BI Publisher can retrieve the column names and data type information from the data source
of these data set types, but it cannot process or structure the data. Only a subset of the full
range of data model editor functions are supported for data set types:
• Oracle BI Analysis
See Creating a Data Set Using an Oracle BI Analysis.
• View objects created using Oracle Application Development Framework (ADF).
See Creating a Data Set Using a View Object.
Data set types that cannot be modified in the data model editor
For these data set types, BI Publisher can retrieve the data generated and structured at the
source. You cannot apply additional modifications in the data model editor for these data set
types:
• HTTP XML feeds off the Web
See Creating a Data Set from an HTTP XML Feed.
• Web services
See Creating a Data Set Using a Web Service.
To use a Web service to return data for the report, supply the Web service WSDL to BI
Publisher and then define the parameters in BI Publisher.
1-3
Chapter 1
Launching the Data Model Editor
Step Reference
Launch the data model editor. Launching the Data Model Editor
Set properties for the data model. Setting Data Model Properties
(Optional)
Create the data sets for the data model. Creating Data Sets
Define the data output structure. (Optional) Structuring Data
Define the parameters to pass to the Adding Parameters and Lists of Values
query, and define lists of values for users
to select parameter values. (Optional)
Define Event Triggers. (Optional) About Triggers
(Oracle Applications Only) Define Adding Flexfields
Flexfields. (Optional)
Test your data model and add sample Testing Data Models and Generating Sample Data
data.
Add a bursting definition. (Optional) Adding Bursting Definitions
Map Custom Metadata for documents to Adding Custom Metadata for Oracle WebCenter
be delivered to Web Content Servers Content Server
(Optional)
1-4
Chapter 1
Launching the Data Model Editor
Option Description
Validate Validate the queries used for data sets, LOVs, and
bursting definitions.
Manage Private Data Sources Connect to private data sources for your personal
use that do not require setup by an administrator.
View Data Display the Data tab where you view and generate
sample data.
Create Report Create a new report with this data model.
Save / Save As Select Save to save your work in progress to the
existing data model object or select Save As to
save the data model as a new object in the
catalog.
If you create a data model and then navigate out
of the data model editor without saving it, a draft or
temporary data model entry may display in the
Recent section of the Home page. These entries
cannot be manually deleted, but are automatically
deleted after 24 hours.
Help View online help.
1-5
Chapter 1
Setting Data Model Properties
Property Description
Description The description that you enter here displays in the catalog. This
description is translatable.
Default Data Source Select the data source from the list. Data models can include
multiple data sets from one or more data sources. The default
data source you select here is presented as the default for each
new SQL data set you define. Select Refresh Data Source List
to see any new data sources added since your session was
initiated.
Oracle DB Default If you define a query against an Oracle Database, then you can
Package include before or after data triggers (event triggers) in your data
model. Event triggers make use of PL/SQL packages to execute
RDBMS level functions. For data models that include event
triggers or a PL/SQL group filter, you must enter a default PL/SQL
package here. The package must exist on the default data source.
Database Fetch Size Sets the number of rows fetched at a time through the JDBC
connection. This value overrides the value set in the system
properties. If neither this value nor the server setting is defined,
then the server default value of 20 is used. If the server property
Enable Auto DB fetch size mode is set to True, this value is
ignored.
1-6
Chapter 1
Setting Data Model Properties
Property Description
Query Time Out Applies to SQL query-based data models. If the SQL query is still
processing when the time out value is met, the error Failed to
retrieve data xml. is returned. Enter a value in seconds.
If you do not enter a value for this data model, the server property
value is used.
Scalable Mode Processing large data sets requires the use of large amounts of
RAM. To prevent running out of memory, activate scalable mode
for the data engine. In scalable mode, the data engine takes
advantage of disk space when it processes the data. Setting this
to On will impact performance, but guard against out of memory
errors.
Note that Enable Data Model Scalable Mode is also a server-
level property therefore by default the data model-level property is
set to Instance Level to inherit the server or instance level setting.
To turn scalable mode on or off for this particular data model,
select On or Off from the list.
Enable SQL Pruning Applies to Oracle Database queries only that use standard SQL. If
your query returns many columns but only a subset are used by
your report template, SQL pruning returns only those columns
required by the template. Setting this property enhances
processing time and reduces memory usage.
Note that Enable SQL Pruning is also a server-level property
therefore by default the data model-level property is set to
Instance Level to inherit the server or instance level setting. To
turn SQL pruning on or off for this particular data model, select
On or Off from the list.
SQL pruning is not applicable for PDF, Excel, and E-text template
types.
Enable SQL Session Applies to Oracle Database queries that use standard SQL. If you
Trace enable trace, for each SQL statement, the trace contains:
• Parse, execute, and fetch counts
• CPU time and elapsed time
• Physical reads and logical reads
• Number of rows processed
• Library cache failures
• User name for which each parse occurred
• Each commit and rollback
SQL Trace Name Name for the SQL trace.
Backup Data Source If you have set up a backup database for this data source, select
Enable Backup Connection to enable the option; then select it
when you want Oracle BI Publisher to use the backup.
• To use the backup data source only when the primary is
down, select Switch to Backup Data Source when Primary
Data Source is unavailable. Note that when the primary
data source is down, the data engine must wait for a
response before switching to the backup.
• To always use the backup data source when executing this
data model, select Use Backup Data Source Only. Using
the backup database may enhance performance.
You must enable a backup for the data source.
Enable CSV Output Select this option to generate report output only in a CSV file.
1-7
Chapter 1
Setting Data Model Properties
Attaching Schema
The data model editor enables you to attach sample schema to the data model
definition.
Oracle BI Publisher does not use the schema file. However, you can attach the
schema for developer reference. The data model editor does not support schema
generation.
1-8
Chapter 1
Manage Private Data Sources
Data Files
If you have uploaded a local Microsoft Excel, CSV, or XML file as a data source for this
report, the file displays here
Use the refresh button to refresh this file from the local source. For information on uploading
files to use as data sources, see Creating Data Sets.
The figure below shows the Attachments region with sample data and data files attached:
1-9
2
Creating Data Sets
This topic describes creating data sets, testing data models, and saving sample data.
Topics:
• Overview of Creating Data Sets
• Editing an Existing Data Set
• Creating Data Sets Using SQL Queries
• Creating a Data Set Using a MDX Query Against an OLAP Data Source
• Using MDX Query Builder
• Creating a Data Set Using an Oracle BI Analysis
• Creating a Data Set Using a View Object
• Creating a Data Set Using a Web Service
• Creating a Data Set Using an LDAP Query
• Creating a Data Set Using a XML File
• Creating a Data Set Using a Microsoft Excel File
• Creating a Data Set Using a CSV File
• Creating a Data Set from an HTTP XML Feed
• Using Data Stored as a Character Large Object (CLOB) in a Data Model
• Testing Data Models and Generating Sample Data
• Including User Information Stored in System Variables in Your Report Data
2-1
Chapter 2
Editing an Existing Data Set
2-2
Chapter 2
Creating Data Sets Using SQL Queries
2-3
Chapter 2
Creating Data Sets Using SQL Queries
Note:
If you include lexical references for text that you embed in a SELECT
statement, then you must substitute values to get a valid SQL statement.
7. After entering the query, click OK to save. For Standard SQL queries the data
model editor validates the query.
If your query includes a bind variable, you are prompted to create the bind
parameter. Click OK to have the data model editor create the bind parameter.
2-4
Chapter 2
Creating Data Sets Using SQL Queries
See Adding Parameters and Lists of Values for more information on editing parameters.
Procedure Call
Use this query type to call a database procedure. For example, Oracle PL/SQL statements
start with BEGIN. When you use this SQL data type, no metadata is displayed on the data
model structure tab, therefore you cannot modify the data structure or data fields. To
construct your SQL with a procedure call enter the code directly in the text box or copy and
paste from another SQL editor. You cannot use the Query Builder to modify or build these
types of queries.
Non-standard SQL
Use this query type to issue SQL statements that can include the following:
• Cursor statements that return nested results sets
For example:
2-5
Chapter 2
Creating Data Sets Using SQL Queries
pCountry IN VARCHAR2,
pState IN VARCHAR2)
RETURN REF_CURSOR_TEST.refcursor
IS
l_cursor REF_CURSOR_TEST.refcursor;
BEGIN
IF ( pCountry = 'US' ) THEN
OPEN l_cursor FOR
SELECT TO_CHAR(sysdate,'MM-DD-YYYY') CURRENT_DATE ,
d.order_id department_id,
d.order_mode department_name
FROM orders d
WHERE d.customer_id IN (101,102);
ELSE
OPEN l_cursor FOR
SELECT * FROM EMPLOYEES;
END IF;
RETURN l_cursor;
END GET;
END REF_CURSOR_TEST;
DECLARE
type refcursor is REF CURSOR;
xdo_cursor refcursor;
empno number;
BEGIN
OPEN :xdo_cursor FOR
SELECT *
FROM EMPLOYEES E
WHERE E.EMPLOYEE_ID = :P2;
COMMIT;
END;
2-6
Chapter 2
Creating Data Sets Using SQL Queries
• Conditional queries can be executed if you use an if-else expression. You can define
multiple SQL queries in a single data set, but only one query executes at run time
depending on the expression value. The expression validates and returns a Boolean
value. If the value is true, executes that section of the SQL query.
The limitations are:
– The following syntax is supported to evaluate expressions: $if{, $elseif{, $else{
– The expression must return true, false
– Only the following operators are supported:
== <= >= < >
Example:
create sql dataset with following query
$if{ (:P_MODE == PRODUCT) }$
SELECT PRODUCT_ID
,PRODUCT_NAME
,CATEGORY_ID
,SUPPLIER_ID
,PRODUCT_STATUS
,LIST_PRICE
FROM PRODUCT_INFORMATION
WHERE ROWNUM < 5
$elsif{(:P_MODE == ORDER )}$
SELECT ORDER_ID
,ORDER_DATE
,ORDER_MODE
,CUSTOMER_ID
,ORDER_TOTAL
,SALES_REP_ID
FROM ORDERS
WHERE ROWNUM < 5
$else{
SELECT PRODUCT_ID
, WAREHOUSE_ID
,QUANTITY_ON_HAND
FROM INVENTORIES
WHERE ROWNUM < 5
}$
$endif$
When your data set is created using non-standard SQL statements, no metadata is displayed
on the data model structure tab, therefore you cannot modify the data structure or data fields.
You cannot use Query Builder to modify or build these types of queries.
To define XML row tag for non-standard SQL dataset:
Use xmlRowTagName="" in data model definition to define xml row tag for non-standard SQL
query dataset. This allows you to enter a valid tag name. If the attribute is empty, it defaults to
ROW at runtime.
Dataset definition:
2-7
Chapter 2
Creating Data Sets Using SQL Queries
,,
</sql>
</dataset>
2-8
Chapter 2
Creating Data Sets Using SQL Queries
2-9
Chapter 2
Creating Data Sets Using SQL Queries
2-10
Chapter 2
Creating Data Sets Using SQL Queries
The table below describes the attributes available on the Conditions tab.
2-11
Chapter 2
Creating Data Sets Using SQL Queries
As you select columns and define conditions, Query Builder writes the SQL for you.
To view the underlying SQL:
• Select the SQL tab.
2-12
Chapter 2
Creating Data Sets Using SQL Queries
You create a join by selecting the Join column adjacent to the column name. The Join
column displays to the right of the data type. When your cursor is in the appropriate
position, the following help tip displays:
Click here to select column for join
3. Select the appropriate Join column for the first object.
When selected, the Join column is darkened. To deselect a Join column, simply select it
again or press ESC.
4. Select the appropriate Join column for the second object.
When joined, line connects the two columns. An example is shown below.
5. Select the columns to be included in your query. You can view the SQL statement
resulting from the join by positioning the cursor over the join line.
6. Click Results to execute the query.
Saving a Query
Save queries after building them.
Once you have built the query, click Save to return to the data model editor. The query
appears in the SQL Query box. Click OK to save the data set.
2-13
Chapter 2
Creating Data Sets Using SQL Queries
Note:
You cannot edit a customized or an advanced query by using Query Builder.
2-14
Chapter 2
Creating Data Sets Using SQL Queries
• In the Query Builder Conditions tab, add the bind variable for the column using the
following:
in (:PARAMETER_NAME)
Where PARAMTER_NAME is the name you choose for the parameter.
Note:
After manually editing the query, the Query Builder can no longer parse it. You
must make any additional edits manually.
2-15
Chapter 2
Creating Data Sets Using SQL Queries
2. Click Save.
3. In the data model editor, create the parameter that you entered with the bind
variable syntax as shown in the image.
4. Select the parameter, and click OK to enable the data model editor create the
parameter entry for you.
See Adding Parameters and Lists of Values for more information on defining
parameter properties.
2-16
Chapter 2
Creating Data Sets Using SQL Queries
Create a lexical reference in the SQL query using the following syntax:
¶metername
Note:
You also use lexical references to include flexfields in your query. For more
information about using flexfields, see Adding Flexfields.
1. Before creating your query, define a parameter in the PL/SQL default package for each
lexical reference in the query. The data engine uses these values to replace the lexical
parameters.
2. In the data model editor, on the Properties page, specify the Oracle DB Default
Package.
3. In the data model editor, create a Before Data event trigger to call the PL/SQL package.
See Adding Before Data and After Data Triggers for more information about procedures.
4. Create your SQL query containing lexical references.
5. When you click OK to close your SQL query, you are prompted to enter the parameter.
For example, create a package called employee. In the employee package, define a
parameter called where_clause:
Package employee
AS
where_clause varchar2(1000);
.....
Reference the lexical parameter in the SQL query where you want the parameter to be
replaced by the code defined in the package, for example:
When you click OK on the Create SQL Data Set dialog box, the lexical reference dialog box
prompts you to enter a value for lexical references you entered in the SQL query, as shown in
the image that follows. Enter the value of the lexical reference as it is defined in the PL/SQL
package.
2-17
Chapter 2
Creating Data Sets Using SQL Queries
2-18
Chapter 2
Creating Data Sets Using SQL Queries
3. From the Data Source list, select the Oracle BI Server connection, usually shown as
Oracle BI EE.
4. Click Query Builder to launch the Query Builder page. See Using the SQL Query Builder
for more information about the Query Builder utility.
You can also enter the SQL syntax manually in the SQL Query text box, however you
must use the Logical SQL syntax used by the Oracle BI Server.
5. From the Catalog drop-down list, select a subject area as shown below. The list displays
the subject areas defined in the Oracle BI Server.
2-19
Chapter 2
Creating a Data Set Using a MDX Query Against an OLAP Data Source
returns January
– To add an expression in the data model, use the following expression:
Format_date(date, format_String)
For example:
SUBSTRING(FORMAT_DATE(G_1.SYSDATE,MEDIUM),0,3)
returns Nov (when the current SYSTDATE is November)
2-20
Chapter 2
Using MDX Query Builder
4. Enter the MDX query or click Query Builder. See Using MDX Query Builder.
5. Click OK to save. The data model editor validates the query.
Note:
Ensure that in your OLAP data source that you do not use Unicode characters from
the range U+F900 to U+FFFE to define any metadata attributes such as column
names or table names. This Unicode range includes half-width Japanese Katakana
and full-width ASCII variants. Using these characters results in errors when
generating the XML data for a BI Publisher report.
Note:
MDX Query Builder only enables you to build data sets against Essbase data
sources. For all other OLAP data sources, you must manually create the query.
2-21
Chapter 2
Using MDX Query Builder
Build the query by dragging dimension members or measures from the Dimensions
panel to one of the following axes areas:
• Columns— Axis (0) of the query
• Rows — Axis (1) of the query
2-22
Chapter 2
Using MDX Query Builder
• Slicer/POV— The slicer axis enables you to limit a query to only a specific slice of the
Essbase cube. This represents the optional WHERE clause of a query.
• Axis — Axis (2) of the query
You can nest dimension members in the Columns and Rows axes, but you can only add a
single dimension to the Slider/POV axis.
2-23
Chapter 2
Using MDX Query Builder
You can create multiple filters for a query, but you can only create one filter for each
Columns, Rows, or Pages axis.
• To create a filter, click the down-arrow button to the right of a dimension in the
Columns, Rows, or Pages axes to display it in the Filters area. You create the filter
by selecting the desired dimension member as shown below.
2-24
Chapter 2
Using MDX Query Builder
SELECT
NON EMPTY Hierarchize([Market].Generations(2).Members)
PROPERTIES MEMBER_ALIAS,LEVEL_NUMBER ON Axis(0),
NON EMPTY CROSSJOIN(Hierarchize([Product].Generations(3).Members),
{[Accounts].[Margin],[Accounts].[Sales],[Accounts].[Total_Expenses]})ON
Axis(1),
NON EMPTY [Year].Generations(3).Members ON Axis(2) FROM Demo.Basic
For more information on Essbase dimension properties, see: Oracle Essbase Database
Administrator's Guide which can be found here: Oracle Essbase for BI documentation.
After you select options for the MDX query, click OK to return to the New Data Set - MDX
Query dialog and review the MDX query output as shown below.
Click OK to return to the data model editor, and save your changes.
2-25
Chapter 2
Creating a Data Set Using an Oracle BI Analysis
Note:
If you modify a MDX query after you save it in BI Publisher, Oracle
recommends that you manually change the syntax and not use MDX Query
Builder to do so.
Note:
Hierarchical columns are not supported in BI Publisher data models.
1. Click the New Data Set toolbar button and select Oracle BI Analysis.
2. In the New Data Set - Oracle BI Analysis dialog, enter a name for this data set.
3. Click the browse icon to connect to the Oracle Business Intelligence Presentation
catalog, as shown below.
4. When the catalog connection dialog launches, navigate through the folders to
select the Oracle BI analysis to use as the data set for the report.
2-26
Chapter 2
Creating a Data Set Using a View Object
5. Enter a Time Out value in seconds, as shown below. If BI Publisher has not received the
analysis data after the time specified in the time out value has elapsed, then BI Publisher
stops attempting to retrieve the analysis data.
6. Click OK.
2-27
Chapter 2
Creating a Data Set Using a Web Service
Note:
Only document/literal Web services are supported.
To specify a parameter, click Add Parameter and select the parameter from the drop-
down list.
2-28
Chapter 2
Creating a Data Set Using a Web Service
Note:
The parameters must be set up in the Parameters section of the report definition.
For more information, see Adding Parameters and Lists of Values.
1. Click the New Data Set toolbar button, and then select Web Service.
The New Data Set - Web Service dialog is shown below.
2-29
Chapter 2
Creating a Data Set Using a Web Service
2-30
Chapter 2
Creating a Data Set Using a Web Service
8. Click Save.
2-31
Chapter 2
Creating a Data Set Using a Web Service
2-32
Chapter 2
Creating a Data Set Using an LDAP Query
4. To test the Web service, see Testing Data Models and Generating Sample Data.
2-33
Chapter 2
Creating a Data Set Using an LDAP Query
1. Click the New Data Set toolbar button and select LDAP Query.
2. In the New Data Set - LDAP Query dialog, enter a name for this data set.
3. Select the Data Source for this data set.
4. In the Search Base field, enter the starting point for the search in the directory
tree.
Note:
Search Base is required when the LDAP provider is Microsoft Active
Directory. The Search Base defines the starting point of the search in the
directory tree. For example, if you want to query the entire directory,
specify the root.
To specify the starting point, enter each hierarchical object separated by
a comma, starting with the lowest level in the hierarchy, for example, to
search the Sales container in the mycompany.com domain, enter:
ou=Sales,dc=mycompany,dc=com
5. In the Attributes entry box, enter the attributes whose values you want to fetch
from the LDAP data source.
For example:
mail,cn,givenName
6. To filter the query, enter the appropriate syntax in the Filter entry box. The syntax
is as follows:
(Operator (Filter)through(Filter))
For example:
(objectclass=person)
2-34
Chapter 2
Creating a Data Set Using a XML File
LDAP search filters are defined in the Internet Engineering Task Force (IETF) Request for
Comments document 2254,The String Representation of LDAP Search Filters (RFC
2254) on the IETF Web site.
7. Link the data from this query to the data from other queries or modify the output structure.
For instructions on completing this step, see Structuring Data.
Note:
To use BI Publisher's layout editor and interactive viewer, sample data from the
XML file source must be saved to the data model.
2-35
Chapter 2
Creating a Data Set Using a XML File
2-36
Chapter 2
Creating a Data Set Using a XML File
4. Click Upload to browse for and upload the XML file from a local directory. If the file has
been uploaded to the data model, then it is available for selection in the File Name List.
5. Click Upload.
6. Click OK.
7. (Required) Save sample data to the data model. See Testing Data Models and
Generating Sample Data.
See Setting Data Model Properties for more information about the Properties pane.
To refresh the local file in the data model:
1. In the component pane, click Data Model to view the Properties page.
2. In the Attachment region of the page, locate the file in the Data Files list.
3. Click Refresh.
4. In the Upload dialog, browse for and upload the latest version of the file. The file must
have the same name or it will not replace the older version.
5. Save the data model.
To delete the local file:
1. In the component pane, click Data Model to view the Properties page.
2. In the Attachment region of the page, locate the file in the Data Files list.
3. Click Delete.
4. Click OK to confirm.
5. Save the data model.
2-37
Chapter 2
Creating a Data Set Using a Content Server
7. Click OK.
2-38
Chapter 2
Creating a Data Set Using a Microsoft Excel File
Note:
The name that you define must begin with the prefix: BIP_, for example,
BIP_SALARIES.
2-39
Chapter 2
Creating a Data Set Using a Microsoft Excel File
• Using Excel 2003, select the table. On the Insert menu, click Name and then
Define. Enter a name that is prefixed with BIP_.
• Using Excel 2007, select the table. On the Formulas tab, in the Defined
Names group, click Define Name, then enter the name in the Name field. The
name you enter appears on the Formula bar
For example, you could use the Define Name command in Microsoft Excel 2007 to
name a table BIP_Salaries.
Note:
The Excel data set type supports one value per parameter. It does not
support multiple selection for parameters.
To create a data set using a Microsoft Excel file from a file directory data source:
1. Click the New Data Set toolbar button and select Microsoft Excel File. The New
Data Set - Microsoft Excel File dialog launches.
2. Enter a name for this data set.
3. Click Shared to enable the Data Source list.
2-40
Chapter 2
Creating a Data Set Using a Microsoft Excel File
4. Select the data source where the Microsoft Excel File resides.
5. To the right of the File Name field, click the browse icon to browse for the Microsoft Excel
file in the data source directories. Select the file.
6. If the Excel file contains multiple sheets or tables, select the appropriate Sheet Name
and Table Name for this data set, as shown below.
7. If you added parameters for this data set, click Add Parameter. Enter the Name and
select the Value. The Value list is populated by the parameter Name defined in the
Parameters section. Only single value parameters are supported. See Adding
Parameters and Lists of Values.
8. Click OK.
9. Link the data from this query to the data from other queries or modify the output structure.
For more information on linking queries, see Structuring Data.
Note:
The Excel data set type supports one value per parameter. It does not support
multiple selection for parameters.
2-41
Chapter 2
Creating a Data Set Using a Microsoft Excel File
1. Click the New Data Set toolbar button and select Microsoft Excel File. The Create
Data Set - Excel dialog launches.
2. Enter a name for this data set.
3. Select Local to enable the upload button.
4. Click the Upload icon to browse for and upload the Microsoft Excel file from a
local directory. If the file has been uploaded to the data model, then it is available
for selection in the File Name list.
5. If the Excel file contains multiple sheets or tables, select the appropriate Sheet
Name and Table Name for this data set, as shown below.
6. If you added parameters for this data set, click Add Parameter. Enter the Name
and select the Value. The Value list is populated by the parameter Name defined
in the Parameters section. Only single value parameters are supported. See
Adding Parameters and Lists of Values.
7. Click OK.
8. Link the data from this query to the data from other queries or modify the output
structure. For more information on linking queries, see Structuring Data.
2-42
Chapter 2
Creating a Data Set Using a CSV File
See Setting Data Model Properties for information about the Properties pane.
To refresh the local file in the data model:
1. Click Data Model in the component pane to view the Properties page.
2. In the Attachment region of the page, locate the file in the Data Files list.
3. Click Refresh.
4. In the Upload dialog, browse for and upload the latest version of the file. The file must
have the same name or it will not replace the older version.
5. Save the data model.
To delete the local file:
1. Click Data Model in the component pane to view the Properties page.
2. In the Attachment region of the page, locate the file in the Data Files list.
3. Click Delete.
4. Click OK to confirm.
5. Save the data model.
2-43
Chapter 2
Creating a Data Set Using a CSV File
2-44
Chapter 2
Creating a Data Set Using a CSV File
2-45
Chapter 2
Creating a Data Set Using a CSV File
generic name, for example, Column1, Column2. The XML tag names and display
names assigned can be edited in the data model editor Structure tab.
6. Select the CSV Delimiter used in the file. The default selection is Comma (,).
7. Click OK.
See Setting Data Model Properties for more information about the Properties pane.
To refresh the local file in the data model:
1. In the component pane, click Data Model to view the Properties page.
2. In the Attachment region of the page, locate the file in the Data Files list.
3. Click Refresh.
4. In the Upload dialog, browse for and upload the latest version of the file. The file
must have the same name or it will not replace the older version.
5. Save the data model.
To delete the local file:
2-46
Chapter 2
Creating a Data Set from an HTTP XML Feed
1. In the component pane, click Data Model to view the Properties page.
2. In the Attachment region of the page, locate the file in the Data Files list.
3. Click Delete.
4. Click OK to confirm.
5. Save the data model.
2-47
Chapter 2
Using Data Stored as a Character Large Object (CLOB) in a Data Model
Note:
Ensure that your data does not include line feeds or carriage returns. Line
feeds and carriage returns in your data may not render as expected in BI
Publisher report layouts.
2-48
Chapter 2
Using Data Stored as a Character Large Object (CLOB) in a Data Model
5. After entering the query, click OK to save. BI Publisher validates the query.
6. By default, the data model editor assigns the CLOB column the "CLOB" data type. To
change the data type to XML, click the data type icon and select XML.
2-49
Chapter 2
Using Data Stored as a Character Large Object (CLOB) in a Data Model
2-50
Chapter 2
Using Data Stored as a Character Large Object (CLOB) in a Data Model
<![CDATA[
<p><font style="font-style: italic; font-weight: bold;" size="3">
<a href="http://www.oracle.com">oracle</a></font> </p>
<p><font size="6"><a href="http://docs.oracle.com/">Oracle Documentation</a>
</font></p>
]]>
Retrieve the column data using a simple SQL statement, for example:
select CLOB_DATA as "RTECODE" from MYTABLE
In the data model editor, set the data type of the RTECODE column to XML, as shown below.
2-51
Chapter 2
Testing Data Models and Generating Sample Data
Use the following syntax in your SQL query to retrieve it and wrap it in the CDATA
section:
In the data model editor, set the data type of the RTECODE column to XML.
2. For SQL Query, Oracle BI Analysis, and View Object data sets: On the Data tab,
select the number of rows to return. If you included parameters, enter the desired
values for the test.
3. Click View to display the XML that is returned by the data model.
4. Select one of the following options to display the sample data:
• Use Tree View to view the sample data in a data hierarchy. This is the default
display option.
• Use Table View to view the sample data in a formatted table like you see in BI
Publisher reports.
You can create a report based on this data model.
To save the test data set as sample data for the data model:
2-52
Chapter 2
Including User Information Stored in System Variables in Your Report Data
1. After the data model has successfully run, click Save as Sample Data. The sample data
is saved to the data model. See Adding Attachments to the Data Model for more
information.
To export the test data:
1. For SQL Query, Oracle BI Analysis, and View Object data sets: On the Data tab, select
the number of rows to return.
2. After the data model has successfully run, click Export. You are prompted to open or
save the file to a local directory.
To view the data engine log:
1. Click View Data Engine Log. You are prompted to open or save the file to a local
directory. The data engine log file is an XML file.
To test UCM dataset:
For Content Server, based on the document ID and the content type the document content is
retrieved from the content (UCM) server.
Note:
If the Document ID is empty or null, then the document content will be empty.
When you use system variables in an online report, BI Publisher populates the variables. In a
scheduled job, BI Publisher doesn’t populate the XDO_USER_REPORT_LOCALE,
XDO_USER_UI_LOCALE, and XDO_USER_UI_ORACLE_LANG system variables.
2-53
Chapter 2
Including User Information Stored in System Variables in Your Report Data
select
:xdo_user_name as USER_ID,
:xdo_user_roles as USER_ROLES,
:xdo_user_report_oracle_lang as REPORT_LANGUAGE,
:xdo_user_report_locale as REPORT_LOCALE,
:xdo_user_ui_oracle_lang as UI_LANGUAGE,
:xdo_user_ui_locale as UI_LOCALE
from dual
Notice the use of the lower() function, the xdo_user_name is always be in lowercase
format. BI Publisher does not have a USERID so you must use the user name and
either use it directly in the query; or alternatively you could query against a lookup
table to find a user id.
2-54
Chapter 2
Including User Information Stored in System Variables in Your Report Data
Prerequisite
The attributes that can be used to create bind variables must be defined in the Security
Configuration page by an administrator.
The attributes are defined in the Attribute Names for Data Query Bind Variables field of the
LDAP Security Model definition. Any attribute defined for users can be used (for example:
memberOf, sAMAccountName, primaryGroupID, mail).
xdo_<attribute name>
Assume that you have entered the sample attributes: memberOf, sAMAccountName,
primaryGroupID, mail. These can then be used in a query as the following bind variables:
xdo_memberof
xdo_SAMACCOUNTNAME
xdo_primaryGroupID
xdo_mail
Note that the case of the attribute is ignored; however, the "xdo_" prefix must be lowercase.
Use these in a data model as follows:
SELECT
:xdo_user_name AS USER_NAME,
:xdo_user_roles AS USER_ROLES,
:xdo_user_ui_oracle_lang AS USER_UI_LANG,
:xdo_user_report_oracle_lang AS USER_REPORT_LANG,
:xdo_user_ui_locale AS USER_UI_LOCALE,
:xdo_user_report_locale AS USER_REPORT_LOCALE,
:xdo_SAMACCOUNTNAME AS SAMACCOUNTNAME,
:xdo_memberof as MEMBER_OF,
:xdo_primaryGroupID as PRIMARY_GROUP_ID,
:xdo_mail as MAIL
FROM DUAL
The LDAP bind variables return the values stored in the LDAP directory for the user that is
logged in.
2-55
3
Structuring Data
This topic describes techniques for structuring the data that is returned by BI Publisher's data
engine, including grouping, linking, group filters, and group-level and global-level functions.
Topics:
• Working with Data Models
• Features of the Data Model Editor
• About the Interface
• Creating Links Between Data Sets
• Creating Element-Level Links
• Creating Group-Level Links
• Creating Subgroups
• Move an Element Between a Parent Group and a Child Group
• Creating Group-Level Aggregate Elements
• Creating Group Filters
• Performing Element-Level Functions
• Setting Element Properties
• Sorting Data
• Performing Group-Level Functions
• Performing Global-Level Functions
• Using the Structure View to Edit Your Data Structure
• Function Reference
3-1
Chapter 3
Working with Data Models
For example, in the data model, image shown below, one query selects products and
another selects customers. There's no relationship between the products and
customers.
The result is shown in the data structure as depicted in the following image.
3-2
Chapter 3
Working with Data Models
3-3
Chapter 3
Working with Data Models
The example produces the data structure shown in the following image.
3-4
Chapter 3
Working with Data Models
3-5
Chapter 3
Features of the Data Model Editor
3-6
Chapter 3
About the Interface
3-7
Chapter 3
About the Interface
• Diagram View - The Diagram View displays data sets and enables graphically
creating links and filters, adding elements based on expressions, adding
aggregate functions and global-level functions, editing element properties, and
deleting elements. The Diagram View is typically the view you use to build your
data structure.
• Structure View - The Structure View has two modes:
Table View and Output
The table view displays element properties in a table and enables updating XML
element alias names, presentation names of the elements, sorting, null values,
and reset options. The image below shows the structure Table View.
The Output view provides a clear view of the XML structure that is generated. The
Output view cannot be updated. The figure shows the Output view.
3-8
Chapter 3
About the Interface
• Code View - The Code View displays the data structure code created by the data
structure builder that is read by the data engine. You can update the content in code
view. The figure shows the code view.
3-9
Chapter 3
Creating Links Between Data Sets
3-10
Chapter 3
Creating Element-Level Links
Create element-level links, the preferred method, to define master detail relationships
between data sets. When you use element-level links to link data sets, you do not need to
code a join between the two data sets through a bind variable.
3-11
Chapter 3
Creating Group-Level Links
3-12
Chapter 3
Creating Group-Level Links
3. In the Create Group Link dialog, select the child group and click OK. The Create Link
dialog is shown below.
4. Click Menu and then click Edit Data Set to add the bind variables to your query.
An example is shown below.
3-13
Chapter 3
Creating Subgroups
Note:
You must define a unique bind variable in the child query.
Creating Subgroups
In addition to creating parent-child structures by linking two data sets, you can also
group elements in the same data set by other elements.
Creating subgroups might be helpful if your query returns data that has header data
repeated for each detail row. By creating a subgroup you can shape the XML data for
better, more efficient document generation.
1. Select the element to group with the other elements in the data set.
2. Click the element action menu icon to open the menu and select Group by as
shown.
3-14
Chapter 3
Creating Subgroups
This creates a new group within the displayed data set. The following figure shows the
G_2 data set grouped by the element COMPANY. This creates a new group called G_3
that contains the other five elements in the data set. The following figure shows how the
grouped data set is displayed in the Diagram View along with the structure.
3-15
Chapter 3
Move an Element Between a Parent Group and a Child Group
You can perform any of the group actions on the group you have created.
3. To ungroup, click Menu on the group's title bar, and then click Ungroup.
3-16
Chapter 3
Creating Group-Level Aggregate Elements
Once you drop the element, a new element is created in the parent group. By default, the
Count function is applied. The icon next to the name of the new aggregate element
indicates the function. Pause your cursor over the icon to display the function.
The figure below shows the new aggregate element, CS_1. with the default Count
function defined.
3-17
Chapter 3
Creating Group-Level Aggregate Elements
2. To change the function, click the function icon to view a list of available functions
and choose from the list, as shown below.
3-18
Chapter 3
Creating Group-Level Aggregate Elements
3. To rename the element or update other properties, click the element's Action menu icon.
3-19
Chapter 3
Creating Group-Level Aggregate Elements
3-20
Chapter 3
Creating Group Filters
Note:
Be careful when renaming an element as it can have dependency on other
elements.
Property Description
Column Name The internal name assigned to the element by the BI Publisher data
model editor. This name cannot be updated.
Alias (XML Tag Name) Oracle BI Publisher assigns a default tag name for the element in the
XML data file. You can update this tag name to assign a more user-
friendly name within the data file.
Display Name The Display Name appears in the report design tools. Update this name
to be meaningful to your business users.
Function If you have not already selected the desired function, then you can select
it from the list here.
Data Type BI Publisher assigns a default data type of Integer or Double depending
on the function. Some functions also provide the option of Float.
Value if Null If the value returned from the function is null, you can supply a default
value here to prevent having a null in your data.
Round By default, the value is rounded to the nearest third decimal. You can
change the round value, if needed.
Do Not Reset By default, the function resets at the group level. For example, if your data
set is grouped by DEPARTMENT_ID, and you have defined a sum
function for SALARY, then the sum is reset for each group of
DEPARTMENT_ID data, giving you the sum of SALARY for that
department only. If instead you want the function to reset only at the
global level, and not at the group level, select Do Not Reset. This creates
a running total of SALARY for all departments. This property is for group
level functions only.
3-21
Chapter 3
Creating Group Filters
3-22
Chapter 3
Performing Element-Level Functions
Note:
For PL/SQL filters, you must first specify the PL/SQL Package as the Oracle
DB Default Package in the data model properties. See Setting Data Model
Properties.
3-23
Chapter 3
Setting Element Properties
Property Description
Alias BI Publisher assigns a default tag name to the element in the XML
data file. You can update this tag name to assign a more user-
friendly name within the data file.
Display Name The Display Name appears in the report design tools and the
column name in reports. Update this name to be meaningful to your
business users.
Data Type BI Publisher assigns a default data type. Valid values are String,
Date, Integer, Double, Float.
3-24
Chapter 3
Sorting Data
Property Description
Sort Order You can sort XML data in a group by one or more elements. For
example, if in a data set employees are grouped by department and
manager, you can sort the XML data by department. Within each
department you can group and sort data by manager, and within
each manager subgroup, employees can be sorted by salary. If the
element is not in a parent group, the Sort Order property is not
available.
Value if Null If the value of an occurrence of the element is null, you can supply a
default value here to prevent having a null in your data.
Sorting Data
Sorting is supported for parent group break columns only.
For example, if a data set of employees is grouped by department and manager, you can sort
the XML data by department. Within each department you can group and sort data by
manager. If you know how the data should be sorted in the final report, you specify sorting at
data generation time to optimize document generation.
To apply a sort order to a group:
1. Click the action menu icon of the element you want to sort by. From the menu, select
Properties.
2. Select the Sort Order.
The figure below shows the Properties dialog for the DEPARTMENT_ID element with the
Sort Order list displayed.
3-25
Chapter 3
Performing Group-Level Functions
Topics include:
• The Group Action Menu
• Editing the Data Set
• Removing Elements from the Group
• Editing the Group Properties
3-26
Chapter 3
Performing Group-Level Functions
Note:
You can only remove elements added as a group function (sum, count, and so on)
or added as an expression.
3-27
Chapter 3
Performing Global-Level Functions
Note:
If you select a data type of Integer for any calculated element and the
expression returns a fraction, the data is not truncated.
The Global Level Functions object is shown below. To add elements based on
aggregate functions, drag the element to the "Drop here for aggregate function" space
of the object. To add an element based on an expression or PL/SQL, click Menu, and
choose the appropriate action.
3-28
Chapter 3
Performing Global-Level Functions
2. When you release the mouse, the data model editor assigns a default name to the
aggregate element and assigns Count as the default function.
The figure below shows the function for the new global level element CS_1 being
modified from Count to Average.
3-29
Chapter 3
Performing Global-Level Functions
3. Click the function icon to the left of the new element name and choose the function
from the list.
4. To change the default name, click the actions icon to the right of the element name
and click Properties to launch the Edit Properties dialog. See Setting Element
Properties for more about the properties available on this dialog.
3-30
Chapter 3
Performing Global-Level Functions
3. In the Display Name field, enter a name that is meaningful to your business users.
4. (Optional) Select a data type.
5. Use the shuttle arrow to move the data elements required for the expression from the
Available box to the Expression box.
6. Click an operator to insert it in the Expression box, or choose from the function list.
7. Click Validate Expression to validate the expression.
1. On the Properties page, specify the PL/SQL Package as the Oracle DB Default
Package in the data model properties. .
2. On the Global Level Functions object, click Menu, and then click Add Element by PL/
SQL.
3. In the Add Element by PL/SQL dialog, enter the following fields:
• Name - Enter a meaningful name for the element.
• Display Name - Enter a display name. This appears in the report design tools. Enter
a name that is meaningful to your business users.
• Data Type - Select String.
3-31
Chapter 3
Using the Structure View to Edit Your Data Structure
4. Select the PL/SQL package from the Available box and click the shuttle button to
move the function to the Group Filter box.
3-32
Chapter 3
Function Reference
Renaming Elements
Use the Structure page to define user-friendly names for elements in the data model.
You can rename both the XML element tag name (XML View) and the name that displays in
the report layout tools (Business View). The figure below shows renaming the Data Source
elements to friendlier Business View names.
Function Reference
The table below describes the usage of supported functions available from the Add Element
by Expression dialog and the Edit Group Filter dialog.
3-33
Chapter 3
Function Reference
3-34
Chapter 3
Function Reference
3-35
Chapter 3
Function Reference
3-36
Chapter 3
Function Reference
3-37
4
Adding Parameters and Lists of Values
This topic describes how to add parameters and lists of values to a data model.
Topics:
• About Parameters
• Adding a New Parameter
• About Lists of Values
• Adding Lists of Values
• Adding Flexfield Parameters
About Parameters
Adding parameters to a data model enables users to interact with data when they view
reports.
Oracle BI Publisher supports the following parameter types:
• Text - Enables entering a text string to pass as the parameter.
• Menu - Enables making selections from a list of values. A list of values can contain fixed
data that you specify or a list created using a SQL query that is executed against any of
the defined data sources. This option supports multiple selection, a Select All option, and
partial page refresh for cascading parameters.
To create a menu type parameter, define the list of values, and then define the parameter
and associate it to the list of values. See Adding Lists of Values.
• Date - Enables the user to select a date as a parameter. You must use the data type Date
and the Java date format.
After defining the parameters in the data model, you can configure how the parameters are
displayed in the report as a report-level setting.
Support for parameters varies based on the data set type. SQL Query data sets support the
full set of available parameter features. Other types of data sets might support all, none, or a
subset of these features. The table below summarizes the support for each data set type.
Data Set Type Parameter Multiple Can Select All Refresh Other
Support Selection Parameters on
Change
SQL Query Yes Yes Yes Yes
MDX Query No No No No
Oracle BI Analysis Inherited from Yes (using Oracle Yes (using Oracle Yes (using Oracle BI
Oracle BI BI Dashboards) BI Dashboards) Dashboards)
Analysis
4-1
Chapter 4
Adding a New Parameter
Data Set Type Parameter Multiple Can Select All Refresh Other
Support Selection Parameters on
Change
View Object Yes, provided No No Yes (view object
that the view parameters only)
object supports
and is designed
for it
Web Service Yes No No No
LDAP Query Yes No No No
XML File No No No No
Microsoft Excel File Yes No No No
CSV File No No No No
HTTP (XML Feed) Yes No No No
4-2
Chapter 4
Adding a New Parameter
4-3
Chapter 4
Adding a New Parameter
4-4
Chapter 4
Adding a New Parameter
1. Select Menu from the Parameter Type list. The lower pane displays the appropriate
fields.
2. In Data Type, select String or Integer.
3. Enter the Display Label. The display label is the label that displays to users when they
view the report. For example: Department.
4. Enter the Number of Values to Display in List. If the number of values in the list
exceeds the entry in this field, the user must click Search to find a value not displayed,
as shown in the figure below. This field defaults to 100.
5. Select the List of Values that you defined for this parameter.
6. Enable the following Options if required:
• Multiple Selection - Allows the user to select multiple entries from the list. Your data
source must be able to support multiple values for the parameter. The display of a
menu parameter that supports multiple selection differs. See the two figures below.
• Can select all - Inserts an All option in the list.
When the user selects All from the list of values, you have the option of passing a null
value for the parameter or all list values. Choose NULL Value Passed or All Values
Passed.
4-5
Chapter 4
Adding a New Parameter
Note:
Using * passes a null, so you must handle the null in your data
source. A method to handle the null would be the standard Oracle
NVL command, for example:
where customer_id = nvl(:cstid, customer_id)
where cstid is a value passed from the list of values, and when the
user selects All it passes a null value.
The figure below shows how the Department menu type parameter displays to the
report consumer when multiple selection is enabled.
4-6
Chapter 4
Adding a New Parameter
4-7
Chapter 4
About Lists of Values
4-8
Chapter 4
Adding Lists of Values
4-9
Chapter 4
Adding Lists of Values
The SQL query shown below selects only the DEPARTMENT_NAME column from the
DEPARTMENTS table. In this case the list of values both displays the results of the
query in the list and passes the same value to the parameter in the data set. The
figure below shows the list of values display entries and the values passed to the data
set. The menu items and the values shown for P_DEPT are the
DEPARTMENT_NAME values.
If instead you wanted to pass the DEPARTMENT_ID to the parameter in the data set,
and display the DEPARTMENT_NAME in the list, construct your SQL query as follows:
The figure below shows the list of values display entries and the values passed to the
data set. The menu lists the DEPARTMENT_NAME while the values shown for
P_DEPT are the DEPARTMENT_ID values.
4-10
Chapter 4
Adding Flexfield Parameters
4-11
Chapter 4
Adding Flexfield Parameters
The flexfield list of values displays as a dialog from which you select the segment
values, as shown below.
4-12
Chapter 4
Adding Flexfield Parameters
2. Enter a Name for the list and choose Flexfields as the Type.
3. In the Flex_Acct_List:Flexfields pane, enter the following:
• Application Short Name - E-Business Suite application short name, for example:
SQLGL.
• ID Flex Code - Flexfield code defined for this flexfield in the Register Key Flexfield
form, for example: GL#.
• ID Flex Number - Name of the source column or parameter that contains the flexfield
structure information, for example: 101 or :STRUCT_NUM. If you use a parameter,
ensure that you define the parameter in the data model.
The image shows a sample flexfield type, LOV.
4-13
Chapter 4
Adding Flexfield Parameters
Using the Flexfield Parameter to Pass Values to a Flexfield Defined in the Data
Model
After adding the Menu parameter to the flexfield list of values, you can pass the
parameter values to a flexfield component in the data model.
Adding Flexfields covers adding a flexfield component in detail. The simplified
procedure is provided here to complete the example.
To define the Flexfield in the data model:
1. On the Data Model components pane, click Flexfields and then click Create new
Flexfield.
2. Enter the following:
• Name — Enter a name for the flexfield component.
• Type — Select the flexfield type from the list. The type you select here
determines the additional fields required. See Entering Flexfield Details.
• Application Short Name — Enter the short name of the Oracle Application
that owns this flexfield (for example, GL).
• ID Flex Code — Enter the flexfield code defined for this flexfield in the
Register Key Flexfield form (for example, GL#).
4-14
Chapter 4
Adding Flexfield Parameters
• ID Flex Number — Enter the name of the source column or parameter that contains
the flexfield structure information. For example: 101. To use a parameter, prefix the
parameter name with a colon, for example, :PARAM_STRUCT_NUM.
3. In the lower region of the page, enter the details for the type of flexfield you selected. For
the field that is to take the parameter value, enter the parameter name prefixed with a
colon, for example, :P_Acct_List.
In the figure below the Flexfield component is defined as a "Where" Type. The
parameter :P_Acct_List is entered in the Operand1 field. At runtime, values selected by
the user for the parameter P_Acct_List will be used to create the where clause.
4-15
Chapter 4
Adding Flexfield Parameters
4-16
Chapter 4
Adding Flexfield Parameters
4. Create the Flexfield in the data model, as described in Using the Flexfield Parameter to
Pass Values to a Flexfield Defined in the Data Model.
In the lower region of the page, enter the details for the type of flexfield you selected.
Enter the parameter prefixed with a colon for example, :P_Acct_List.
In the figure below the Flexfield component is defined as a "Where" Type. The
parameters :P_FLEX_LOW and :P_FLEX_HIGH are entered in the Operand1 and
Operand2 fields. At runtime, values selected by the user for the parameters
P_FLEX_LOW and P_FLEX_HIGH will be used to create the where clause.
When the report associated with this data model is displayed in the report viewer, the report
consumer sees the two flexfield parameters as shown below.
When the report consumer clicks either the high or low flexfield indicator (...), a dialog
launches enabling input of both the high and low values as shown below.
4-17
Chapter 4
Adding Flexfield Parameters
The display characteristics in the report viewer of the range flexfield parameter
resemble closely the presentation of range flexfields in the E-Business Suite.
4-18
5
Adding Event Triggers
This topic describes how to define triggers in your data model. Data models support before
data and after data event triggers and schedule triggers.
Topics:
• About Triggers
• Adding Before Data and After Data Triggers
• Creating Schedule Triggers
About Triggers
An event trigger checks for an event and when the event occurs, it runs the code associated
with the trigger.
Oracle BI Publisher supports three types:
• Before Data - Fires right before the data set is executed.
• After Data - Fires right after the data engine executes all data sets and generates the
XML.
• Schedule Trigger - Fires when a scheduled job is triggered and before it runs.
Before data and after data triggers execute a PL/SQL function stored in a PL/SQL package in
your Oracle Database. The return data type for a PL/SQL function inside the package must
be a Boolean type and the function must explicitly return TRUE or FALSE.
A schedule trigger is associated with a scheduled job. It's a SQL query that executes at the
time a report job is scheduled to run. If the SQL returns any data, the report job runs. If the
SQL query returns no data, the job instance is skipped.
Event triggers accept only one value in a parameter. If you pass multiple values to a schedule
event trigger parameter, the status of the scheduled job is set to Skipped.
Event triggers aren't used to populate data used by a bursting definition. See Adding Bursting
Definitions.
5-1
Chapter 5
Creating Schedule Triggers
3. From the Event Triggers pane, click Create New Event Trigger.
4. Enter the following for the trigger:
• Name - Name the trigger something meaningful.
• Type - Select Before Data or After Data.
• Language - Select PL/SQL.
The figure below shows an event trigger.
5. Select the package from the Available Functions box and click the arrow to move
a function to the Event Trigger box.
The name appears as PL/SQL <package name>.<function name>.
Order of Execution
If you define multiple triggers of the same type, they fire in the order that they appear
in the table (from top to bottom).
To change the order of execution:
• Use the Reorder arrows to place the triggers in the correct order.
5-2
Chapter 5
Creating Schedule Triggers
The schedule trigger that you associate with a report job can reside in any data model in the
catalog. You don't need to create the schedule trigger in the data model of the report for
which you want to execute the trigger. You can reuse schedule triggers across multiple report
jobs.
1. In the data model editor task pane, click Event Triggers.
2. From the Event Triggers pane, click the Create New icon.
3. Enter the following for the trigger:
• Name - Enter a name for the trigger.
• Type - Select Schedule.
• Language - Accept the default value, SQL Query.
4. In the lower pane, enter the following:
• Options - Select this check box to cache the results of the trigger query.
• Data Source - Select the data source for the trigger query.
• SQL Query - Enter the query in the text area, or click Query Builder to use the utility
to construct the SQL query, see Using the SQL Query Builder.
You can include parameters in the trigger query. Define the parameter in the same
data model as the trigger. Enter parameter values when you schedule the report job.
The schedule trigger queries don't support multi-select parameters. If your query
expects a set of values, modify your query.
If the SQL query returns any results, the scheduled report job executes. The figure below
shows a schedule trigger to test for inventory levels based on a parameter value that can
be entered at runtime.
5-3
6
Adding Flexfields
This topic describes the support for flexfields in data models.
Topics:
• About Flexfields
• Adding Key Flexfields
• Adding Descriptive Flexfields
About Flexfields
A flexfield is a data field that your organization can customize to your business needs without
programming.
Oracle applications (Oracle E-Business Suite and Oracle Fusion Applications) use two types
of flexfields:
• key flexfields
A key flexfield is a field you can customize to enter multi-segment values such as part
numbers, account numbers, and so on.
• descriptive flexfields
A descriptive flexfield is a field you customize to enter additional information for which
your Oracle applications product hasn't provided a field.
If you are reporting on data from Oracle applications, use the Flexfield component of the data
model to retrieve flexfield data. When Oracle BI Publisher is integrated with Oracle Fusion
Applications, both key flexfields and descriptive flexfields are supported. When BI Publisher is
integrated with Oracle E-Business Suite, only key flexfields are supported.
Before including flexfields in your reports, you should understand flexfields in your
applications. See your Oracle E-Business Suite or Oracle Fusion Applications
documentation.
6-1
Chapter 6
Adding Key Flexfields
for example:
&FLEX_GL_BALANCING alias_gl_balancing
6-2
Chapter 6
Adding Key Flexfields
– Lexical Type - Select the type from the list. Your selection here determines the
additional fields required. See Entering Flexfield Details.
– Application Short Name - Enter the short name of the Oracle Application that owns
this flexfield, for example, GL.
– Flexfield Code - Enter the flexfield code defined for this flexfield. In Oracle E-
Business Suite this code is defined in the Register Key Flexfield form, for example,
GL#.
– ID Flex Number - Enter the name of the source column or parameter that contains
the flexfield structure information. For example: 101. To use a parameter, prefix the
parameter name with a colon, for example, :PARAM_STRUCT_NUM.
Field Description
Structure Instance Number Enter the name of the source column or parameter that contains the
flexfield structure information. For example: 101. To use a parameter,
prefix the parameter name with a colon, for
example, :PARAM_STRUCT_NUM.
6-3
Chapter 6
Adding Key Flexfields
Field Description
Segments (Optional) Identifies for which segments this data is requested. Default
value is "ALL". See Oracle E-Business Suite Developer's Guide for
syntax.
Show Parent Segments Select this box to automatically display the parent segments of
dependent segments even if it is specified as not displayed in the
segments attribute.
Metadata Type Select the type of metadata to return:
Above Prompt of Segments — Above prompt of segment(s).
Left Prompt of Segments — Left prompt of segment(s)
The table below shows the detail fields for the Select flexfield type.
Field Description
Enable Multiple Structure Indicates whether this lexical supports multiple structures.
Instances Checking this box indicates all structures are potentially used for
data reporting. The data engine uses
<code_combination_table_alias>.<set_defining_column_name> to
retrieve the structure number.
Code Combination Table Specify the table alias to prefix to the column names. Use
Alias TABLEALIAS if your SELECT joins to other flexfield tables or uses
a self-join.
Structure Instance Number Enter the name of the source column or parameter that contains
the flexfield structure information. For example: 101. To use a
parameter, prefix the parameter name with a colon, for
example, :PARAM_STRUCT_NUM.
Segments (Optional) Identifies for which segments this data is requested.
Default value is "ALL". See Oracle E-Business Suite Developer's
Guide for syntax.
6-4
Chapter 6
Adding Key Flexfields
Field Description
Show Parent Segments Select this box to automatically display the parent segments of
dependent segments even if it is specified as not displayed in the
segments attribute.
Output Type Select from the following:
• Value — Segment value as it is displayed to user.
• Padded Value — Padded segment value as it is displayed to
user. Number type values are padded from the left. String
type values are padded on the right.
• Description — Segment value's description up to the
description size defined in the segment definition.
• Full Description — Segment value's description (full size).
• Security — Returns Y if the current combination is secured
against the current user, N otherwise.
The table below shows the detail fields for the Where key flexfield type.
Field Description
Code Combination Specify the table alias to prefix to the column names. You use TABLEALIAS if
Table Alias your SELECT joins to other flexfield tables or uses a self-join.
Structure Instance Enter the name of the source column or parameter that contains the flexfield
Number structure information. For example: 101. To use a parameter, prefix the
parameter name with a colon, for example, :PARAM_STRUCT_NUM.
Segments (Optional) Identifies for which segments this data is requested. Default value is
"ALL". See Oracle E-Business Suite Developer's Guide for syntax.
Operator Select the appropriate operator.
Operand1 Enter the value to use on the right side of the conditional operator.
6-5
Chapter 6
Adding Key Flexfields
Field Description
Operand2 (Optional) High value for the BETWEEN operator.
The table below shows the detail fields for the Order by flexfield type.
Field Description
Enable Multiple Structure Indicates whether this lexical supports multiple structures.
Instances Selecting this box indicates all structures are potentially used for
data reporting. The data engine uses
<code_combination_table_alias>.<set_defining_column_name> to
retrieve the structure number.
Structure Instance Number Enter the name of the source column or parameter that contains
the flexfield structure information. For example: 101. To use a
parameter, prefix the parameter name with a colon, for
example, :PARAM_STRUCT_NUM.
Code Combination Table Specify the table alias to prefix to the column names. You use
Alias TABLEALIAS if your SELECT joins to other flexfield tables or uses
a self-join.
Segments (Optional) Identifies for which segments this data is requested.
Default value is "ALL". See Oracle E-Business Suite Developer's
Guide for syntax.
Show Parent Segments Select this box to automatically display the parent segments of
dependent segments even if it is specified as not displayed in the
segments attribute.
6-6
Chapter 6
Adding Descriptive Flexfields
The table below shows the detail fields for the Filter flexfield type.
Field Description
Code Combination Table Specify the table alias to prefix to the column names. You use
Alias TABLEALIAS if your SELECT joins to other flexfield tables or uses a
self-join.
Structure Instance Number Enter the name of the source column or parameter that contains the
flexfield structure information. For example: 101. To use a parameter,
prefix the parameter name with a colon, for
example, :PARAM_STRUCT_NUM.
6-7
Chapter 6
Adding Descriptive Flexfields
• Flexfield Usage Code - (Optional) Identifies for which segments this data is
requested. Default value is "ALL".
3. If your descriptive flexfield definition includes parameters, you can enter the
parameters in the Parameters region.
To enter parameters, click + to add each parameter. Enter a Label and a Value for
each parameter. The Label must match exactly the label in the descriptive flexfield
definition.
6-8
Chapter 6
Adding Descriptive Flexfields
When you click OK, the diagram of your data set shows the columns that are returned from
your descriptive flexfield as shown below.
The columns that are returned from the key flexfield have the following limitations:
• Element properties are disabled
• In the data model Structure tab, you cannot edit the following fields: XML Tag Name,
Value if Null, Display Name, Data Type
• Subgrouping of descriptive flexfield elements is not supported
• Element linking is not supported
6-9
7
Adding Bursting Definitions
This topic describes the support for bursting reports and how to define a bursting definition in
the data model to split and deliver your report to multiple recipients.
Topics:
• About Bursting
• What is the Bursting Definition?
• Adding a Bursting Definition to Your Data Model
• Defining the Query for the Delivery XML
• Passing a Parameter to the Bursting Query
• Defining the Split By and Deliver By Elements for a CLOB/XML Data Set
• Configuring a Report to Use a Bursting Definition
• Sample Bursting Query
• Creating a Table to Use as a Delivery Data Source
About Bursting
Bursting is a process of splitting data into blocks, generating documents for each block, and
delivering the documents to one or more destinations.
The data for the report is generated by executing a query once and then splitting the data
based on a Key value. For each block of the data, a separate document is generated and
delivered.
Using Oracle BI Publisher bursting enables splitting a single report based on an element in
the data model and deliver the report based on a second element in the data model. Driven
by the delivery element, you can apply a different template, output format, delivery method,
and locale to each split segment of the report. Example implementations include:
• Invoice generation and delivery based on customer-specific layouts and delivery
preference.
• Financial reporting to generate a master report of all cost centers, splitting out individual
cost center reports to the appropriate manager.
• Generation of pay slips to all employees based on one extract and delivered through e-
mail.
7-1
Chapter 7
Adding a Bursting Definition to Your Data Model
• The Split By element is an element from the data that governs how the data is
split. For example, to split a batch of invoices by each invoice, you may use an
element called CUSTOMER_ID. The data set must be sorted or grouped by this
element.
• The Deliver By element is the element from the data that governs how formatting
and delivery options are applied. In the invoice example, it is likely that each
invoice has delivery criteria determined by customer; therefore, the Deliver By
element would also be CUSTOMER_ID.
• The Delivery Query is a SQL query that you define for BI Publisher to construct
the delivery XML data file. The query must return the formatting and delivery
details.
7-2
Chapter 7
Adding a Bursting Definition to Your Data Model
4. In the lower region, enter the following for this bursting definition:
Split By - Select the element from the data set by which to split the data.
Deliver By - Select the element from the data set by which to format and deliver the data.
Note:
If the Split By and Deliver By elements reside in an XML document stored as
a CLOB in your database, you must enter the full XPATH in the Split By and
Delivery By fields. For more information, see Defining the Split By and Deliver
By Elements for a CLOB/XML Data Set.
7-3
Chapter 7
Defining the Query for the Delivery XML
consolidated file, then the report author can check the option Enable Consolidated
Output under bursting query. The consolidated output contains the sequential merge
of report and attachment of each burst. A user (with consumer role) who schedules the
bursting report job and the Administrator will be able to view the consolidated output in
the Job History Details page.
1. Click the Attachment tab.
2. Select the content server name from the Attachment Repository LOV.
3. Define the SQL query for the attachment in the Content Server.
The column alias names KEY and ATTACHMENT_ID are mandatory.
The SQL query uses the KEY and the ATTACHMENT_ID (which map to the
document id of the PDF in the content server) to create an association between
the PDF report and the PDF attachment.
4. Click Save icon after you make changes to the data model.
5. Click the View Data button.
6. Click View to view the data.
7. Save the data by clicking Save As Sample Data.
8. To create a report based on the data model that you created, click Create Report.
<ROWSET>
<ROW>
<KEY></KEY>
<TEMPLATE></TEMPLATE>
<LOCALE></LOCALE>
<OUTPUT_FORMAT></OUTPUT_FORMAT>
<DEL_CHANNEL></DEL_CHANNEL>
<TIMEZONE></TIMEZONE>
<CALENDAR></CALENDAR>
<OUTPUT_NAME></OUTPUT_NAME>
<SAVE_OUTPUT></SAVE_OUTPUT>
<PARAMETER1></PARAMETER1>
<PARAMETER2></PARAMETER2>
<PARAMETER3></PARAMETER3>
<PARAMETER4></PARAMETER4>
<PARAMETER5></PARAMETER5>
<PARAMETER6></PARAMETER6>
<PARAMETER7></PARAMETER7>
<PARAMETER8></PARAMETER8>
<PARAMETER9></PARAMETER9>
<PARAMETER10></PARAMETER10>
7-4
Chapter 7
Defining the Query for the Delivery XML
</ROW>
</ROWSET>
• KEY — The Delivery key and must match the Deliver By element. The bursting engine
uses the key to link delivery criteria to a specific section of the burst data. Ensure that you
use double quotes around "KEY" in the select statement, for example:
select d.department_name as "KEY",
• TEMPLATE — The name of the Layout to apply. Note that the value is the Layout name
(for example, 'Customer Invoice'), not the template file name (for example, invoice.rtf).
• LOCALE — The template locale, for example, 'en-US'.
• OUTPUT_FORMAT — The output format. The table below shows the valid values to
enter for the bursting query.
Output Format Value to Enter in Template Types That Can Generate This Output
Bursting Query Format
Interactive N/A Not supported for bursting
HTML html – BI Publisher
– RTF
– XSL Stylesheet (FO)
PDF pdf – BI Publisher
– RTF
– PDF
– XSL Stylesheet (FO)
– Flash
RTF rtf – BI Publisher
– RTF
– XSL Stylesheet (FO)
Excel (mhtml) excel – BI Publisher
– RTF
– Excel
– XSL Stylesheet (FO)
Excel (html) excel2000 – BI Publisher
– RTF
– XSL Stylesheet (FO)
Excel (*.xlsx) xlsx – BI Publisher
– RTF
– XSL Stylesheet (FO)
PowerPoint (mhtml) ppt – BI Publisher
– RTF
– XSL Stylesheet (FO)
PowerPoint (.*pptx) pptx – BI Publisher
– RTF
– XSL Stylesheet (FO)
MHTML mhtml – BI Publisher
– RTF
– XSL Stylesheet (FO)
– Flash
7-5
Chapter 7
Defining the Query for the Delivery XML
Output Format Value to Enter in Template Types That Can Generate This Output
Bursting Query Format
PDF/A pdfa – BI Publisher
– RTF
– XSL Stylesheet (FO)
PDF/X pdfx – BI Publisher
– RTF
– XSL Stylesheet (FO)
Zipped PDFs pdfz – BI Publisher
– RTF
– PDF
– XSL Stylesheet (FO)
FO Formatted XML xslfo – BI Publisher
– RTF
– XSL Stylesheet (FO)
Data (XML) xml – BI Publisher
– RTF
– PDF
– Excel
– XSL Stylesheet (FO)
– XSL Stylesheet (HTML XML/Text)
– Etext
– Flash
Data (CSV) csv – BI Publisher
– RTF
– PDF
– Excel
– XSL Stylesheet (FO)
– XSL Stylesheet (HTML XML/Text)
– Etext
– Flash
XML txml XSL Stylesheet (HTML XML/Text)
Text text – XSL Stylesheet (HTML XML/Text)
– Etext
Flash flash Flash
7-6
Chapter 7
Defining the Query for the Delivery XML
– WEBDAV
– WCC
– ODCS
• TIMEZONE — The time zone to use for the report. Values must be in the Java format, for
example: 'America/Los_Angeles'. If time zone is not provided, then the system default
time zone is used to generate the report.
• CALENDAR — The calendar to use for the report. Valid values are:
– GREGORIAN
– ARABIC_HIJRAH
– ENGLISH_HIJRAH
– JAPANESE_IMPERIAL
– THAI_BUDDHA
– ROC_OFFICIAL (Taiwan)
If not provided, the value 'GREGORIAN' is used.
• OUTPUT_NAME — The name to assign to the output file in the report job history.
• Delivery parameters by channel — The values required for the parameters depend on
the delivery method chosen. The parameter values mappings for each method are shown
in the table below. Not all delivery channels use all the parameters.
7-7
Chapter 7
Defining the Query for the Delivery XML
7-8
Chapter 7
Passing a Parameter to the Bursting Query
7-9
Chapter 7
Passing a Parameter to the Bursting Query
In the bursting query, pass the parameter value to the TEMPLATE field using :P1 as
shown in the following figure:
7-10
Chapter 7
Defining the Split By and Deliver By Elements for a CLOB/XML Data Set
For this example, you want to add a bursting definition with split by and deliver by element
based on the DEPARTMENT_ID, which is an element within the CLOB/XML data set.
When you add the bursting definition, the Split By and Deliver By lists cannot parse the
structure beneath the XMLTEXT element. Therefore, the list does not display the elements
available beneath the XMLTEXT node, as shown in the figure below.
7-11
Chapter 7
Configuring a Report to Use a Bursting Definition
To use the DEPARTMENT_ID element as the Split By element, manually type the
XPath into the field as shown in the figure below.
7-12
Chapter 7
Creating a Table to Use as a Delivery Data Source
The SQL code to generate the delivery data set for this example is as follows:
select distinct
CUSTOMER_ID as "KEY",
CST_TEMPLATE TEMPLATE,
CST_LOCALE LOCALE,
CST_FORMAT OUTPUT_FORMAT,
CUSTOMER_ID OUTPUT_NAME,
'EMAIL' DEL_CHANNEL,
CST_EMAIL_ADDRESS PARAMETER1,
'accounts.receivable@example.com' PARAMETER2,
'bip-collections@example.com' PARAMETER3,
'Your Invoices' PARAMETER4,
'Hi'||CUST_FIRST_NAME||':'|| 'Please find attached your
invoices.' PARAMETER5,
'true' PARAMETER6,
'donotreply@mycompany.com' PARAMETER7
from CUSTOMERS
Note:
If the JDBC driver that you use does not support column alias, when you define the
bursting control table, the columns must match exactly the control XML tag name.
For example, the KEY column must be named KEY, upper case is required.
PARAMETER1 must be named PARAMETER1, not parameter1 nor param1, or any
other non-matching name.
7-13
Chapter 7
Creating a Table to Use as a Delivery Data Source
7-14
8
Adding Custom Metadata for Oracle
WebCenter Content Server
This topic describes how to use the data model editor to map fields from your data source to
the custom metadata fields. When delivering reports to an Oracle WebCenter Content Server,
BI Publisher can populate the custom metadata fields defined in your document profiles.
Topics:
• About Custom Metadata Mapping
• Mapping Data Fields to Custom Metadata Fields
• Deleting Unused Metadata Fields
Prerequisites
Certain requirements must be met to use this feature of the data model editor.
Prerequisites:
• The content server must be configured as a delivery destination with custom metadata
enabled.
• To map the custom metadata fields to data fields from your data model data set, the data
set must be of a type that the data model editor can retrieve the data structure, for
example, SQL data sets and Excel data sets are supported; however, Web service data
sets are not.
8-1
Chapter 8
Mapping Data Fields to Custom Metadata Fields
8-2
Chapter 8
Mapping Data Fields to Custom Metadata Fields
4. For each metadata field, map a data field from your data sets by selecting it from the
Data Mapping list. The Data Mapping list displays all the data fields from your data sets.
If a metadata field is required a Y is displayed in the Required column.
8-3
Chapter 8
Deleting Unused Metadata Fields
5. When you are done with mapping the metadata fields, click Save.
1. Select the metadata field, either by clicking the field name on the left pane or by
clicking the selection column in the table.
2. Click the Delete button.
8-4
9
Performance Best Practices
This topic provides tips for creating efficient data models for better performance.
Topics:
• Know Oracle WebLogic Server Default Time Out Setting
• Best Practices for SQL Data Sets
• Limit Lists of Values
• Working with Lexicals/Flexfields
• Working with Date Parameters
• Run Report Online/Offline (Schedule)
• Setting Data Model Properties to Prevent Memory Errors
• SQL Query Tuning
9-1
Chapter 9
Best Practices for SQL Data Sets
It is a better practice to remove unneeded records through your query using WHERE
clause conditions instead.
9-2
Chapter 9
Best Practices for SQL Data Sets
Consider:
In the first example, DUAL is not required. You can access SYSDATE directly.
<dataStructure>
<group name="G_order_short_text" dataType="xsd:string"
source="Q_ORDER_ATTACH">
<element name="order_attach_desc" dataType="xsd:string"
value="ORDER_ATTACH_DESC"/>
<element name="order_attach_pk" dataType="xsd:string"
value="ORDER_ATTACH_PK"/>
9-3
Chapter 9
Best Practices for SQL Data Sets
Query Q1:
SELECT DEPARTMENT_ID EDID,EMPLOYEE_ID EID,FIRST_NAME FNAME,LAST_NAME
LNAME,SALARY SAL,COMMISSION_PCT COMMFROM EMPLOYEES
Query Q2:
SELECT DEPARTMENT_ID DID,DEPARTMENT_NAME DNAME,LOCATION_ID LOCFROM
DEPARTMENTS
9-4
Chapter 9
Best Practices for SQL Data Sets
Combine the these queries into one using WITH clause as follows:
SELECT
NATIONAL_IDENTIFIERS,NATIONAL_IDENTIFIER,
PERSON_NUMBER,
PERSON_ID,
STATE_CODE
FROM
(select pprd.person_id,(select REPLACE(national_identifier_number,'-') from
per_
national_identifiers pni where pni.person_id = pprd.person_id and rownum<2)
national_identifiers,(select national_identifier_number from per_national
identifiers pni where pni.person_id = pprd.person_id and rownum<2) national_
identifier,(select person_number from per_all_people_f ppf
where ppf.person_id = pprd.person_id
and :p_effective_start_date between ppf.effective_start_date and
ppf.effective_
end_date) PERSON_NUMBER
(Select hg.geography_code from hz_geographies hg
where hg.GEOGRAPHY_NAME = paddr.region_2
and hg.geography_type = 'STATE') state_code
9-5
Chapter 9
Best Practices for SQL Data Sets
The preceding query syntax is correct only when the value of P_DEPT_ID is a single
value or null. This syntax does not work when you pass more than a single value.
To support multiple values, use the following syntax:
For Oracle Database:
For Oracle BI EE the parameter data type must be string. Number and date data types
are not supported.
9-6
Chapter 9
Best Practices for SQL Data Sets
Once you define the query, you can use the data model designer to select data elements and
create group breaks as shown below.
9-7
Chapter 9
Limit Lists of Values
9-8
Chapter 9
Working with Lexicals/Flexfields
When you create the data set query for the select columns, specify column alias,
SELECT gcc.CODE_COMBINATION_ID,
GCC.ATTRIBUTE_CATEGORY,
gcc.segment1 seg1,
gcc.segment2 seg2,
gcc.segment3 seg3,
gcc.segment4 seg4,
gcc.segment5 seg5,
&KFF_SELECT account
FROM GL_CODE_COMBINATIONS GCC
WHERE gcc.CHART_OF_ACCOUNTS_ID = 101
AND &KFF_WHERE
When you save the query, a pop-up dialog prompts you for the default values. To get SQL
metadata at design time you must specify the default values that can form a valid SQL query.
For example,
• if the lexical usage is a SELECT clause then you could enter null
• if the lexical usage is a WHERE clause then you could enter 1 = 1 or 1 =2
• if the lexical usage is ORDER BY clause then you could enter 1
9-9
Chapter 9
Working with Date Parameters
9-10
Chapter 9
Setting Data Model Properties to Prevent Memory Errors
9-11
Chapter 9
Setting Data Model Properties to Prevent Memory Errors
Queries that cannot execute under 600 seconds are not well-optimized. Your DBA or a
performance expert should analyze the query for further tuning.
Increasing the time out value risks Stuck WebLogic Server threads. Do not raise the
value unless all other optimizations and alternatives have been utilized.
DB Fetch Size
The Database Fetch Size property specifies the number of rows that are fetched from
the database at a time.
This setting can be overridden at the data model level by setting the Database Fetch
Size in the general properties of the data model.
Setting the value higher reduces the number of round trips to the database but
consumes more memory. Consider the number of elements in the data model before
changing this property.
BI Publisher recommends setting the property Auto DB fetch size to true so that the
system calculates the fetch size at run time.
Scalable Mode
When the Scalable mode property is on, BI Publisher uses the temp file system to
generate data. The data processor uses the least amount of memory.
This scalable mode property can be set at the data model level and the instance level.
The data model setting overrides the instance value.
You can set the instance value by expanding the nodes for Administrator, Runtime
Properties , and then Data Model:
The instance value can be overridden by Data model setting shown here:
9-12
Chapter 9
Setting Data Model Properties to Prevent Memory Errors
The following table details the expected results for the possible on/off settings at each level:
Scalable Mode Instance Value Scalable Mode Data Model Expected Result
Value
On Instance On
Off Instance Off
On On On
On Off Off
Off On On
Off Off Off
SQL Pruning
SQL pruning enhances performance by fetching only the columns that are used in the report
layout/template.
Columns that are defined in the query but are not used in the report are not fetched. This
improves query fetch size and reduces JDBC rowset memory.
Note that this feature does not alter the where clause but instead wraps the entire SQL with
the columns specified in the layout.
To enable SQL pruning – On the Data Model Properties page, select On for the Enable SQL
Pruning property.
9-13
Chapter 9
SQL Query Tuning
Click Generate Explain Plan on the Edit SQL Query dialog. Open the generated
document in a text editor like Notepad or WordPad.
9-14
Chapter 9
SQL Query Tuning
• Enable SQL Explain Plan — Generates a diagnostic log with Explain plan/SQL
monitor report information.
• Enable Data Engine Diagnostic — Generates a data processor log.
• Enable Report Processor Diagnostic — Generates FO (Formatting Options) and
server related log information.
• Enable Consolidated Job Diagnostic — Generates the entire log, which includes
scheduler log, data processor log, FO and server log details.
4. Submit the report.
5. From the Home page, under Browse/Manage, select Report Job History.
6. Select the report to view the details. Under Output & Delivery click Diagnostic Log to
download the explain plan output.
9-15
Chapter 9
SQL Query Tuning
9-16
Chapter 9
SQL Query Tuning
• Avoid and remove FTS (full table scans) on large tables. Note that in some cases, full
table scans on small tables are faster and improve query fetch. Ensure that you use
caching for small tables.
• Use SQL hints to force use of proper indexes.
• Avoid complex sub-queries and use Global Temporary Tables where necessary.
• Use Oracle SQL Analytical functions for multiple aggregation.
• Avoid too many sub-queries in where clauses if possible. Instead rewrite queries with
outer joins.
• Avoid group functions like HAVING and IN / NOT IN where clause conditions.
• Use CASE statements and DECODE functions for complex aggregate functions.
9-17