Sei sulla pagina 1di 13

BI Publisher IDE

&
BI Publisher OAF

1
Table of Contents
BI PUBLISHER IDE 3
SAMPLE XML 4
ELEMENT DEFINITION 5
STEPS TO RUN THE PROGRAM 8
11I PL/SQL SPECIFICS 11

2
BI Publisher IDE

The BI Publisher IDE and OAF is a tool that was developed that allows developers to write and run
reports locally from there PC without having to login into eBusiness Suite, OBIEE, JDEdwards, Peoplesoft,
Oracle Portal, Webcenter, etc.

The tool increases the speed of development because a developer can now connect to any environment
(dev, test, production), any disparate data sources or erp system. This functionality also comes with the
added benefit of not having to create or key any config, copy files, wait for concurrent manager requests,
etc.

The tool also fills some gaps of other reporting tools such as reports6i/9i or disco (discoverer). For
instance, you can do batch testing for a single report or whole report set. Ad-hoc pl/sql is an option as
well, which allows a developer to setup an environment, stage data, etc. The ability to do pl/sql on the
fly is a major plus for any reporting tool. This allows a developer to not have to worry about hard-coding
in their report, because everything resides in the config and not the code.

Other enhancements are that it allows developers to do what they cannot locally:

1. eText
2. Bursting
3. OA Framework integration
a. BIP in the OA Framework part I:
http://bipublisher.blogspot.com/2008/03/bi-publisher-bip-in-oa-framework-part-1.html
b. BIP in the OA Framework part deux:
http://bipublisher.blogspot.com/2008/03/bi-publisher-bip-in-oa-framework-part.html

3
SAMPLE XML
<?xml version="1.0" encoding="UTF-8"?>
<REPORTS>
<PRIMARY_REPORT>CORPORATE</PRIMARY_REPORT>
<RUN_ALL>FALSE</RUN_ALL>
<REPORT>
<NAME>CORPORATE</NAME>
<LOCATION>d:\\</LOCATION>
<TEMPLATE_TYPE>ETEXT</TEMPLATE_TYPE>
<FORMAT_TEMPLATE_NAME>corporateDataTemplate.rtf</FORMAT_TEMPLATE_NAME>
<DATA_TEMPLATE_NAME>corporateDataTemplate.xml</DATA_TEMPLATE_NAME>
<OUTPUT_FILE_NAME>corporate_example</OUTPUT_FILE_NAME>
<OUTPUT_FILE_FORMAT>ETEXT</OUTPUT_FILE_FORMAT>
<JDBC_CONNECTION_STRING>jdbc:oracle:thin:@db101:1535:RADV</JDBC_CONNECTION_STRING>
<USER_NAME>apps</USER_NAME>
<PASSWORD>apps</PASSWORD>
<APPS_INITIALIZE value="165">Y</APPS_INITIALIZE>
<PARAMETERS>
<PARAMETER name="P_DEPT" value="10"/>
<PARAMETER name=" P_EMP_ID" value="1"/>
</PARAMETERS>
</REPORT>
<REPORT>
<NAME>TDS</NAME>
<LOCATION>d:\\</LOCATION>
<TEMPLATE_TYPE>PPT</TEMPLATE_TYPE>
<FORMAT_TEMPLATE_NAME>employeeLayoutTemplate.rtf</FORMAT_TEMPLATE_NAME>
<DATA_TEMPLATE_NAME>employeePowderDataTemplate.xml</DATA_TEMPLATE_NAME>
<OUTPUT_FILE_NAME>employee_example</OUTPUT_FILE_NAME>
<OUTPUT_FILE_FORMAT>EXCEL</OUTPUT_FILE_FORMAT>
<JDBC_CONNECTION_STRING>jdbc:oracle:thin:@db101:1535:RADV</JDBC_CONNECTION_STRING>
<USER_NAME>apps</USER_NAME>
<PASSWORD>apps</PASSWORD>
<APPS_INITIALIZE value="165">Y</APPS_INITIALIZE>
<PARAMETERS>
<PARAMETER name="P_EMP_ID" value="1"/>
</PARAMETERS>
<PLSQL>
<![CDATA[

4
DECLARE
fnd_user_id number;
fnd_resp_id number;
fnd_appl_id number;
BEGIN

--get user_id
select user_id
into fnd_user_id
from fnd_user
where user_name = 'IWW'
;

select application_id, responsibility_id


into fnd_appl_id, fnd_resp_id
from apps.FND_RESPONSIBILITY_VL
where RESPONSIBILITY_NAME = 'Oracle OPM All'
;

--IWW Set your profile for oracle standard debugging, let the good times role
FND_GLOBAL.APPS_INITIALIZE(fnd_user_id, fnd_resp_id, fnd_appl_id);
END;
]]>
</PLSQL>
</REPORT>
</REPORTS>

