Upload
dothuan
View
218
Download
1
Embed Size (px)
Citation preview
Preface
This preface introduces you to the SAP BusinessObjects Roambi Cloud JDBC Connector.
The preface provides you with a list of chapters with an overview of the information each
chapter contains. Additionally, this preface includes a list of other pertinent Roambi Analytics
documentation.
About this Guide
This guide provides the following content:
Requirements for using the SAP BusinessObjects Roambi Cloud JDBC Connector with Roambi Analytics
An overview and detailed instructions on creating the RXJDBC file used by the SAP
BusinessObjects Roambi Cloud JDBC Connector
Best practices for creating your reports
Samples for each Roambi View plus images showing how these samples map to
their corresponding Views
Intended Audience
This guide is intended for technology professionals who will be responsible for creating reports
via SQL queries, importing those reports to Roambi, and publishing those reports as RBI files
to end users who will view them on mobile devices. In order to get the most out of this
document, readers will require a strong understanding of SQL and Roambi Views.
Using this Guide
This document is divided into the following chapters:
l Chapter 1: Getting Started
l Chapter 2: RXJDBC file basics
l Chapter 3: Data Sources
l Chapter 4: Reports
l Chapter 5: Parameters
l Chapter 6: Sample reports
l Chapter 7: Security
Table of Contents
Preface ii About this Guide ii Intended Audience ii Using this Guide ii For Further Reading ii
Chapter 1: Getting Started 1 System requirements 1
Supported databases 2 JDBC connector files 2
Known limitations 3 Creating a Roambi Analytics report 3
Chapter 2: RXJDBC file basics 5 Creating an RXJDBC file 5 RXJDBC XML file format template 6 RXJDBC DTD reference 7 RXJDBC file example 9
Chapter 3: Data Sources 12 Connecting to an MS SQL Server database 12 Connecting to an Oracle database 13 Example RXJDBC file for Oracle 14 Connecting to a Teradata database 17 Example RXJDBC file for Teradata 17 Connecting to an IBM DB2 database 20 Connecting to an Amazon RedShift database 20 Connecting to an SAP HANA database 21
Chapter 4: Reports 23 RXJDBC file guidelines for building reports 23
Data types 24 Formatting numeric data types 24 Formatting date data types 24 Formatting column names 25 Formatting values 26
Defining a <rowGroup> 26 Defining a <columnGroup> 26
Example: Grouping multiple columns under a column group 26 Example: Groups with a single measure 27
Defining values 29 Guidelines for hierarchical reports 30 Creating a report with adjacent groups 31 Defining multiple data sources in an RXJDBC file 31 Crosstab template 33
Chapter 5: Parameters 35 Defining parameters 35
Returning predefined parameter values 35
Data Refresh Automation and Bursting using RoambiScript 37
Chapter 6: Sample reports 43 Cardex Example 43 CataList Example 46 Layers Example 52 PieView Example 56 Pulse Example 60 Squares Example 63 SuperList Example 66 Trends Example 68
Data Refresh Automation and Bursting using RoambiScript 73
Chapter 1: Getting Started The SAP BusinessObjects Roambi Cloud JDBC Connector enables you to execute SQL queries
directly against a supported database to obtain the data used in Roambi Analytics reports. Once the
queries are executed, the connector creates an xlsx file with the content and format defined in the
rxjdbc file. Other advantages to using the SAP BusinessObjects Roambi Cloud JDBC Connector include the following benefits:
Any user who knows SQL can write queries that provide the source data for
Roambi visualizations.
The connector also allows you to pass parameters to a query so that users can filter
data by making different selections.
Syntax to execute the rxjdbc connector:
java -jar roambi-crosstab-export.jar -p ParameterName=ParameterValue -p .... -o
out-putFilename.xlsx rxjdbcSourceFilename.rxjdbc
This guide includes the following sections:
l Creating an RXJDBC file: The basic structure and required components of the RXJDBC
file used to connect to your database and return data via an SQL query. l Data Sources: How to configure a connection to your database, including XML examples.
l Reports: How to structure the SQL query so that your data can successfully be
imported to Roambi Analytics. l Parameters: Defining and using parameters in your reports.
l Sample reports: Example RXJDBC files for each Roambi View with screen captures
demonstrating how the final sample report appears in Roambi Analytics.
l Security: Security options for using the SAP BusinessObjects Roambi Cloud JDBC Connector.
System requirements
The SAP BusinessObjects Roambi Cloud JDBC Connector has the following requirements:
- 1 -Chapter 1: Getting Started
JAVA JRE Installed in the machine where the connector will be executed. JDBC driver for your database
The roambi-crosstab-export.jar file
Supported databases
You can use the SAP BusinessObjects Roambi Cloud JDBC Connector with the following supported databases:
Microsoft SQL Server (2012, 2008, 2008 R2, or 2005)
Teradata 13.1
Oracle 11g R2
MySQL 5.5
Cloudera HIVE 4.7
Netezza
IBM DB2 10.1
PostgreSQL 9.2
ParAccel
Amazon RedShift
SAP HANA
JDBC connector files Use the following table to determine which JDBC connector file you will need to connect your
database. You can download these .jar files from your database's company web site. Once the jar files are located, you need to place them in the Ext (Extensions) folder of the Java
Run Time deployment. When JAVA is installed it normally creates two environment variables to
define the installation: JAVA_HOME and JRE_HOME.
You need to copy the JDBC jar files in the folder $JRE_HOME/lib/Ext Folder.
- 2 -
Known limitations
Database
MS SQL Server 2012
MS SQL Server 2008 R2
MS SQL Server 2008
MS SQL Server 2005
Teradata 13.1
Oracle 11g R2
MySQL 5.5
Cloudera HIVE 4.7
Netezza IBM DB2 10.1
PostgreSQL 9.2
ParAccel
Amazon RedShift
SAP HANA
Required JDBC File(s)
sqlsdbc4-4.0.jar
tdgssconfig.jar, terajdbc4.jar Search for "Oracle Database 11g Release 2 JDBC
Drivers " on the Oracle web site, and download the
appropriate files. Download the JDBC driver from the Connector page
on the MySQL web site.
Download the Hive JDBC Connector v 2.5.6
Jar files to use
hive_metastore.jar
hive_service.jar
HiveJDBC4.jar
libfb303-0.9.0.jar
libthrift-0.9.0.jar
ql.jar
TCLIServiceClient.jar
Supplied by Netezza to Netezza users. Download the JDBC driver from the IBM web site.
Download the current JDBC driver from the
PostgreSQL web site.
Copy the ngdbc.jar file from the Hana client tool.
Known limitations
The SAP BusinessObjects Roambi Cloud JDBC Connector has the following limitations:
Stored procedures are not supported.
Creating a Roambi Analytics report
This topic provides a high-level overview of the process of creating and publishing a
Roambi Analytics report, using data that has been directly retrieved from a supported
database. via the SAP BusinessObjects Roambi Cloud JDBC Connector
- 3 -
Chapter 1: Getting Started
To create a Roambi Analytics report:
1. Plan your report. Consider the following questions when planning your report:
Which Roambi View(s) do you ultimately plan to use to visualize your data?
How do you want your data grouped in the published report?
Should your report be filtered by any parameters that you need to provide in the
rxjdbc file definition?
2. Create your RXJDBC file. See RXJDBC file basics to gain a basic understanding about the
requirements and different sections of the RXJDBC file.When you are ready for more detailed
information about creating each section of this file, see the following individual topics:
l Data Sources l Reports
l Parameters
l Security
3. Execute the JDBC connector by using the following syntax in the command line:
java -jar roambi-crosstab-export.jar -p parameterName=parameterValue -
p parameterName2=parameterValue2 ..-o outptFilename.xlsx rxjdbc_
file.rxjdbc
After the command is run, the file defined in the -o argument will be
created. Use this file as the source file for Roambi Analytics view.
You can create the Roambi Analytics by importing the resulting
file directly from your Local machine, or upload the file to the
Roambi Library in your organization.
- 4 -
Chapter 2: RXJDBC file basics
The SAP BusinessObjects Roambi Cloud JDBC Connector uses an XML file, called an
RXJDBC file, to connect to your database and creates an xlsx file that you can use to create
your Roambi Analytics report. This XML file must have an ".rxjdbc" extension to be recognized
by the connector. This section provides you with an introduction to building an RXJDBC file, including a
simple example of this file. After understanding the basics of how RXJDBC files work with
the SAP BusinessObjects Roambi Cloud JDBC Connector, the next sections in this guide
will teach you the details for building each part of the file. This section includes the following topics:
l Creating an RXJDBC file
l RXJDBC XML file format template
l RXJDBC DTD reference
l RXJDBC file example
Creating an RXJDBC file
This topic gives a high-level overview of the process for creating an RXJDBC file, which will
provide the data for your Roambi Analytics report.
Note that to create the RXJDBC file, you must use a text editor that allows you to save the file
in UTF-encoding. UTF-8 encoding allows you to use special characters in your SQL
statements and supports any characters available in non-English languages for localization.
To create an RXJDBC file:
1. Define one or more connections to a database in the <dataSources> element. Data
Sources contains detailed instructions and examples for supported databases. (If you
want to include any extra security options, you will need to define these along with
your data source. See Security.) 2. Determine how you want your report structured, which Roambi View you want to
publish, and which data you want that report to include. See Reports for options and
instructions on building your reports. 3. Determine whether or not your published Roambi Analytics report will be filtered by
parameters in the source rxjdbc file. If so, read Parameters to learn about adding
parameters to a report.
- 5 -
Chapter 2: RXJDBC file basics
4. Upload the resulting xlsx file to the SAP BusinessObjects Roambi Cloud Library
and publish your Roambi Analytics report. See Creating a Roambi Analytics
report.
RXJDBC XML file format template
Use the following XML template to help build your RXJDBC file:
<rxjdbc> <dataSources>
<dataSource id="DS_1" type="JDBC">
<forName>com.microsoft.sqlserver.jdbc.SQLServerDriver</forName
> <connectionString> connection_string </connectionString>
<user>UserName </user>
<password>password
</password> </dataSource>
</dataSources> <parameters>
<parameter id="p1" name="Name" dataType="NUMBER" displayFormat=”0”
> <values>
<query dataSource="DS_1">
<![CDATA[ sql_statements
]]>
</query> </values>
</parameter> </parameters> <reports>
<report name="Sample with Parameters"
type="CROSSTAB"> <rowGroup>
<column name="Region" label="Region"
dataType="STRING"/> </rowGroup>
<columnGroups> <columnGroup>
<query dataSource="DS_1">
<![CDATA[ sql_statements
]]>
</query> <groups>
<column name="FieldName" label="Label"
dataType="STRING"/> </groups>
<values> <column name="FieldName" dataType="NUMBER"
label="Label" displayFormat="#,##0_,_."/>
</values> </columnGroup>
</columnGroups> </report>
</reports> </rxjdbc>
- 6 -
RXJDBC DTD
reference
RXJDBC DTD reference
The following table contains descriptions for all of the valid elements in an RXJDBC file,
including parent elements and any valid attributes. Use this table as a quick DTD syntax
reference when building your RXJDBC files:
- 7 -
Chapter 2: RXJDBC file basics
Element Description Parent Attributes
rxjdbc
dataSources
dataSource
forName
connectionString
user
password
parameters
parameter
values
query
reports
report
rowGroup
column
columnGroups
Defines the file as an RXJDBC file. Container element for
individual data sources.
Defines an individual
data source. Names the JDBC driver Connection string used to
connect to the database.
Username for connecting
to the database. Password associated with
the username. Container element for
individual parameters.
Optional.
Defines an individual
source report parameter.
Container for SQL query. CDATA block containing the
SQL query that returns the
value for the parameter. Container element for
individual reports.
Defines an individual
source report.
Defines the hierarchy of
the report.
Defines a column in
the report.
Container element for
individual column groups.
None
rxjdbc
dataSources
dataSource
dataSource
dataSource
dataSource
rxjdbc
parameters
parameter
values
rxjdbc
reports
report
rowGroup
report
None
None
id: Unique ID
type: JDBC None
None
None
None
None
id: Unique ID name: parameter name
dataType: Expected
data type
displayFormat:
Format for the data type. None
dataSource: ID for
the data source
None
name: Report name
type: Report type
(usually CROSSTAB)
None
name: column name
label: Label that will
appear for the column in the RBI file
dataType: Expected
data type
None
- 8 -
RXJDBC file example
columnGroup
Container for the report data,
columnGroups
including the SQL query for a None
specific group.
query
CDATA block containing the columnGroup
SQL query that returns the None
data values for the report.
groups
Container for individual columnGroup
columns within the column None.
group.
name: column name
label: Label that will
column
Defines a column in the
groups
appear for the column in
report. the RBI file
dataType: Expected
data type
values Container for column values. columnGroup None
name: column name
dataType: Expected
data type
column
Defines a column in the
values
label: Label that will
report. appear for the column in
the RBI file
displayFormat:
Format for the data type.
RXJDBC file example
Consider a report with the following characteristics:
Crosstab format
Two hierarchies
Columns grouped by Region
Each Region has three measures: Quantity, Revenue, and Profit The following color-coded sample spreadsheet shows this sample crosstab report:
- 9 -
Chapter 2: RXJDBC file basics
This report maps to a RXJDBC file as shown in the following example. The example is color-
coded to show the different regions of the report:
Gray: Data source (Not visible in crosstab source report)
Blue: Row group
Green: Column group
- 10 -
RXJDBC file example
- 11 -
Chapter 3: Data Sources
Every RXJDBC file that you build must have a Data Sources section with at least one data source
defined as a <dataSource> element. The attributes of the <dataSource> element define the
actual connection to your database. You can define multiple <dataSource> elements in this
section. Additionally, this element can define optional security choices for your connection. This
section describes how to define a data source for Roambi-supported databases:
l Connecting to an MS SQL Server database
l Connecting to an Oracle database
l Connecting to a Teradata database
l Connecting to an IBM DB2 database
l Connecting to an Amazon RedShift database
l Connecting to an SAP HANA database
Before you can connect to your database using the Roambi server, make sure that you have
installed the correct JDBC driver for your database. See JDBC connector files for instructions.
Connecting to an MS SQL Server database
Use the following format for the value of connectionString if you are connecting to an
MS SQL Server database:
jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value
[;property=value]]
Use the following table to help build your connection string:
- 12 -
Chapter 3: Data Sources
Parameter Description Required/Optional? Example
jdbc:sqlserver://
serverName
instanceName
portNumber
Property
Constant that defines the
sub-protocol. Must be
"jdbc:sqlserver://" Address of the server. Can be a
DNS, IP address, "localhost", or
"127.0.0.1" for the local
computer. If you do not specify a
server name, you must specify
the server as a Property. Instance to connect to on the
server. If not specified, the SAP
BusinessObjects Roambi Cloud
JDBC Connectorconnects to
the default instance. Port to connect to on the
server. If you are connecting to
the default port, you do not
need to specify a value or the
preceeding ":" for portNumber.
Default is 1433. One or more properties related
to your database connection.
You can specify one or more
valid properties from the
Connection Properties table on
the MSDN web site:
http://msdn.microsoft.com/en-
us/library/ms378988.aspx Separate multiple properties
with a semi-colon (;).
Required
Optional
Optional
Optional
Optional
jdbc:sqlserver://
msdb2008.sandbox.lan
\qa-test
:8080
databaseName
See MS SQL Server security for variations and examples of connection strings for MS SQL Server.
Connecting to an Oracle database
Use the following format for the value of connectionString if you are connecting to an
Oracle database: jdbc:oracle:thin:@[serverName]:[port]/[serviceName]
Use the following table to help build your connection string:
- 13 -
Example RXJDBC file for Oracle
Parameter Description Required/Optional? Example
jdbc:oracle:thin:
serverName
port
Constant that defines the sub-
protocol. Must be "jdbc:oracle:thin:"
Address of the server. Can be a DNS,
IP address, "localhost", or "127.0.0.1"
for the local computer. If you do not
specify a server name, you must
specify the server as a Property. Port to connect to on the server. If
you are connecting to the default port,
you do not need to specify a value or
the preceeding ":" for portNumber.
Required
Required
Required
jdbc:oracle:thin:
127.0.0.1
:8080
serviceName Name of the service you are
Required MyService
connecting to.
Note that in Oracle Database 11g, connection strings using SIDs are deprecated, but
are still supported for backward compatibility: jdbc:oracle:thin:@[serverName]:[port]:[sid]
See the Oracle web site for additional options and documentation.
The following example defines a connection to an Oracle database:
<dataSources>
<dataSources> <dataSource id="ds1" type="JDBC"> <forName>oracle.jdbc.OracleDriver</forName> <connectionString>
jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest </connectionString> <user>username</user> <password>password</password>
</dataSource>
Example RXJDBC file for Oracle
The following sample RXJDBC file could be used to connect to an Oracle database. This
example produces a crosstab report with three levels of hierarchy and two column groups:
Product Line and Year: <rxjdbc>
<dataSources>
<dataSource id="ds1" type="JDBC">
<forName>oracle.jdbc.OracleDriver</forName
> <connectionString>
jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest </connectionString>
- 14 -
Chapter 3: Data Sources
<user>username</user>
<password>password</password> </dataSource>
</dataSources> <reports>
<report name="Demo"
type="CROSSTAB"> <rowGroup>
<column name="Region" dataType="STRING"/>
<column name="Country" dataType="STRING"/>
<column name="City" dataType="STRING"/>
</rowGroup> <columnGroups>
<columnGroup> <query dataSource="ds1">
<![CDATA[
SELECT "PRODUCT LINE",REGION,"RETAILER COUNTRY" as COUNTRY,CITY, SUM ("QUANTITY") AS QTY, SUM ("REVENUE") AS REVENUE, SUM ("GROSS PROFIT") AS PROFIT FROM SuHEMA."SalesData" GROUP BY "PRODUCT LINE",REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT "PRODUCT LINE", REGION,"RETAILER COUNTRY" as COUNTRY, NULL
as CITY, SUM ("QUANTITY") AS QTY, SUM
("REVENUE") AS REVENUE,
SUM ("GROSS PROFIT") AS PROFIT FROM SCHEMA."SalesData" GROUP BY "PRODUCT LINE",REGION,"RETAILER COUNTRY" UNION ALL SELECT "PRODUCT LINE",REGION,NULL as COUNTRY, NULL as CITY, SUM (QUANTITY) AS QTY, SUM (REVENUE) AS REVENUE, SUM ("GROSS PROFIT") AS PROFIT FROM SCHEMA."SalesData" GROUP BY "PRODUCT LINE","REGION" UNION ALL SELECT "PRODUCT LINE",NULL as REGION, NULL as COUNTRY, NULL as
CITY, SUM ("QUANTITY") AS QTY, SUM
("REVENUE") AS REVENUE,
SUM ("GROSS PROFIT") AS PROFIT FROM SCHEMA."SalesData" GROUP BY "PRODUCT
LINE"; ]]>
</query> <groups>
<column name=""PRODUCT LINE"" label="Product Line"
data-Type="STRING"/>
- 15 -
Example RXJDBC file for Oracle
</groups>
<values> <column name="QTY" label="Quantity" dataType="NUMBER"
dis-playFormat="#,##0_,_."/>
<column name="PROFIT" label="Profit" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup> <columnGroup>
<query dataSource="ds1">
<![CDATA[
SELECT YEAR,REGION,"RETAILER COUNTRY" as COUNTRY,CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SCHEMA."SalesData" GROUP BY YEAR,REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT YEAR,REGION,"RETAILER COUNTRY" as COUNTRY, NULL as CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SCHEMA."SalesData" GROUP BY YEAR,REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT YEAR,REGION,NULL as COUNTRY, NULL as CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SCHEMA."SalesData" GROUP BY YEAR,REGION UNION ALL SELECT YEAR, NULL as REGION , NULL as COUNTRY, NULL as CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SCHEMA."SalesData" GROUP BY
YEAR; ]]>
</query> <groups>
<column name="YEAR" label="Year" dataType="NUMBER"
dis-playFormat="0"/>
</groups> <values>
<column name="PLANNED_REVENUE" label="Planned Revenue"
data-Type="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups> </report>
</reports> </rxjdbc>
- 16 -
Chapter 3: Data Sources
Connecting to a Teradata database
Use the following format for the value of connectionString if you are connecting to a
Teradata database: jdbc:teradata://[serverName/database=[databaseName]
Use the following table to help build your connection string:
Parameter
Description Required/Optional? Example
jdbc:teradata://
serverName
Constant that defines the sub-
protocol. Must be "jdbc:teradata://" Address of the server. Can be a DNS,
IP address, "localhost", or "127.0.0.1"
for the local computer. If you do not
specify a server name, you must
specify the server as a Property.
Required
Required
jdbc:teradata://
127.0.0.1
databaseName Name of the database Required TestDB
The following example defines a connection to a Teradata database:
<dataSources>
<dataSource id="ds1" type="JDBC"> <forName>com.teradata.jdbc.TeraDriver</forName> <connectionString>
jdbc:teradata://10.1.51./database=TestDB,tmode=ANSI,charset=UTF8, </connectionString> <user>username</user> <password>password</password>
</dataSource> </dataSources>
Example RXJDBC file for Teradata
Delete this text and replace it with your own content.
This file produces a crosstab with 3 levels of hierarchy and two column groups: Product
Line and Year. <rxjdbc>
<dataSources>
<dataSource id="ds1" type="JDBC">
<forName>com.teradata.jdbc.TeraDriver</forName
> <connectionString>
jdbc:teradata://10.1.51.11/database=SampleDB,tmode=ANSI,charset=UTF8 </connectionString> <user>username</user>
- 17 -
Example RXJDBC file for
Teradata
<password>password</password>
</dataSource> </dataSources> <reports>
<report name="Demo"
type="CROSSTAB"> <rowGroup>
<column name="Region" dataType="STRING"/>
<column name="Country" dataType="STRING"/>
<column name="City" dataType="STRING"/>
</rowGroup> <columnGroups>
<columnGroup> <query dataSource="ds1">
<![CDATA[
SELECT "Product Line",REGION,"RETAILER COUNTRY" as Country,CITY, SUM ("QUANTITY") AS QTY, SUM ("REVENUE") AS REVENUE, SUM ("GROSS PROFIT") AS PROFIT FROM SalesData GROUP BY "Product Line",REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT "Product Line", REGION,"RETAILER COUNTRY" as Country, CAST
(NULL AS VARCHAR(25)) as "CITY",
SUM ("QUANTITY") AS QTY, SUM
("REVENUE") AS REVENUE,
SUM ("GROSS PROFIT") AS PROFIT FROM SalesData GROUP BY "Product Line","REGION","RETAILER COUNTRY" UNION ALL SELECT "Product Line","REGION",CAST(NULL AS VARCHAR(25)) as Coun-
try, CAST(NULL AS VARCHAR(25)) as "CITY",
SUM ("QUANTITY") AS QTY, SUM
("REVENUE") AS REVENUE,
SUM ("GROSS PROFIT") AS PROFIT FROM SalesData GROUP BY "Product Line","REGION" UNION ALL SELECT "Product Line",CAST(NULL AS VARCHAR(25)) as "REGION",CAST
(NULL AS VARCHAR(25)) as Country, CAST(NULL AS VARCHAR(25)) as "CITY",
SUM ("QUANTITY") AS QTY, SUM
("REVENUE") AS REVENUE,
SUM ("GROSS PROFIT") AS PROFIT FROM SalesData group by "Product
line" ]]>
</query> <groups>
<column name=""Product Line"" label="Product Line"
data-Type="STRING"/>
- 18 -
Chapter 3: Data Sources
</groups>
<values> <column name="QTY" label="Quantity" dataType="NUMBER"
dis-playFormat="#,##0_,_."/>
<column name="PROFIT" label="Profit" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup> <columnGroup>
<query dataSource="ds1">
<![CDATA[
SELECT "Year",REGION,"RETAILER COUNTRY" as Country,CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SalesData GROUP BY "Year",REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT "Year",REGION,"RETAILER COUNTRY" as Country, CAST(NULL AS
VARCHAR(25)) as CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SalesData GROUP BY "Year",REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT "Year",REGION,CAST(NULL AS VARCHAR(25)) as Country, CAST
(NULL AS VARCHAR(25)) as CITY,
SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SalesData GROUP BY "Year",REGION UNION ALL SELECT "Year",CAST(NULL AS VARCHAR(25)) as Region ,CAST(NULL AS VAR-
CHAR(25)) as Country, CAST(NULL AS VARCHAR(25)) as City,
SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SalesData group by
"Year" ]]>
</query> <groups>
<column name=""Year"" label="Year" dataType="NUMBER"
dis-playFormat="0"/>
</groups> <values>
<column name="PLANNED_REVENUE" label="Planned Revenue"
data-Type="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups> </report>
</reports>
- 19 -
Connecting to an IBM DB2
database
</rxjdbc>
Connecting to an IBM DB2 database
Use the following format for the value of connectionString if you are connecting to an
IBM DB2 database: jdbc:db2://[serverName]:[port]/[serviceName]
Use the following table to help build your connection string:
Parameter Description Required/Optional? Example
jdbc:db2:
serverName
port
serviceName
Constant that defines the sub-
protocol. Must be "jdbc:db2:" Address of the server. Can be a DNS, IP
address, "localhost", or "127.0.0.1" for the
local computer. If you do not specify a
server name, you must specify the server
as a Property. Port to connect to on the server. If you
are connecting to the default port, you do
not need to specify a value or the
preceeding ":" for portNumber. Name of the service you are connecting to.
Required
Required
Required
Required
jdbc:db2:
127.0.0.1
:8080
MyService
The following example defines a connection to an IBM DB2 database:
<dataSources>
<dataSource id="ds1" type="JDBC"> <forName>com.ibm.db2.jcc.DB2Driver</forName> <connectionString>
jdbc:db2: //10.1.50.48:50001/SAMPLE:retrieveMessagesFromServerOnGetMessage=true;
</connectionString> <user>username</user> <password>password</password>
</dataSource> 0</dataSource>
Connecting to an Amazon
RedShift database Use the following format for the value of connectionString if you are connecting to an
Amazon RedShift database: jdbc:postgresql://[serverName]:[port]/[serviceName]
Use the following table to help build your connection string:
- 20 -
Chapter 3: Data Sources
Parameter Description
Required/Optional? Example
jdbc:postgresql:
serverName
port
Constant that defines the sub-
protocol. Must be "jdbc:postgresql:"
Address of the server. Can be a
DNS, IP address, "localhost", or
"127.0.0.1" for the local computer.
If you do not specify a server
name, you must specify the
server as a Property. Port to connect to on the server.
If you are connecting to the
default port, you do not need to
specify a value or the
preceeding ":" for portNumber.
Required jdbc:postgresql:
Required 127.0.0.1
Required :8080
Name of the service you are serviceName
connecting to.
Required MyService
The following example defines a connection to an Amazon Redshift database (note that
RedShift uses the PostgreSQL JDBC driver): <dataSources>
<dataSource id="ds1" type="JDBC"> <forName>org.postgresql.Driver</forName> <connectionString>
jdbc:postgresql: //jdbc-test.cr9goy8kzzfn.us-east-1.redshift.amazonaws.com:5439/dev
</connectionString> <user>username</user> <password>password</password>
</dataSource> </dataSources>
Connecting to an SAP HANA database
Use the following format for the value of connectionString if you are connecting to an
SAP HANA database: jdbc:sap://[serverName]:[port]
Use the following table to help build your connection string:
- 21 -
Connecting to an SAP HANA
database
Parameter Description Required/Optional? Example
jdbc:sap:
serverName
port
Constant that defines the sub-
protocol. Must be "jdbc:sap:" Address of the server. Can be a DNS, IP
address, "localhost", or "127.0.0.1" for the
local computer. If you do not specify a
server name, you must specify the server
as a Property. Port to connect to on the server. If you
are connecting to the default port, you do
not need to specify a value or the
preceeding ":" for portNumber.
Required
Required
Required
jdbc:sap:
127.0.0.1
:8080
The following example defines a connection to an SAP HANA database:
<dataSources>
<dataSource id="ds1" type="JDBC"> <forName>com.sap.db.jdbc.Driver</forName> <connectionString>
jdbc:sap://ec2-54-235-212-119.compute-1.amazonaws.com:30015 </connectionString> <user>username</user> <password>password</password>
</dataSource> 0</dataSource>
- 22 -
Chapter 4: Reports
The Reports section of an RJXDBC file is where you actually define your SQL query and
format your report. Every RXJDBC file must have one report defined in the Reports section
as a <report> element.This section provides guidelines and formatting requirements for
the Reports section of an RXJDBC file:
l RXJDBC file guidelines for building reports
l Data types
l Formatting column names
l Formatting values
l Defining a <rowGroup>
l Defining a <columnGroup>
l Defining values
l Guidelines for hierarchical reports
l Creating a report with adjacent groups
l Defining multiple data sources in an RXJDBC file
l Crosstab template
RXJDBC file guidelines for building reports
Use the following guidelines in building your RXJDBC XML file:
The <dataSources> element is mandatory.
The RXJDBC file must have at least one <dataSource> element defined.
Roambi supports multiple data source definitions in the same RXJDBC file.
The value of the Type attribute for the <dataSource> element must be set to "JDBC".
Parameters, which are defined by the <parameters> element, are optional.
The <reports> element is mandatory.
The RXJDBC file must have at least one <report> element defined.
The <rowGroup> element is mandatory and must have at least one <column>
child element.
The <rowGroup> columns define the hierarchy of the report. The hierarchy is
defined by the order in which the columns are defined in the RXJDBC file.
- 23 -
Chapter 4: Reports
The <ColumnGroups> element is mandatory.
You must define at least one <ColumnGroup>.
Each <ColumnGroup> element must have a child <query> element defined.
The <query> element must have a defined dataSource attribute. The value of the
dataSource attribute must match the value of the id attribute for one of the
defined data sources.
Enclose your SQL statements inside of a CDATA block so that you can escape
special characters such as quotes, <, >, and =.
Data types
When defining column names or values, specify the data type associated with the
corresponding value in the dataType attribute for that value. The SAP BusinessObjects Roambi Cloud JDBC Connector supports the following data types:
STRING
NUMERIC
DATE
For NUMERIC and DATE data types, also supply a value for the displayFormat attribute. See Formatting values.
Formatting numeric data types
When defining the format string, the symbols for digit group separators and for decimals are
obtained from the locale associated with the user executing the report. Enforce the default
format by explicitly defining the characters that will be used as decimals or separators, as
described in the following table:
Pattern #,##0.00 ¤#,##0.00_,_._$ ¤#,##0.##_ _,$ ##0.##%
¤ (\u00A4)
Currency Formatted Result
N/A 1,234.57 (US locale)
$ 1,234.57
EUR €1 234,57
12.34% (value must be in decimals)
Currency sign If present in a pattern, the monetary decimal
replaced by
separator and grouping separators are used
international currency
instead of the numeric ones. symbol.
Formatting date data types
A date pattern is a string of characters, where specific strings of characters are replaced with
date and time data from a calendar when formatting or used to generate data for a calendar
when parsing. The following are the characters used in patterns to show the appropriate formats
for a given locale. The following are examples:
- 24 -
RXJDBC file guidelines for
building reports
Pattern yyyy.MM.dd G 'at' HH:mm:ss zzz
EEE, MMM d, ''yy
MM.dd.yyyy
Result (in appropriate locale) 1996.07.10 AD at 15:08:56 PDT
Wed, July 10, '96
07.10.2012
Formatting column names
Column names are defined as name attributes of the <column> tag. Your defined column
names must exactly match the names of fields or columns returned by your SQL statement.
Keep the following guidelines in mind when defining your column names:
If you enclose a field name in quotes or brackets so that you can include spaces, the
resulting column name does not need to use the quotes or brackets.
For aggregations, always use aliased names. Otherwise, depending on which version of
SQL your database uses, the returned names might not match those in the XML file. The following example shows the correct formatting of column names:
<columnGroup>
<query dataSource="DS_1">
<![CDATA[
SELECT [Product Line],[REGION],[RETAILER COUNTRY] as Country,[CITY],
[Order method], [Retailer name],
SUM ([QUANTITY]) AS QTY, SUM
([REVENUE]) AS REVENUE,
avg ([GROSS MARGIN]) AS Margin, SUM ([GROSS PROFIT]) AS PROFIT FROM SalesData GROUP BY [Product Line],[REGION],[RETAILER
COUNTRY],[CITY], [Order method], [Retailer name]
WITH ROLLUP HAVING [Product Line] IS NOT
NULL ]]>
</query> <groups>
<column name="Product Line" label="Product Line"
dataType="STRING"/> </groups>
<values> <column name="QTY" dataType="NUMBER" label="QTY"
displayFormat="#,##0_, _."/>
<column name="PROFIT" dataType="NUMBER" label="Profit"
displayFormat="¤#, ##0.01_,_._$"/>
<column name="REVENUE" dataType="NUMBER" label="Revenue"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="Margin" dataType="NUMBER" label="Margin"
dis-playFormat="##0.01%_,_."/>
</values> </columnGroup>
- 25 -
Chapter 4: Reports
Formatting values
The XML format strings used in the RXJDBC XML file should be compliant with Unicode Locale
Data Markup Language (LDML). See the Unicode web site for more details about this standard. See the individual topics for rules about formatting numeric and date data types:
l Formatting numeric data types
l Formatting date data types
Defining a <rowGroup>
The <rowGroup> element defines the report hierarchy or key columns that uniquely identify a
record in the source data.
Use of this element varies slightly depending on which type of Roambi View you are creating:
For Squares and Pulse Views, the <rowGroup> defines the dimensions that you are
using for the report.
For Layers, CataList, Trends, and Cardex, the <rowGroup> defines the report hierarchy.
For PieView and SuperList, the <rowGroup> defines the key columns that uniquely
identify each record in the source data.
Defining a <columnGroup>
Use the <columnGroup> element to define the SQL statement that retrieves the data for the
report. This element also defines the field that groups the values for each column.
Use the <groups> element to define the field that will group your measures. This tag is
optional because not all reports require a grouping field:
The Pulse, Squars, and SuperList Views do not require grouping fields and therefore do
not require a <groups> element.
For CataList, Layers, Cardex, and PieView reports, use the grouping fields to group the
data used by the charts in your Roambi View.
You can define multiples fields under your <groups> element. If you define multiple fields,
you are implying that the report has a hierarchy structure. In this case, the first field groups the
second field, and so on:
<groups>
<column name=”Year” dataType=”NUMBER” displayFormat=”0” />
<column name=”Qrtr” dataType=”STRING” />
</groups>
Example: Grouping multiple columns under a column group
If you want to create a report with multiple measures under a group category, define the <groups>
element to include the group fields to create the hierarchy that will group your values. Use the
<values> element to define all of the measures that you want included in the group.
- 26 -
Defining a
<columnGroup>
For example, if you want to group columns by Region, and under each Region, you want to
show Total Sales, Total Qty Sold, and Profit, use the following sample XML to define your
groups and values. This example shows three measures under each Region: <groups>
<column name=”Region” dataType=”STRING”
/> </groups>
<values> <column name=”Total Sales” dataType=”NUMBER” displayFormat=”#,##0.00”
/> <column name=”Total Qty” dataType=”NUMBER” displayFormat=”#,##0” />
<column name=”Profit” dataType=”NUMBER” displayFormat=”#,##0.00” />
</values>
Example: Groups with a single measure
When you define a group field, and under that group only define one value column, the
column title becomes the field content for the group. For example, if you have a Year group, and under the year, you want to show Planned
Revenue, use the following sample XML as a guide: <groups>
<column name=”Year” dataType=”NUMBER” displayFormat=”0” /> </groups> <values>
<column name=”Planned Revenue” dataType=”NUMBER” displayFormat=”#,##0.00” /> </values> On a mobile device, this report will be imported as shown in the following screen capture:
- 27 -
Chapter 4: Reports
Note that in this example, the Roambi server assigned a random group name to the Years field
("Group27") because the year itself became the title of each column. To name the group
differently, you can change the name in Roambi Publisher or provide an additional column with
the Group name under the <groups> tag as shown: <columnGroup>
<query dataSource="DS_1">
<![CDATA[
SELECT [Year],[REGION],[RETAILER COUNTRY] as Country,[CITY],
[Order method], [Retailer name],
SUM (REVENUE) AS REVENUE, SUM ([PLANNED REVENUE]) AS PLANNED_REVENUE, 'Annual rev' as Annual_rev /* here’s the extra column we want to use as
the group header */
FROM SalesData GROUP BY [Year],[REGION],[RETAILER
COUNTRY],[CITY], [Order method], [Retailer name]
WITH ROLLUP HAVING [Year] IS NOT
NULL ]]>
</query> <groups>
<column name="Annual_rev" label="Annual rev" dataType="STRING" />
- 28 -
Defining values
<column name="Year" label="Year" dataType="NUMBER" displayFormat="0" />
</groups> <values>
<column name="PLANNED_REVENUE" dataType="NUMBER" label="Planned Rev" dis- playFormat="¤#,##0.01_,_._$"/>
</values> By defining a second column, the previously named "Group27" field is now labeled "Annual rev":
Defining values
The <values> element defines the measures or column values in your report. The <values>
tag is mandatory; you must have at least one <values> element defined in your report. The Roambi server uses the fields defined in the <values> element as the columns of the
report. The column names must match the field name used in the SQL statement or the alias
given to the field.
- 29 -
Chapter 4: Reports
Guidelines for hierarchical reports For Roambi Views that use hierarchies, such as CataList and Layers, the SQL query that extracts
data from your RDBMS should also calculate subtototals for each level of the hierarchy. For most
scenarios, you can use the UNION ALL statement to append subtotals to each hierarchical level.
Alternatively, if your database supports the ROLLUP statement, you can use that function. If you are using a UNION statement for each hierarchical level of summarization, include a
NULL value in the corresponding field of the hierarchy. For example, if you are including a
hierarchy for Region, Country and City, the SQL query must have the following structure:
The subtotal for Country must have NULL in the City field.
The subtotal for Region must have NULL in the both the City and Country fields.
The grand total must have NULL in the Region, Country and City fields.
The order of the <rowGroup> definitions determines the hierarchy of the report, so
calculate subtotals in the same order. When your report has a hierarchy, and you are using Column Groups to group column values
by category, your GROUP BY statement must include both the <columnGroup> field and each
of the columns defined in <rowGroup>. Grouping your fields in the correct order is critical to
obtaining the expected result:
The <columnGroup> field must be the first field in the GROUP BY statement.
Each <rowGroup> field should be in the order of the desired hierarchy. Keep in mind that a report can have multiple column groups, and each group must have its own <columnGroup> definition.
For example, consider the following <rowGroup>:
<rowGroup>
<column name=”Country” dataType=”STRING” /> <column name=”City” dataType=”STRING” /> <column name=”Vendor” dataType=”STRING” />
</rowGroup>
If you want to group Sales, Qty, and Returns by Product Line, your <query> and
<columnGroup> should look like the following sample: <columnGroup>
<query dataSource=”DS_1”
> <![CDATA
SELECT [Product Line], Country, City,
Vendor, sum(Sales) as SALES, sum(Qty) as
QTY, sum(Vendor) as VENDOR
FROM SALES_DATA_TABLE GROUP BY [Product Line], Country, City, Vendor WITH ROLLUP HAVING [Product Line] IS NOT
NULL ]]>
- 30 -
Creating a report with
adjacent groups
</query>
<groups> <column name=”Product Line” dataType=”STRING”
/> </groups>
<values> <column name=”SALES” dataType=NUMBER displayFromat=”"¤#,##0.01_,_._$"
/> <column name=”QTY” dataType=NUMBER displayFormat=”#,##0_._,” />
<column name=”SALES” dataType=NUMBER displayFromat=”"¤#,##0.01_,_._$"
/> </values>
</columnGroup>
Creating a report with adjacent groups
Reports can have multiple column groups. In this case, each column group defines its own
query and the fields to use as groups. Roambi uses the column groups to group chartable
data. For example: Sales by Month
Quantity sold by Region
Monthly Sales by Sales person
Defining multiple data sources in
an RXJDBC file When a report obtains data from multiple data soures, each query must return the fields
defined by the <rowGroup> element. The <rowGroup> fields are used to consolidate the
data from all data sources. The following example retrieves data from an Oracle database and a SQL Server
database. Common fields are defined in the <rowGroup> section: <rxjdbc>
<dataSources>
<!-- ORACLE CONNECTION -->
<dataSource id="ds1" type="JDBC">
<forName>oracle.jdbc.OracleDriver</forName> <connectionString>
jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest </connectionString>
<user>username</user> <password>password</password>
</dataSource>
<!-- SQL SERVER CONNECTION -->
<dataSource id="ds3" type="JDBC">
<forName>com.microsoft.sqlserver.jdbc.SQLServerDriver</forName>
- 31 -
Chapter 4: Reports
<connectionString>
jdbc:sqlserver://msdb2008.devqa.lan;databaseName=SampleDB </connectionString> <user>username</user> <password>password</password>
</dataSource> </dataSources>
<reports>
<report name="Demo"
type="CROSSTAB"> <rowGroup>
<column name="Region" dataType="STRING"/>
<column name="Country" dataType="STRING"/>
<column name="City" dataType="STRING"/>
</rowGroup> <columnGroups>
<columnGroup> <!-- Getting Data from ORACALE DB --
> <query dataSource="ds1">
<![CDATA[ SELECT "PRODUCT LINE",REGION,"RETAILER COUNTRY" as COUNTRY,
CITY, SUM ("QUANTITY") AS QTY, SUM
("REVENUE") AS REVENUE,
SUM ("GROSS PROFIT") AS PROFIT FROM SCOTT."SalesData"
GROUP BY ROLLUP ("PRODUCT LINE",REGION,"RETAILER COUNTRY",CITY) HAVING "PRODUCT LINE" IS NOT NULL
]]>
</query> <groups>
<column name="PRODUCT LINE" label="Product Line-Oracle"
data-Type="STRING"/>
</groups> <values>
<column name="QTY" label="Quantity-ORC" dataType="NUMBER"
dis-playFormat="#,##0_,_."/>
<column name="PROFIT" label="Profit-ORC" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="REVENUE" label="Revenue-ORC" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup> <columnGroup>
<!-- Getting data from MS SQL Server -->
<query dataSource="ds3">
SELECT [Order method],[REGION],[RETAILER COUNTRY] as Country, [CITY],
SUM ([QUANTITY]) AS QTY, SUM
([REVENUE]) AS REVENUE,
- 32 -
Crosstab template
SUM ([GROSS PROFIT]) AS PROFIT
FROM SalesData GROUP BY [Order method],[REGION],[RETAILER COUNTRY],[CITY] WITH ROLLUP HAVING [Order method] IS NOT
NULL </query>
<groups> <column name="Order method" label="Order method-SQLsrv"
data-Type="STRING"/>
</groups> <values>
<column name="QTY" label="Quantity-SQL" dataType="NUMBER"
dis-playFormat="#,##0_,_."/>
<column name="PROFIT" label="Profit-SQL" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="REVENUE" label="Revenue-SQL" dataType="NUMBER"
dis-playFormat="#,##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups> </report>
</reports> </rxjdbc>
Crosstab template
Use the following template to your crosstab source report data to help you plan the reports
section of your RXJDBC file. This template helps you visualize the use of column groups:
In this example, the row group and column groups are color coded:
Blue: Defines the Row Group values.
Green: Defines the first Column Group with the column header name and contains
the values for each column with measures.
Yellow: Defines the second Column Group with the column header name and contains
the values for each column with measures.
- 33 -
Chapter 4: Reports
Note that the corresponding RXJDBC file has two <columnGroup> elements that map to the
two column groups in the crosstab:
- 34 -
Chapter 5: Parameters
You can optionally add parameters to a source report. Parameters add a level of interactivity for
end users who are prompted to select a subset of data to view on their mobile devices. This
section describes how to define parameters in an RXJDBC file and how to call those parameters
so that users are prompted with possible values when viewing the published RBI file.
Defining parameters
Use parameters to filter data in your SQL queries. When you define a parameter,
provide the following attribute values:
ID
Name
Data type (Default data type is a STRING.)
Display format
Parameter type (Valid values are MULTIPLE_VALUE or SINGLE_VALUE).
The following example element defines a single parameter named Year:
<parameter id="p1" name="Year" dataType="NUMBER" displayFormat=”0” />
After defining the parameter, you may utilize it in your column group queries by writing the
ampersand (@) character followed by the parameter ID. The following example replaces the
value for "Year" with the value of the already-defined parameter "p1": <columnGroup>
<query dataSource="DS_1">
<![CDATA[
SELECT Region, Country, City, Product, SUM(Sales) AS Sales FROM SalesTable WHERE Year =
@p1 ]]>
</query> </columnGroup>
Returning predefined parameter values
The SAP BusinessObjects Roambi Cloud JDBC Connector includes two built-in
predefined parameters that are available for your reports:
- 35 -
Chapter 5: Parameters
@locale: Specifies the locale of the mobile device that is viewing the report or of the
web browser that is publishing the report. Use this parameter to create localized
content in the language of the user who is generating the report.
If a database has translated content, the next example shows how to use the @locale
parameter to return content in the appropriate language: <query dataSource="DS_1">
<![CDATA[
SELECT distinct Country = CASE @locale WHEN 'en_US' THEN DimGeography.EnglishCountryRegionName WHEN 'es_ES' THEN DimGeography.SpanishCountryRegionName WHEN 'fr_FR' THEN DimGeography.FrenchCountryRegionName END
from DimGeography ]]
</query>
- 36 -
Defining parameters
Data Refresh Automation and
Bursting using RoambiScript
The RXJDBC connector helps the publisher of Roambi Analytics in extracting and for-
matting the data from the supported Databases. In order to automate the data refresh
of Roambi Reports, you can use the RoambiScript utility.
By combining the results from the RXJDBC connector and the API integration used in
RoambiScript, you can create powerful solutions that automate the data updates of
the Roambi reports.
In the following example we are going to create a template Roambi report that will
be used to generate a set of reports based on the parameters defined in the
RXJDBC connector. This scenario is typical to generate multiple roambi reports
when the content is unique based on some criteria that can be progmatically defined.
In our example we are going to generate roambi reports based on the sales
region defined as argument for the RXJDBC connector.
To make our sample work we need the following components: the RXJDBC jar file roambi-crosstab-export.jar
The RoambiScript utility roambi-api-cli.jar
A CSV file to define the Roambi Integration logic. This file will have the definition of the
Burst Arguments or parameters based on which the data extraction is going to happen.
roambi-integration.config sample:
BurstKey - Is the concept will use to extract data and create unique
Roambi reports based on that value
Template - Defines the Location and Name of Roambi Template that we'll use
to populate the new Roambi Report
sourceFileName - File Name to use to populate the Roambi Report.
DestinationFolder - Defines the path in the Roambi Business Library where
the new Roambi reports will be sored
RoambiFileName - Defines the name of the new Roambi File
Permissions - Defines the permissions we are going to assign to the new
Roambi File.
- 37 -
Data Refresh Automation and Bursting using RoambiScript
Creating the RXJDBC file to use a paramter to fileter data:
<rxjdbc> <dataSources>
<dataSource id="DS_1" type="JDBC">
<forName>com.microsoft.sqlserver.jdbc.SQLServerDriver</forName>
<connectionString>
jdbc:sqlserver://msdb2008.devqa.lan;databaseName=BigOLAPDatabase
</connectionString> <user>roambi</user>
<password>Mellmo123$</password>
</dataSource> </dataSources> <parameters> <parameter id="p2" name="Region" dataType="STRING" paramType="MULTIPLE_VALUE"
> </parameters> <reports> <report name="Sample with Parameters"
type="CROSSTAB"> <rowGroup> <column name="Region" label="Region" dataType="STRING"/>
<column name="Country" label="Country" dataType="STRING"/>
<column name="City" label="City" dataType="STRING"/> <column name="Order method" label="OrderMethod" dataType="STRING"
/> <column name="Retailer name" label="Retailer" dataType="STRING" />
</rowGroup> <columnGroups> <columnGroup> <query dataSource="DS_1">
<![CDATA[ SELECT [Product Line],[REGION],[RETAILER COUNTRY] as Country,[CITY],
[Order method], [Retailer name], SUM ([QUANTITY]) AS QTY, SUM
([REVENUE]) AS REVENUE, avg
([GROSS MARGIN]) AS Margin, SUM ([GROSS PROFIT]) AS
PROFIT FROM vw_Blink100KRecs WHERE [REGION]
IN (@p2) GROUP BY [Product Line],[REGION],[RETAILER COUNTRY],[CITY],
[Order method], [Retailer name] WITH ROLLUP HAVING [Product Line] IS NOT NULL
]]> </query> <groups> <column name="Product Line" label="Product Line"
dataType="STRING"/> </groups> <values> <column name="QTY" dataType="NUMBER" label="QTY" displayFormat="#,##0_,_."/>
- 38 -
Defining parameters
<column name="PROFIT" dataType="NUMBER" label="Profit" displayFormat="¤#,##0.01_,_._$"/>
<column name="REVENUE" dataType="NUMBER" label="Revenue"
displayFormat="¤#,##0.01_,_._$"/> <column name="Margin" dataType="NUMBER" label="Margin"
displayFormat="##0.01%_,_."/> </values> </columnGroup> <columnGroup> <query dataSource="DS_1">
<![CDATA[
SELECT [Year],[REGION],[RETAILER COUNTRY] as Country,[CITY],
[Order method], [Retailer name], SUM (REVENUE) AS REVENUE, SUM ([PLANNED REVENUE]) AS PLANNED_REVENUE
FROM vw_Blink100KRecs WHERE [REGION]
IN (@p2) GROUP BY [Year],[REGION],[RETAILER COUNTRY],[CITY],
[Order method], [Retailer name] WITH ROLLUP HAVING [Year] IS NOT NULL
]]> </query> <groups> <column name="Year" label="Year" dataType="NUMBER" displayFormat="0"
/> </groups> <values> <column name="REVENUE" dataType="NUMBER" label="Revenue"
displayFormat="¤#,##0.01_,_._$"/> <column name="PLANNED_REVENUE" dataType="NUMBER"
label="Planned Rev" displayFormat="¤#, ##0.01_,_._$"/> </values> </columnGroup> </columnGroups> </report> </reports> </rxjdbc>
This rxjdbc file generates an excel file that looks like this:
- 39 -
Data Refresh Automation and Bursting using RoambiScript
With this source file we created a Template Roambi Report (sqlserverParamsTemplate)
and placed in the Rxjdbc Reports folder of our SAP BusinessObjects Roambi Cloud
Organization.
The Following PowerShell script, reads the Roambi Integration file and for each line
executes the rxjdbc connector to obtain the new data file, and the creates a new
Roambi Report based on the template and using the new source data.
cd "c:\roambi"
$options=Import-Csv ".\roambi-
integration.config" $nrecs=0 $nerrors=0
$nuploads=0
$npublish=0 $message_file=".\errorlog"
$date = Get-Date
write-host "Process started at: $date `n"
foreach ( $record in $options ) {
$region = $record.region
$sourceTemplate = $record.SourceRBI
$sourceFileName = $record.SourceFilename
- 40 -
Defining parameters
$destFolderRBI = $record.DestFolder
$destRBI = $record.DestRBI $permission = $record.Permissions -replace
";","," $nrecs++
write-host "Processing $region `n"
java -jar roambi-crosstab-export.jar -p Region=$-
region -o $sourceFileName sampleParamter.rxjdbc
$npublish++
write-host "Creating/updating RBI file for $region
into $destfolderRBI SourceFile: $sourceFileName "
java -jar roambi-api-cli.jar -props="./myorg.properties "
publish-with-file --file=$sourceFileName --tem-
plate=$sourceTemplate --title=$destRBI --folder=$de-
stFolderRBI --permission=$permission 1>".\logfile"
if ( $LASTEXITCODE -gt 0 ) {
write-host "Publish for $report ..
failed.. Exiting `n"
$nerrors++
continue
}
}
$end_date = get-date write-host "Process finished at $end_date records read :
$nrecs Uploaded files: $nuploads Published reports: $npublish
Errors: $nerrors `n"
Sample content for the roambi-integration.config file:
- 41 -
Data Refresh Automation and Bursting using RoambiScript
regio- sourceRBI
source- destFolder
destRBI
n
FileName
Amer- /Rxjdbc /Sales
Sales_ Reports/sqlser- Americas.xlsx Reports/Amer-
icas verParamsTemplate icas Americas
North- /Rxjdbc North-
/Sales Sales_
ern Reports/sqlser-
Reports/North-
North-
erEurope.xlsx
Europe verParamsTemplate
ern Europe ernEurope
Asia /Rxjdbc /Sales
Sales_ Reports/sqlser-
AsiaPacific.xlsx
Reports/Asia
Pacific
AsiaPacific verParamsTemplate Pacific
South- /Rxjdbc South-
/Sales
ern Reports/sqlser-
Reports/South-
ernEurope.xlsx
Europe verParamsTemplate
ern Europe
- 42 -
per-
missions
Chapter 6: Sample reports
This section sample RXJDBC files for each of the Roambi Views supported by the SAP
BusinessObjects Roambi Cloud JDBC Connector. For each sample, this section also
provides one or more screen captures showing how the final report looks when viewed on a
supported mobile device:
l Cardex Example
l CataList Example
l Layers Example
l PieView Example
l Pulse Example
l Squares Example
l SuperList Example
l Trends Example
Cardex Example
This sample RXJDBC file can be used to create a Cardex View. The data source in this example is
an Oracle database. The source report is a Crosstab with the following characteristics:
Two levels of hierarchy
Two column groups
No summarizations
No parameters
<rxjdbc>
<dataSources>
<dataSource id="ds1" type="JDBC">
<forName>oracle.jdbc.OracleDriver</forName
> <con-
nec-
tionString>jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest</connectionString
>
<user>username</user>
<password>password</password>
</dataSource>
</dataSources>
- 43 -
Chapter 6: Sample reports
<reports>
<report name="Cardex Demo"
type="CROSSTAB"> <rowGroup>
<column name="Country" dataType="STRING"/>
<column name="CITY" dataType="STRING"/>
</rowGroup> <columnGroups>
<columnGroup> <query dataSource="ds1">
<![CDATA[
SELECT "PRODUCT LINE","RETAILER COUNTRY" as Country,CITY, SUM (QUANTITY) AS Quantity, SUM (REVENUE) AS Revenue, SUM ("GROSS PROFIT") AS GrossProfit, SUM ("GROSS MARGIN") AS GrossMargin FROM SCOTT."SalesData" GROUP BY ("PRODUCT LINE","RETAILER
COUNTRY",CITY) ]]>
</query> <groups>
<column name="PRODUCT LINE"
dataType="STRING"/> </groups>
<values> <column name="QUANTITY" label="Quantity" dataType="NUMBER"
dis-playFormat="#,##0.00"/>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="GROSSPROFIT" label="Gross Profit"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
<column name="GrossMargin" label="Gross Margin"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup> <columnGroup>
<query dataSource="ds1">
<![CDATA[
SELECT YEAR,"RETAILER COUNTRY" as Country,
CITY, SUM ("PRODUCT COST") AS ProductCost
FROM SCOTT."SalesData" GROUP BY (YEAR,"RETAILER
COUNTRY",CITY) ]]>
</query> <groups>
<column name="YEAR" dataType="NUMBER"
displayFormat="###0"/> </groups>
<values> <column name="ProductCost" label="Product Cost"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
</values>
- 44 -
Cardex Example
</columnGroup>
</columnGroups> </report>
</reports> </rxjdbc>
The following screen cap demonstrates how the published RBI for this report looks when it
has been downloaded to an iPad:
The row groups make up the tab and card titles:
The first column, "Country", is the tab title.
The second column "CITY" is the card title. Drill-down to an individual card to see how the column groups map to the source report:
- 45 -
Chapter 6: Sample reports
In this example, the column group fields map as follows:
The defined column group "Product Line" maps to the section title on the card.
The values "Quantity", "Revenue", "Gross Profit", and "Gross Margin" map to the
measures on the card.
CataList Example This sample RXJDBC file can be used to create a CataList View. The data source in this example is
an Oracle database. The source report is a Crosstab with the following characteristics:
Multiple levels of hierarchy
Two column groups
No parameters. <rxjdbc>
<dataSources>
<dataSource id="ds1" type="JDBC">
<forName>oracle.jdbc.OracleDriver</forName
>
- 46 -
CataList Example <connectionString>jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest</connectio
nString> <user>username</user> <password>password</password>
</dataSource> </dataSources>
<reports>
<report name="Demo"
type="CROSSTAB"> <rowGroup>
<column name="Region" dataType="STRING"/>
<column name="Country" dataType="STRING"/>
<column name="City" dataType="STRING"/>
</rowGroup> <columnGroups>
<columnGroup> <query dataSource="ds1">
<![CDATA[
SELECT "PRODUCT LINE",REGION,"RETAILER COUNTRY" as COUNTRY, CITY,
SUM ("DOLLARS") AS DOLLARS, SUM ("REVENUE") AS REVENUE, SUM ("GROSS PROFIT") AS PROFIT FROM SCOTT."SalesData" GROUP BY "PRODUCT LINE",REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT "PRODUCT LINE", REGION,"RETAILER COUNTRY" as COUNTRY,
NULL as CITY, SUM ("DOLLARS") AS DOLLARS, SUM ("REVENUE") AS REVENUE, SUM ("GROSS PROFIT") AS PROFIT FROM SCOTT."SalesData" GROUP BY "PRODUCT LINE",REGION,"RETAILER COUNTRY" UNION ALL SELECT "PRODUCT LINE",REGION,NULL as COUNTRY, NULL as CITY,
SUM ("DOLLARS") AS DOLLARS,
SUM ("REVENUE") AS REVENUE, SUM ("GROSS PROFIT") AS PROFIT FROM SCOTT."SalesData" GROUP BY "PRODUCT LINE","REGION" UNION ALL SELECT "PRODUCT LINE",NULL as REGION, NULL as COUNTRY, NULL as
CITY, SUM ("DOLLARS") AS DOLLARS, SUM ("REVENUE") AS REVENUE, SUM ("GROSS PROFIT") AS PROFIT FROM SCOTT."SalesData" GROUP BY "PRODUCT
LINE" ]]>
- 47 -
Chapter 6: Sample reports
</query>
<groups> <column name="PRODUCT LINE" label="Product Line"
data-Type="STRING"/>
</groups> <values>
<column name="DOLLARS" label="Dollars" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="PROFIT" label="Profit" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup> <columnGroup>
<query dataSource="ds1">
<![CDATA[
SELECT YEAR,REGION,"RETAILER COUNTRY" as COUNTRY,CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SCOTT."SalesData" GROUP BY YEAR,REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT YEAR,REGION,"RETAILER COUNTRY" as COUNTRY, NULL as
CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SCOTT."SalesData" GROUP BY YEAR,REGION,"RETAILER COUNTRY",CITY UNION ALL SELECT YEAR,REGION,NULL as COUNTRY, NULL as CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SCOTT."SalesData" GROUP BY YEAR,REGION UNION ALL SELECT YEAR, NULL as REGION , NULL as COUNTRY, NULL as CITY, SUM ("PLANNED REVENUE") AS PLANNED_REVENUE FROM SCOTT."SalesData" GROUP BY
YEAR ]]>
</query> <groups>
<column name="YEAR" label="Year" dataType="NUMBER"
dis-playFormat="0"/>
</groups> <values>
<column name="PLANNED_REVENUE" label="Planned Revenue"
data-Type="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups>
- 48 -
CataList Example
</report>
</reports> </rxjdbc>
The following screen cap demonstrates how the published RBI for this report looks when it
has been downloaded to an iPad:
In this example, the columns defined under groups create the high-level categories that you
can browse. For this CataList, these categories are Product Line and Years. Click the
category in the upper-left corner to swipe to the other product lines and year data. Each
category page initially lists its data by the Region row group:
- 49 -
Chapter 6: Sample reports
Tap a country to drill down into the data for that country. The fields on this screen are defined as
row groups, such as Country and City. This example shows the data for Belgium, listed by city:
- 50 -
CataList Example
Tap a city to drill into the data for that city. This example shows some of the different cards
available for Brugge:
- 51 -
Chapter 6: Sample reports
Layers Example This sample RXJDBC file can be used to create a Layers View. The data source in this example is
a SQL Server database. The source report is a Crosstab with the following characteristics:
One column group
No parameters. <rxjdbc>
<dataSources>
<dataSource id="ds1" type="JDBC">
<forName>oracle.jdbc.OracleDriver</forName
>
- 52 -
Layers Example
<connectionString>jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest</conne
ctionString> <user>username</user> <password>password</password>
</dataSource> </dataSources>
<reports>
<report name="Layers Demo"
type="CROSSTAB"> <rowGroup>
<column name="Region" dataType="STRING"/>
<column name="Country" dataType="STRING"/>
<column name="City" dataType="STRING"/>
<column name="ORDER METHOD" dataType="STRING"/>
<column name="PRODUCT TYPE" dataType="STRING"/>
</rowGroup> <columnGroups>
<columnGroup> <query dataSource="ds1">
<![CDATA[
SELECT "PRODUCT LINE",REGION,"RETAILER COUNTRY" as COUNTRY, CITY,"ORDER METHOD","PRODUCT TYPE",
SUM ("DOLLARS") AS DOLLARS, SUM ("REVENUE") AS REVENUE, SUM ("GROSS PROFIT") AS PROFIT FROM SCOTT."SalesData" GROUP BY ROLLUP ("PRODUCT LINE",REGION,"RETAILER
COUNTRY",CITY, "ORDER METHOD","PRODUCT TYPE")
HAVING "PRODUCT LINE" IS NOT
NULL ]]>
</query> <groups>
<column name="PRODUCT LINE" label="Product Line"
data-Type="STRING"/>
</groups> <values>
<column name="DOLLARS" label="Dollars" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="PROFIT" label="Profit" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups> </report>
</reports> </rxjdbc>
- 53 -
Chapter 6: Sample reports
The following screen cap demonstrates how the published RBI for this report looks when it has
been downloaded to an iPad:
The column name defined as a group becomes the field for the categories across the top of
the screen. In this example, Product Line is the top-level category. Swipe through the top
layer to view additional product lines. You can also tap a chart to see the measure details
(Dollars, Profit, and Revenue) for that product line:
- 54 -
Layers Example
Tap a Region (defined as a row group) to drill into the charts and details for that region:
- 55 -
Chapter 6: Sample reports
PieView Example
This sample RXJDBC file can be used to create a PieView. The data source in this example
is an Oracle database. The source report is a Crosstab with the following characteristics:
One column group
The Country column is the main measure. <rxjdbc>
<dataSources>
<dataSource id="ds1" type="JDBC">
<forName>oracle.jdbc.OracleDriver</forName
>
- 56 -
PieView Example
<connectionString>jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest</conne
ctionString> <user>username</user> <password>password</password>
</dataSource> </dataSources>
<reports>
<report name="Pie Demo"
type="CROSSTAB"> <rowGroup>
<column name="Country"
dataType="STRING"/> </rowGroup>
<columnGroups> <columnGroup>
<query dataSource="ds1">
<![CDATA[
SELECT "RETAILER COUNTRY" as Country, SUM(QUANTITY) AS Quantity FROM SCOTT."SalesData" GROUP BY ("RETAILER
COUNTRY") ]]>
</query> <values>
<column name="QUANTITY" label="Quantity" dataType="NUMBER"
dis-playFormat="#,##0.00"/>
</values> </columnGroup> <columnGroup>
<query dataSource="ds1">
<![CDATA[
SELECT "RETAILER COUNTRY" as Country, "RETAILER NAME" as Retail- erName,
SUM (REVENUE) AS Revenue, SUM ("GROSS PROFIT") AS GrossProfit, SUM ("PRODUCT COST") AS ProductCost FROM SCOTT."SalesData" GROUP BY ("RETAILER COUNTRY","RETAILER
NAME") ]]>
</query> <values>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="GROSSPROFIT" label="Gross Profit"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
<column name="ProductCost" label="Product Cost"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups>
- 57 -
Chapter 6: Sample reports
</report>
</reports> </rxjdbc>
The following screen cap demonstrates how the published RBI for this report looks when it has
been downloaded to an iPad:
The initial screen shows pies for Quantity and Revenue. Swipe to see the remaining two
measures, Gross Profit and Product Cost:
- 58 -
PieView Example
For this example, the column defined as the row group becomes the pie "slice". In this case,
each pie slice is a country. Each defined value has its own pie chart (Quantity, Revenue, Gross Profit, and Product
Cost). Alternatively, you can drill into a country's slice to see the figures for these
measures for that country, as shown in the following screen capture:
- 59 -
Chapter 6: Sample reports
Pulse Example
This sample RXJDBC file can be used to create a Pulse View. The data source in this example
is an Oracle database. The source report is a Crosstab with the following characteristics:
One column group
No summarizations
No <group> element; Group Names are not required for the Pulse or Squares Views.
Only measure names are needed. Note that both the Pulse and Squares View examples use the same source report. (See
Squares Example.) <rxjdbc>
<dataSources>
<dataSource id="ds1" type="JDBC">
<forName>oracle.jdbc.OracleDriver</forName
> <connectionString>jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest</connectio
nString> <user>username</user> <password>password</password>
</dataSource> </dataSources>
- 60 -
Pulse Example
<reports>
<report name="SquaresPulse Demo"
type="CROSSTAB"> <rowGroup>
<column name="Region" dataType="STRING"/>
<column name="Country" dataType="STRING"/>
<column name="YEAR" label="Year" dataType="NUMBER"
dis-playFormat="0"/>
<column name="MONTH" label="Month"
dataType="NUMBER" displayFormat="0"/>
</rowGroup> <columnGroups>
<columnGroup> <query dataSource="ds1">
<![CDATA[
SELECT REGION,"RETAILER COUNTRY" as Country,Year,Month, SUM(REVENUE) AS Revenue, SUM(QUANTITY) AS Quantity, SUM("GROSS PROFIT") AS GrossProfit, SUM ("GROSS MARGIN") AS GrossMargin, SUM ("PRODUCT COST") AS ProductCost FROM SCOTT."SalesData" GROUP BY (REGION,"RETAILER
COUNTRY",Year,Month) ]]>
</query> <values>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="?#,##0.01_,_._$"/>
<column name="QUANTITY" label="Quantity" dataType="NUMBER"
dis-playFormat="?#,##0.01_,_._$"/>
<column name="GROSSPROFIT" label="Gross Profit"
dataType="NUMBER" displayFormat="?#,##0.01_,_._$"/>
<column name="GrossMargin" label="Gross Margin"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
<column name="ProductCost" label="Product Cost"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups> </report>
</reports> </rxjdbc>
The following screen cap demonstrates how the published RBI for this report looks when it
has been downloaded to an iPad:
- 61 -
Chapter 6: Sample reports
In this example, the defined row group "Region" forms the menu at the bottom of the screen.
The comparisons in the top section are made up of the columns defined as values: Revenue,
Quantity, Gross Profit, Gross Margin, and Product Cost. Use Roambi Publisher to set up the
actual comparisons between these measures. Tap a comparison to view the details for that comparison:
- 62 -
Squares Example
Squares Example This sample RXJDBC file can be used to create a Squares View. The data source in this example
is a SQL Server database. The source report is a Crosstab with the following characteristics:
One column group
No summarizations
No <group> element; Group Names are not required for the Pulse or Squares Views.
Only measure names are needed. Note that both the Pulse and Squares View examples use the same source report. (See
Pulse Example.) <rxjdbc>
- 63 -
Chapter 6: Sample reports
<dataSources>
<dataSource id="ds1" type="JDBC"> <forName>oracle.jdbc.OracleDriver</forName>
<connectionString>jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest</connectio
nString>
<user>username</user> <password>password</password>
</dataSource> </dataSources>
<reports>
<report name="SquaresPulse Demo"
type="CROSSTAB"> <rowGroup>
<column name="Region" dataType="STRING"/>
<column name="Country" dataType="STRING"/>
<column name="YEAR" label="Year" dataType="NUMBER" displayFormat="0"/>
<column name="MONTH" label="Month" dataType="NUMBER" dis- playFormat="0"/>
</rowGroup> <columnGroups>
<columnGroup> <query dataSource="ds1">
<![CDATA[
SELECT REGION,"RETAILER COUNTRY" as Country,Year,Month, SUM(REVENUE) AS Revenue, SUM(QUANTITY) AS Quantity, SUM("GROSS PROFIT") AS GrossProfit, SUM ("GROSS MARGIN") AS GrossMargin, SUM ("PRODUCT COST") AS ProductCost FROM SCOTT."SalesData" GROUP BY (REGION,"RETAILER
COUNTRY",Year,Month) ]]>
</query> <values>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="?#,##0.01_,_._$"/>
<column name="QUANTITY" label="Quantity" dataType="NUMBER"
dis-playFormat="?#,##0.01_,_._$"/>
<column name="GROSSPROFIT" label="Gross Profit"
dataType="NUMBER" displayFormat="?#,##0.01_,_._$"/>
<column name="GrossMargin" label="Gross Margin"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
<column name="ProductCost" label="Product Cost"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups> </report>
</reports>
- 64 -
Squares Example
</rxjdbc>
The following screen cap demonstrates how the published RBI for this report looks when it
has been downloaded to an iPad:
The row groups map to the comparison choices. Select your comparison fields by
tapping the Comparison menu in the upper-left corner.
- 65 -
Chapter 6: Sample reports
Tap the square color (red or green) to drill down to see the data for that color. The data
includes the measures that you pre-defined as values: Revenue, Quantity, Gross Profit, Gross
Margin, and Product Cost.
SuperList Example This sample RXJDBC file can be used to create a SuperList View. The data source in this example is
a SQL Server database. The source report is a Crosstab with the following characteristics:
One column group
Field definitions have formatting strings <rxjdbc>
- 66 -
SuperList Example
<dataSources>
<dataSource id="ds1" type="JDBC"> <forName>oracle.jdbc.OracleDriver</forName>
<connectionString>jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest</connectio
nString>
<user>username</user> <password>password</password>
</dataSource> </dataSources>
<reports>
<report name="Superlist Demo"
type="CROSSTAB"> <rowGroup>
<column name="City"
dataType="STRING"/> </rowGroup>
<columnGroups> <columnGroup>
<query dataSource="ds1">
<![CDATA[
SELECT City, (REVENUE) AS Revenue, (QUANTITY) AS Quantity, ("GROSS PROFIT") AS GrossProfit, ("GROSS MARGIN") AS GrossMargin, ("PRODUCT COST") AS ProductCost, (REGION) AS Region, ("PRODUCT LINE") AS ProductLine FROM SCOTT."SalesData"
]]> </query> <values>
<column name="REVENUE" label="Revenue" dataType="NUMBER"
dis-playFormat="¤#,##0.01_,_._$"/>
<column name="QUANTITY" label="Quantity" dataType="NUMBER"
dis-playFormat="#,##0.00"/>
<column name="GROSSPROFIT" label="Gross Profit"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
<column name="GrossMargin" label="Gross Margin"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
<column name="ProductCost" label="Product Cost"
dataType="NUMBER" displayFormat="¤#,##0.01_,_._$"/>
<column name="REGION" dataType="STRING"/>
<column name="ProductLine" dataType="STRING"/>
</values> </columnGroup>
</columnGroups> </report>
</reports> </rxjdbc>
- 67 -
Chapter 6: Sample reports
The following screen cap demonstrates how the published RBI for this report looks when it has
been downloaded to an iPad:
The defined column under <rowGroup> becomes the key column in this example. The
columns defined as values (Revenue, Quantity, Gross Profit, Gross Margin, Product Cost,
Region, and Product Line) make up the remaining columns.
Trends Example This sample RXJDBC file can be used to create a Trends View. The data source in this example is
a SQL Server database. The source report is a Crosstab with the following characteristics:
Three levels of hierarchy
One column group
Summarizations for each level of hierarcy
- 68 -
Trends Example
<rxjdbc>
<dataSources>
<dataSource id="ds1" type="JDBC">
<forName>oracle.jdbc.OracleDriver</forName
>
<connectionString>jdbc:oracle:thin:@oracledb11.devqa.lan:1521:roambidbtest</connectio
nString>
<user>username</user> <password>password</password>
</dataSource> </dataSources> <reports>
<report name="Trends Demo"
type="CROSSTAB"> <rowGroup>
<column name="YEAR" label="Year" dataType="NUMBER" displayFormat="0"/>
<column name="QRTR" label="Quarter" dataType="NUMBER" dis- playFormat="0"/>
<column name="MONTH" label="Month"
dataType="NUMBER" displayFormat="0"/>
</rowGroup> <columnGroups>
<columnGroup> <query dataSource="ds1">
<![CDATA[
SELECT "PRODUCT LINE",Year, QRTR, Month, SUM(REVENUE) AS Revenue, SUM(QUANTITY) AS Quantity, SUM("GROSS PROFIT") AS GrossProfit FROM SCOTT."SalesData" GROUP BY ROLLUP ("PRODUCT LINE",Year, QRTR,
Month) HAVING Year IS NOT NULL
]]> </query> <groups>
<column name="PRODUCT LINE"
dataType="STRING"/> </groups>
<values> <column name="Revenue" dataType="NUMBER"
displayFormat="¤#, ##0.01_,_._$"/>
<column name="Quantity" dataType="NUMBER" displayFormat="#, ##0.00"/>
<column name="GrossProfit" dataType="NUMBER"
displayFormat="¤#, ##0.01_,_._$"/>
</values> </columnGroup>
</columnGroups> </report>
</reports>
- 69 -
Chapter 6: Sample reports
</rxjdbc>
The following screen cap demonstrates how the published RBI for this report looks when it has
been downloaded to an iPad:
The header for each section is the defined column under the <group> element, in this case,
Product Line. Each entry for Product Line lists the data for the three measures defined as
values: Revenue, Quantity, GrossProfit. Tap one of the measures, such as Revenue, to view the
KPI information for that measure:
- 70 -
Trends Example
Tap one of the defined row groups (Y for Year, Q for Quarter, or M for Month) to see how the
trends graphs change for each time series:
- 71 -
Chapter 6: Sample reports
- 72 -
Trends Example
Data Refresh Automation and
Bursting using RoambiScript
The RXJDBC connector helps the publisher of Roambi Analytics in extracting and for-
matting the data from the supported Databases. In order to automate the data refresh
of Roambi Reports, you can use the RoambiScript utility.
By combining the results from the RXJDBC connector and the API integration used in
RoambiScript, you can create powerful solutions that automate the data updates of
the Roambi reports.
In the following example we are going to create a template Roambi report that will
be used to generate a set of reports based on the parameters defined in the
RXJDBC connector. This scenario is typical to generate multiple roambi reports
when the content is unique based on some criteria that can be progmatically defined.
In our example we are going to generate roambi reports based on the sales
region defined as argument for the RXJDBC connector.
To make our sample work we need the following components: the RXJDBC jar file roambi-crosstab-export.jar
The RoambiScript utility roambi-api-cli.jar
A CSV file to define the Roambi Integration logic. This file will have the definition of the
Burst Arguments or parameters based on which the data extraction is going to happen.
roambi-integration.config sample:
BurstKey - Is the concept will use to extract data and create unique
Roambi reports based on that value
Template - Defines the Location and Name of Roambi Template that we'll use
to populate the new Roambi Report
sourceFileName - File Name to use to populate the Roambi Report.
DestinationFolder - Defines the path in the Roambi Business Library where
the new Roambi reports will be sored
RoambiFileName - Defines the name of the new Roambi File
Permissions - Defines the permissions we are going to assign to the new
Roambi File.
- 73 -
Data Refresh Automation and Bursting using RoambiScript
Creating the RXJDBC file to use a paramter to fileter data:
<rxjdbc> <dataSources>
<dataSource id="DS_1" type="JDBC">
<forName>com.microsoft.sqlserver.jdbc.SQLServerDriver</forName>
<connectionString>
jdbc:sqlserver://msdb2008.devqa.lan;databaseName=BigOLAPDatabase
</connectionString> <user>roambi</user>
<password>Mellmo123$</password>
</dataSource> </dataSources> <parameters> <parameter id="p2" name="Region" dataType="STRING" paramType="MULTIPLE_VALUE"
> </parameters> <reports> <report name="Sample with Parameters"
type="CROSSTAB"> <rowGroup> <column name="Region" label="Region" dataType="STRING"/>
<column name="Country" label="Country" dataType="STRING"/>
<column name="City" label="City" dataType="STRING"/> <column name="Order method" label="OrderMethod" dataType="STRING"
/> <column name="Retailer name" label="Retailer" dataType="STRING" />
</rowGroup> <columnGroups> <columnGroup> <query dataSource="DS_1">
<![CDATA[ SELECT [Product Line],[REGION],[RETAILER COUNTRY] as Country,[CITY],
[Order method], [Retailer name], SUM ([QUANTITY]) AS QTY, SUM
([REVENUE]) AS REVENUE, avg
([GROSS MARGIN]) AS Margin, SUM ([GROSS PROFIT]) AS
PROFIT FROM vw_Blink100KRecs WHERE [REGION]
IN (@p2) GROUP BY [Product Line],[REGION],[RETAILER COUNTRY],[CITY],
[Order method], [Retailer name] WITH ROLLUP HAVING [Product Line] IS NOT NULL
]]> </query> <groups> <column name="Product Line" label="Product Line"
dataType="STRING"/> </groups> <values> <column name="QTY" dataType="NUMBER" label="QTY" displayFormat="#,##0_,_."/>
- 74 -
Trends Example
<column name="PROFIT" dataType="NUMBER" label="Profit" displayFormat="¤#,##0.01_,_._$"/>
<column name="REVENUE" dataType="NUMBER" label="Revenue"
displayFormat="¤#,##0.01_,_._$"/> <column name="Margin" dataType="NUMBER" label="Margin"
displayFormat="##0.01%_,_."/> </values> </columnGroup> <columnGroup> <query dataSource="DS_1">
<![CDATA[
SELECT [Year],[REGION],[RETAILER COUNTRY] as Country,[CITY],
[Order method], [Retailer name], SUM (REVENUE) AS REVENUE, SUM ([PLANNED REVENUE]) AS PLANNED_REVENUE
FROM vw_Blink100KRecs WHERE [REGION]
IN (@p2) GROUP BY [Year],[REGION],[RETAILER COUNTRY],[CITY],
[Order method], [Retailer name] WITH ROLLUP HAVING [Year] IS NOT NULL
]]> </query> <groups> <column name="Year" label="Year" dataType="NUMBER" displayFormat="0"
/> </groups> <values> <column name="REVENUE" dataType="NUMBER" label="Revenue"
displayFormat="¤#,##0.01_,_._$"/> <column name="PLANNED_REVENUE" dataType="NUMBER"
label="Planned Rev" displayFormat="¤#, ##0.01_,_._$"/> </values> </columnGroup> </columnGroups> </report> </reports> </rxjdbc>
This rxjdbc file generates an excel file that looks like this:
- 75 -
Data Refresh Automation and Bursting using RoambiScript
With this source file we created a Template Roambi Report (sqlserverParamsTemplate)
and placed in the Rxjdbc Reports folder of our SAP BusinessObjects Roambi Cloud
Organization.
The Following PowerShell script, reads the Roambi Integration file and for each line
executes the rxjdbc connector to obtain the new data file, and the creates a new
Roambi Report based on the template and using the new source data.
cd "c:\roambi"
$options=Import-Csv ".\roambi-
integration.config" $nrecs=0 $nerrors=0
$nuploads=0
$npublish=0 $message_file=".\errorlog"
$date = Get-Date
write-host "Process started at: $date `n"
foreach ( $record in $options ) {
$region = $record.region
$sourceTemplate = $record.SourceRBI
$sourceFileName = $record.SourceFilename
- 76 -
Trends Example
$destFolderRBI = $record.DestFolder
$destRBI = $record.DestRBI $permission = $record.Permissions -replace
";","," $nrecs++
write-host "Processing $region `n"
java -jar roambi-crosstab-export.jar -p Region=$-
region -o $sourceFileName sampleParamter.rxjdbc
$npublish++
write-host "Creating/updating RBI file for $region
into $destfolderRBI SourceFile: $sourceFileName "
java -jar roambi-api-cli.jar -props="./myorg.properties "
publish-with-file --file=$sourceFileName --tem-
plate=$sourceTemplate --title=$destRBI --folder=$de-
stFolderRBI --permission=$permission 1>".\logfile"
if ( $LASTEXITCODE -gt 0 ) {
write-host "Publish for $report ..
failed.. Exiting `n"
$nerrors++
continue
}
}
$end_date = get-date write-host "Process finished at $end_date records read :
$nrecs Uploaded files: $nuploads Published reports: $npublish
Errors: $nerrors `n"
Sample content for the roambi-integration.config file:
- 77 -
Data Refresh Automation and Bursting using RoambiScript
regio- sourceRBI
source- destFolder
destRBI
n
FileName
Amer- /Rxjdbc /Sales
Sales_ Reports/sqlser- Americas.xlsx Reports/Amer-
icas verParamsTemplate icas Americas
North- /Rxjdbc North-
/Sales Sales_
ern Reports/sqlser-
Reports/North-
North-
erEurope.xlsx
Europe verParamsTemplate
ern Europe ernEurope
Asia /Rxjdbc /Sales
Sales_ Reports/sqlser-
AsiaPacific.xlsx
Reports/Asia
Pacific
AsiaPacific verParamsTemplate Pacific
South- /Rxjdbc South-
/Sales
ern Reports/sqlser-
Reports/South-
ernEurope.xlsx
Europe verParamsTemplate
ern Europe
- 78 -