Step by Step to Define a BI Publisher Report
2012-12-11 19:54
477 查看
这里演示一下,开发一个最简单BI Publisher Report的流程,下图为开发的基本流程.
![](http://img.my.csdn.net/uploads/201212/11/1355223345_5030.png)
Data Template(.xml) 作为Data Source,用于数据源的定义,以及取数的SQL语句;
Template(.rtf) 用于定义输出展示(Layout); (RTF:Rich Text Format)
1.首先创建一个Demo数据
2.Define Data Template
Date Template为XML文件,基本的格式如下图
![](http://img.my.csdn.net/uploads/201212/11/1355223912_5383.jpg)
<parameters><parameter>为传入参数项
<dataQuery><sqlStatement>为Report所执行的Query语句
<dataTrigger>用于指定beforeReport或afterReport,调用那个Function/Procedure
<dataStructure>为XML输出的结构
这里创建我们的Data Template文件
3.Create Data Definition & Associate with Data Template
XML Publisher Administrator -> Data Definitions -> Create Data Definition
![](http://img.my.csdn.net/uploads/201212/11/1355224637_1593.jpg)
这里的Code会被后边定义的Concurrent Program用到.
接下来,Data Template 'Add File',选择我们第二步定义的XML Data Template.
![](http://img.my.csdn.net/uploads/201212/11/1355225077_3311.jpg)
4.接下来切换到Application Developer职责下,定义一个新的Concurrent Program
![](http://img.my.csdn.net/uploads/201212/11/1355225350_3346.jpg)
注意:
1. Output format应该XML
2. Short Name和之前定义Data Definition中的Code完全一样
What is XDODTEXE used in the Executable section of Concurrent Program?
XDODTEXE is a BI Publisher Data Template Executable. The purpose of this executable is to identify data template file (.xml) and execute the data template to generate the raw xml data, that later can be used by BI Publisher formatting engine to format as as per the layout (RTF, PDF etc).
This executable will be used by all the BI Publisher reports (Concurrent Program) which are using Data Template to generate the xml data.
5.Concurrent Program Parameter
![](http://img.my.csdn.net/uploads/201212/11/1355225606_9668.jpg)
Note:Token is p_product_id. This is the bind parameter we have used in date template. For every bind parameter used in the data template, we have to define parameter in the concurrent program.
6.把这个新定义的Concurrent Program绑定到对应Request Group里
切换到System Admin职责,Security > Responsibility > Request,把刚定义好的Program绑定到一个Request Group里
![](http://img.my.csdn.net/uploads/201212/11/1355225781_1487.jpg)
7.运行Concurrent Program
![](http://img.my.csdn.net/uploads/201212/11/1355225859_8019.jpg)
8.Output
![](http://img.my.csdn.net/uploads/201212/11/1355225893_7590.jpg)
保存上面这个Output成XML格式,我们还需要基于这个xml output做RTF template,RTF Template为了让报表输出更友好,更灵活的展示,而不是只给用户一个XML结果。
9.下载安装XML Publisher Desktop
refer:/article/1397506.html
10.Define the RTF Template using the Generated Data XML
加载项 > 导入XML数据 导入第8步的output的xml文件
![](http://img.my.csdn.net/uploads/201212/11/1355226409_2231.jpg)
然后“插入” > “表向导”
![](http://img.my.csdn.net/uploads/201212/11/1355226531_7676.jpg)
掠过定义模板的几步,最终RTF模板文件样子大概如下,
![](http://img.my.csdn.net/uploads/201212/11/1355226603_7578.jpg)
11.Registering the Template with BI Publisher
XML Publisher Administrator -> Templates -> Create Template
![](http://img.my.csdn.net/uploads/201212/11/1355226705_5445.jpg)
12.Run the concurrent program to see the output
重新切换到Concurrent Program的定义Form上,更改输出的文件类型,然后文件输出的格式也就随之发生改变
![](http://img.my.csdn.net/uploads/201212/11/1355223345_5030.png)
Data Template(.xml) 作为Data Source,用于数据源的定义,以及取数的SQL语句;
Template(.rtf) 用于定义输出展示(Layout); (RTF:Rich Text Format)
1.首先创建一个Demo数据
CREATE TABLE demo_products ( product_code NUMBER, product_name VARCHAR2 (100)); INSERT INTO demo_products VALUES (569, 'Oracle Cost Management'); INSERT INTO demo_products VALUES (401, 'Oracle Inventory Management'); COMMIT;
2.Define Data Template
Date Template为XML文件,基本的格式如下图
![](http://img.my.csdn.net/uploads/201212/11/1355223912_5383.jpg)
<parameters><parameter>为传入参数项
<dataQuery><sqlStatement>为Report所执行的Query语句
<dataTrigger>用于指定beforeReport或afterReport,调用那个Function/Procedure
<dataStructure>为XML输出的结构
这里创建我们的Data Template文件
<?xml version="1.0" encoding="UTF-8"?> <dataTemplate name="demoProductsDT" description="Demo Products Details" version="1.0"> <parameters> <parameter name="p_product_id" datatype="number"/> </parameters> <dataQuery> <sqlStatement name="DQ"> <![CDATA[ SELECT product_code, product_name FROM demo_products WHERE product_code = NVL(:p_product_id,product_code) ]]> </sqlStatement> </dataQuery> <dataStructure> <group name="G_DP" source="DQ"> <element name="PRODUCT_CODE" value="product_code"/> <element name="PRODUCT_NAME" value="product_name"/> </group> </dataStructure> </dataTemplate>最后保存成ABC.xml
3.Create Data Definition & Associate with Data Template
XML Publisher Administrator -> Data Definitions -> Create Data Definition
![](http://img.my.csdn.net/uploads/201212/11/1355224637_1593.jpg)
这里的Code会被后边定义的Concurrent Program用到.
接下来,Data Template 'Add File',选择我们第二步定义的XML Data Template.
![](http://img.my.csdn.net/uploads/201212/11/1355225077_3311.jpg)
4.接下来切换到Application Developer职责下,定义一个新的Concurrent Program
![](http://img.my.csdn.net/uploads/201212/11/1355225350_3346.jpg)
注意:
1. Output format应该XML
2. Short Name和之前定义Data Definition中的Code完全一样
What is XDODTEXE used in the Executable section of Concurrent Program?
XDODTEXE is a BI Publisher Data Template Executable. The purpose of this executable is to identify data template file (.xml) and execute the data template to generate the raw xml data, that later can be used by BI Publisher formatting engine to format as as per the layout (RTF, PDF etc).
This executable will be used by all the BI Publisher reports (Concurrent Program) which are using Data Template to generate the xml data.
5.Concurrent Program Parameter
![](http://img.my.csdn.net/uploads/201212/11/1355225606_9668.jpg)
Note:Token is p_product_id. This is the bind parameter we have used in date template. For every bind parameter used in the data template, we have to define parameter in the concurrent program.
6.把这个新定义的Concurrent Program绑定到对应Request Group里
切换到System Admin职责,Security > Responsibility > Request,把刚定义好的Program绑定到一个Request Group里
![](http://img.my.csdn.net/uploads/201212/11/1355225781_1487.jpg)
7.运行Concurrent Program
![](http://img.my.csdn.net/uploads/201212/11/1355225859_8019.jpg)
8.Output
![](http://img.my.csdn.net/uploads/201212/11/1355225893_7590.jpg)
保存上面这个Output成XML格式,我们还需要基于这个xml output做RTF template,RTF Template为了让报表输出更友好,更灵活的展示,而不是只给用户一个XML结果。
9.下载安装XML Publisher Desktop
refer:/article/1397506.html
10.Define the RTF Template using the Generated Data XML
加载项 > 导入XML数据 导入第8步的output的xml文件
![](http://img.my.csdn.net/uploads/201212/11/1355226409_2231.jpg)
然后“插入” > “表向导”
![](http://img.my.csdn.net/uploads/201212/11/1355226531_7676.jpg)
掠过定义模板的几步,最终RTF模板文件样子大概如下,
![](http://img.my.csdn.net/uploads/201212/11/1355226603_7578.jpg)
11.Registering the Template with BI Publisher
XML Publisher Administrator -> Templates -> Create Template
![](http://img.my.csdn.net/uploads/201212/11/1355226705_5445.jpg)
12.Run the concurrent program to see the output
重新切换到Concurrent Program的定义Form上,更改输出的文件类型,然后文件输出的格式也就随之发生改变
![](http://img.my.csdn.net/uploads/201212/11/1355226817_5157.jpg)
相关文章推荐
- Step By Step guide to Read XML file in Java Using SAX Parser Example
- A Step-by-Step guide to create a simple FPM application using Feeder Class for FORM GUIBB
- SharePoint 2013 Step by Step—— How to Upload Multiple Documents in Document Library
- SQL Server BI Step by Step 2--- 使用SSIS进行简单的数据导入导出
- SharePoint 2013 Step by Step—— How to Upload Multiple Documents in Document Library
- SQL Server BI Step by Step SSIS 4 ---合并数据1
- SQL Server BI Step by Step 2--- 使用SSIS进行简单的数据导入导出
- Counter Hack Reloaded: A Step-by-Step Guide to Computer Attacks and Effective Defenses
- step by step 使用xml publisher desktop创建客户定制报告
- SQL Server BI Step by step 4-2 合并数据 LookUp组件和Script Component组件完成数据合并
- SQL Server BI Step by Step SSIS 5 --- 通过Email发送查询结果
- Restore Production Database to Development Platform A step-by-step example
- 【转】RDL(C) Report Design Step by Step 2: SubReport
- LINQ to SQL快速上手 step by step
- SQL Server BI Step by Step SSIS 3 --- 批量导入Excel表
- SQL Server BI Step by Step SSIS 3 --- 批量导入Excel表
- SQL Server BI Step by Step 系列教程
- SQL Server BI Step by Step SSIS 4 ---合并数据3
- How to avoid error "LNK2001 unresolved external" by using DEFINE_GUID
- Step by step to create a jQuery tabs plugin - 1