Element Definition

<REPORTS>
<PRIMARY_REPORT>CORPORATE</PRIMARY_REPORT>
1. The program will take the primary report and find the NAME node and apply the configuration for BI Publisher

<RUN_ALL>FALSE</RUN_ALL>

5
2. When run all is set to TRUE the BI Publisher program will run apply ALL of the configurations for BI Publisher regardless of what’s specified in the
primary_report node.

<REPORT>
<NAME>CORPORATE</NAME>
3. The name node links to the primary report

<LOCATION>D:\\</LOCATION>
4. The location where transformations will occur
a. XML file generated by a data template
b. XSL File generated by a format template
c. Final output (txt, csv, xml, ppt, html, rtf, pdf, excel, etc)

<TEMPLATE_TYPE>ETEXT</TEMPLATE_TYPE>
5. The type of templates that can be run are:
a. RTF
Required Fields
1. FORMAT_TEMPLATE_NAME
2. DATA_TEMPLATE_NAME
3. OUTPUT_FILE_NAME
4. OUTPUT_FILE_FORMAT
5. JDBC_CONNECTION_STRING
6. USER_NAME
7. PASSWORD
b. ETEXT
Required Fields
1. FORMAT_TEMPLATE_NAME
2. DATA_TEMPLATE_NAME
3. OUTPUT_FILE_NAME
4. OUTPUT_FILE_FORMAT
5. JDBC_CONNECTION_STRING
6. USER_NAME
7. PASSWORD
c. BURST
Required Fields
1. FORMAT_TEMPLATE_NAME – Note: This is your burst config file
2. DATA_TEMPLATE_NAME
3. OUTPUT_FILE_NAME
4. JDBC_CONNECTION_STRING
5. USER_NAME
6. PASSWORD
d. TRANSFORM_EXCEL
Required Fields

6
1. OUTPUT_FILE_NAME

<FORMAT_TEMPLATE_NAME>corporateFormatTemplate.rtf</FORMAT_TEMPLATE_NAME>
6. Format Template to be run and transformed

<DATA_TEMPLATE_NAME>corporateDataTemplate.xml</DATA_TEMPLATE_NAME>
7. Data Template to be run and to generate the xml

<OUTPUT_FILE_NAME>corporate_example</OUTPUT_FILE_NAME>
8. Outfile name to be generated. Do not put an extension on the end. Also, for transform excel this field is used to find the excel document to be
transformed.

<OUTPUT_FILE_FORMAT>ETEXT</OUTPUT_FILE_FORMAT>
9. Final output format
a. PPT
b. RTF
c. PDF
d. ETEXT (Which is either Length or Delimited flat file or can be used to generate xml)
e. FLEX (not supported yet by this program)
f. EXCEL
g. HTML
h. XML (Template type TRANSFORM_EXCEL)
i. CSV (Template type TRANSFORM_EXCEL)
j. XDOXML (Template type TRANSFORM_EXCEL)

<JDBC_CONNECTION_STRING>jdbc:oracle:thin:@db101:1535:RADV </JDBC_CONNECTION_STRING>
10. Used by data template. Note to find the port for the database open up telnet session and type: tnsping [DB_NAME]

<USER_NAME>apps</USER_NAME>
<PASSWORD>apps</PASSWORD>
11. User name and password to connect to the database.

<APPS_INITIALIZE value="165">Y</APPS_INITIALIZE>
12. Apps initialize – if you have Y an apps initialize will be preformed, using the value of 165 or whatever you specify.

<PARAMETERS>
<PARAMETER name="P_DEPT" value="10"/>
<PARAMETER name=" P_EMP_ID" value="1"/>
</PARAMETERS>
13. These are the parameters that are passed to the data template. The name is the exact “name” of the parameter in the data template. The value is the
data that will be assigned to that parameter.

7
<PLSQL>
<![CDATA[
DECLARE
fnd_user_id number;
fnd_resp_id number;
fnd_appl_id number;
BEGIN

--get user_id
select user_id
into fnd_user_id
from fnd_user
where user_name = 'IWW'
;

select application_id, responsibility_id


into fnd_appl_id, fnd_resp_id
from apps.FND_RESPONSIBILITY_VL
where RESPONSIBILITY_NAME = 'Oracle OPM All'
;

--IWW Set your profile for oracle standard debugging, let the good times role
FND_GLOBAL.APPS_INITIALIZE(fnd_user_id, fnd_resp_id, fnd_appl_id);
END;
]]>
</PLSQL>
14. Anything in the cdata tags will be processed as pl/sql before the data template is run. This will allow you the ability to infinitely configure the database
environment and session.

Steps to run the program

1. Make sure xmlTemplateConfig.xml is located on your c: drive. However, you can modify the code to change this if you would like.
2. Make sure data template and format template are located on your c: drive.
3. Click on the XMLPublisherUtility, right click, select debug or run.

8
9
5. View the debug window and fix any issues with your data template or format template

10
11i PL/SQL Specifics

--**************************************************************************
--* PROCEDURE default_template()
--* Author Date Proj # Description
--* -------------- ----------- ------ ---------------------------------
--* I.Wiggins 08.JAN.2007 Initial Code. invoice
--* locates a template and defaults it...
--**************************************************************************
procedure default_template ( p_concurrent_program_name in varchar2
, p_application_short_name in varchar2
, x_return_status out varchar2
, x_msg_data out varchar2
)
is
l_layout boolean;
l_xdo_templates_vl xdo_templates_vl%rowtype;
l_application_short_name varchar2(30);
l_output_file_type varchar2(30);

procedure log_error (p_message IN VARCHAR2) is


BEGIN
x_return_status := fnd_api.g_ret_sts_error;
fnd_message.set_name('FND','FLEX-USER DEFINED ERROR');
fnd_message.set_token('MSG', p_message);
fnd_msg_pub.ADD;
x_msg_data := FND_MSG_PUB.GET(FND_MSG_PUB.G_LAST,FND_API.G_FALSE);
END log_error;
begin
------------------------------------------
--IWW this should default a template for any
--given concurrent program as long as
--the output type is set to xml and the
--neccessary xml publisher config is done.
--you may need to add a parameter of output
--type.
------------------------------------------

--fyi: messages will be on the stack...

11
x_return_status := fnd_api.g_ret_sts_success;

--Only try to associate templates for valspar code....


if l_application_short_name <> 'VCA' then
return;
end if;

--verfiy concurrent program config


--output type needs to be xml in order to default a template
begin
select OUTPUT_FILE_TYPE
into l_output_file_type
from fnd_concurrent_programs
where CONCURRENT_PROGRAM_NAME = p_concurrent_program_name
and OUTPUT_FILE_TYPE = 'XML';
exception when others then
return; --not an xml document
end;

--default the template, done deal..


Begin
select *
into l_xdo_templates_vl
from xdo_templates_vl
where APPLICATION_SHORT_NAME = p_application_short_name
and template_code = p_concurrent_program_name;

l_layout := fnd_request.add_layout (
template_appl_name => l_xdo_templates_vl.application_short_name,
template_code => l_xdo_templates_vl.template_code ,
template_language => l_xdo_templates_vl.default_language,
template_territory => l_xdo_templates_vl.default_territory,
output_format => 'PDF'
);

if not l_layout then


log_error ('Unable to associate template for concurrent prorgram: '||p_concurrent_program_name);
end if;
exception
when too_many_rows then

12
log_error ('More than one template associated for concurrent program:
'||p_concurrent_program_name);
when no_data_found then
log_error ('Template not found for concurrent program: '||p_concurrent_program_name);
end;
end default_template;

13

Potrebbero piacerti anche