1) Visual Representation of User Rating in XML Publisher
Oracle BI Publisher provides end users with a template-based, easy-to-use publishing solution. It is based on standard, well-known technologies and tools so users can take advantage of it easily. Users will have a set of familiar tools such as Adobe and Microsoft Word/Excel to create and maintain their own report formats based on data extracts. Users will then be able to send the report outputs to destinations of choice, email, fax, printers and others.
Oracle BI publisher can be easily integrated with Oracle Application.
Basic Requirement
We
need to create the visual representation of rating depending on their
performance appraisal so that user can compare them at a glance. The
business scenario is shown table below.
Pre-Requisite
Following are the pre-requisites for report to build and also for applicability of solution
- Employees must have Performance Rating entered in the system.
- We are creating the template using MS word Form Field method.
- Necessary data definitions are present/created in the system.
Solution Approach
The
Visual representation of User rating can be achieved in two different
ways. There may be other possible ways but here we will restrict our
discussion based on the creation of the template using MS word Form Field method.
1) Using MS-Word Auto Shape Feature
Here the Star shape is created using the MS-Word auto shape feature
a) Select the desired shape from Auto-Shape
<?for-each@shape:xdoxslt:foreach_number($_XDOCTX,1,RATING,1)?><?shape-offset-x:(position()-1)*25?><?end
for-each?>
Here "RATING" is nothing but the name of XML node of Data definition.
Here
for-each@shape command is used to execute the ‘for…loop’. Here initial
value of the loop is 1. The final value of the loop variable is the
value of ‘RATING’ variable. The loop variable will increment by 1.
When the Rating =0 ---- there will be no execution of the loop, so star shape will be displayed.
When the Rating =1 ---- the loop will execute for 1 time, so a single star will be displayed.
When the Rating =2 ---- the loop will execute for 2 time, so two star will be displayed.
When the Rating =3 ---- the loop will execute for 3 time, so two star will be displayed.
Sample output
2) Using External GIF Feature
The
MS Word Auto shape supports various shapes and as we know the shapes can
be changed by skewing them, stretching them, squashing them, etc. Now
if the customer wants to use an image which is not available in MS Word
Auto Shape then we have to use the following solution
When it is gif, the
code is not straight forward as it is in case of MS word Auto Shape. We
need to twist the code a bit to achieve our goal. The details are given
below.
here "inline wrap" and "end" are the form field.Details of these fields are mentioned below
Field | Form Field Entry |
inline wrap | <? for-each@inlines:xdoxslt:foreach_number($_XDOCTX,0,RATING,1)?> |
end | <? end for-each?> |
Here we have to use @inlines instead of @shape to get the image on a single row and then start the loop from 1.If the user rating is not entered in the system then it will considered as ‘0’ and no star will be displayed.When the Rating =1 only single star will be displayed, so loop needs to run from 1,1
When the Rating =3 the loop will run from 1 to 3, so 3 star will be displayed.
Conclusion:-
The
BI Publisher (formerly XML Publisher) supports Microsoft drawing, Shape
etc. One can use these objects to template and they will appear in
final PDF output.
The following AutoShapes categories are supported.
- Lines - straight, arrowed, connectors, curve, free form, and scribble
- Connectors - straight connectors only are supported. Curved connectors can be achieved by using a curved line and specifying the end styles to the line.
- Basic Shapes - all shapes are supported.
- Block arrows - all arrows are supported.
- Flowchart - all flowchart objects are supported.
Note:- The Key benefits of BI Publishers are
Þ Separation of presentation and data layer
Þ Cost reduction
Þ Control over Report Layout and High customization
Þ Different presentation tools.
Þ Output in the format of one’s choice.
Þ Tight integration with Oracle eBusiness Suite
Þ No additional third party tool.
--------------------------------------------------------------------------------------------------------------
Bursting Control File
2) How to Retrieve XML Publisher Report output
Oracle
XML Publisher is a template-based publishing solution delivered with
the Oracle E-Business Suite.One can Design and control how the report
outputs will be presented in separate template files,known as
template.At runtime, XML Publisher merges designed template files with
the report data to create a variety of outputs to meet a variety of
business needs.
Basic RequirementXML
Publisher report generated through a concurrent program. The output of
concurrent program merges the report data with the designed template.
Now our requirement is to get the concurrent output file and store the file in Database a clob/blob.
Pre-Requisite
Following are the pre-requisites for our solution approach
1) The XML Publisher report is configured and running as intended.
2) The user able to see the XML publisher report after successfull completion of Concurrent Program(OPP is running).
Solution Approach
First we will discuss about how we can see the concurrent program report output and the XML output
1) Report Output
The report can be viewed by clicking on the output button of the concurrent program.
Note:-
If the output is not comming or comming as XML, then it may be because
OPP is not running. Please get in touch with Database administrator
team.Please ensure that
there is no error in generating the data in XML format.
2) XML data Output
In
XML Publisher data is formated in XML.To view the XML data generated
via concurrent program we need to click on the Diagnostics button.(As
shown below)
The XML output report/document are stored in $APPLCSF/$APPLOUT . The output file name is in the following format
<CONC_SHORT_NAME>_<REQUEST_ID>_<NO>.<Extension>
CONC_SHORT_NAME = This is the short name of concurrent program,given during the creation of concurrent program
REQUEST_ID = Request_id of the concurrent program that generates the file
NO = Counter
Extension = Extension of the file can be RTF/PDF/HTML depends on output format chosen.
Now read the file/copy the file to store it in database blob/clob column. alternately file can be sent via email.
Disclaimer:-
This is a knowledge sharing site. This topic talks about a custom
solution. Oracle may not provide you a support for any data corruption
or any
other problem in your custom code/problem arises because of the custom
code. The author is not responsible for any kind of system/data problem
appears because of usages of this code.Reader/implementer must do it on
his/her own risk/responsibility.
-------------------------------------------------------------------------------------------------------------
3) How to Use XML Bursting to Send XML Report via Email
Oracle Bursting Mechanism
enables us to deliver a single XML Publisher report/letter to multiple
destinations simultaneously.One can create a single report/letter , then
send it in any format (e.g., PDF or HTML) to multiple
destinations(email ids).
There are two kind of bursting mechanism available within BI publisher
There are two kind of bursting mechanism available within BI publisher
1) Control File Base:- Integrated with EBS
2) Delivery SQL based:- Part of Enterprise release.All delivery, template, output format, locale and other details define through delivery SQL Query. Enterprise Edition assume that this information is stored in data base. The process create the XML file out if this query and the delivery xml file works as control file.
2) Delivery SQL based:- Part of Enterprise release.All delivery, template, output format, locale and other details define through delivery SQL Query. Enterprise Edition assume that this information is stored in data base. The process create the XML file out if this query and the delivery xml file works as control file.
Here we will discuss about the "Control File Base" mechanism.
Basic Requirement
Our
basic requirement is to send grade change(promotion) letter to the
supervisor of the employee.This needs to be achieved using XML Publisher
Bursting Mechanism.
Pre-Requisite
Following are the pre-requisites for report to build and also for applicability of solution
- We are creating the template using MS word Form Field method.
Solution Approach
To achieve this we will first understand the different aspects and terminology used in XML Publisher
Data Definition
The data definition
is registration the source of the data that will be merged with template
layout to create published report/letter.
Navigation:- XML Publisher Administrator àData DefinitionsàClick on Create Data Definition
Bursting Control File
Bursting control file is a XML file that contains following information
Control file is xml file (.xml) and contains information such as
-
Level in XML data that you wish to burst on.
-
Email address From, To, subject etc
-
Message we want to send
-
Busted file type (PDF/Excel/HTML etc…), file name, Filter Conditions etc...
-
Location of Template which will be used to generate output busted file.
Now to understand the bursting
control file we will take an example of our sample XML data file(that
will be created via pl/sql procedure)
There are restriction while creating bursting control file
a) The server ip address and port can not be dynamic. It must be hard coded in the file.
b) To define the location follow the following steps
<xapi:template type="rtf" location="/ora_shared/R12/DBXX/apps/apps_st/comn/temp/Test.rtf" /> ##
Navigation:- XML Publisher Administrator àAdministration
Go to Propertiesà Temporary Directory and copy the location that location will be location of our rtf template
##=> Sometime the above mentioned process may give you bursting error while running concurrent program, then use the alternative method mentioned below.
Alternatively the following can be used
location="xdo://<output of the following query>/?getSource=true"
<output of the following query> :-
select
lt
.
application_short_name ||
'.'
|| lt
.
template_code ||
'.'
|| lt
.
default_language ||
'.'
|| lt
.
default_territory
as
burst_template_xdo_location
from
apps
.
xdo_templates_b lt
where
lt
.
template_code ='<Template Code>';
--
here value <Template Code> is 'XX_TEST_XML_DT'
Now Search for the newly created Data Definition and click on the hyperlink the search results.Now attach the Bursting control file with the data definition.
Navigation:- XML Publisher Administrator àData DefinitionsàSearch for newly Created Data Definition
Template
Rich Text Format (RTF) is a
specification used by common word processing applications, such as
Microsoft Word.XML Publisher’s RTF Template Parser converts documents
saved as the RTF file type to XSL-FO.Therefore we can create report
designs using your standard word processing application’s design
features and XML Publisher will recognize and maintain the design.
Now create a RTF using basic Form Field Method(Using Microsoft Word’s form field feature).
once the rtf is created, save it local. Now create a data template(follow the navigation mentioned above).
Note:-Now take the temp location path(noted while discussing Bursting Control file) and put your rtf file also in that location.
Concurrent Program
Define the concurrent program. The concurrent program used in XML publisher report has following restrictions.
1) The concurrent Short name must match with the short name of the data definition
2) The Output format of the concurrent program will be "XML"
Concurrent Executable Package
We need to create
a database package that will generate the XML data file which will be
used to feed the data in temaplate and generate letter.
Here our code will retrive the all the
employee under a particular supervisor and send it to him with the grade
information letter.
Now write the cursor that will retrieve all the employee having valid
grade for a particular supervisor(person_id came as input)
Now our cursors are ready, we have to create xml and need to write in the ourput of the concurrent program.
Please refer your designed xml based on which the bursting was designed and repeat/close any element as shown the pic below.
Once the xml is prepared , then we need to call the seeded bursting program,so that the generated letter can reach to supervisor
Now compile the package and run the concurrent program.
Note:- 1) As we mentioned earlier the bursting will happen from /ListOfEmpDtls/EmpDtls.
create your xml accordingly.
LOG file writing:-
FND_FILE.PUT_LINE(FND_FILE.LOG, 'ABCD in Log File');
OUTPUT file writing:-
FND_FILE.PUT_LINE(FND_FILE.OUTPUT, 'ABCD in Out File');
3) Bursting program may goes into error, in that case will suggest you to raise a SR with Oracle.
4) Sample rtf file,code,bursting control file is attached for reference
References:- 1) https://metalink.oracle.com
2) Oracle XML Publishern( Release 12) B31410-01
Disclaimer:-
This is a knowledge sharing site. This topic talks about a custom
solution. Oracle may not provide you a support for any data corruption
or any
other problem in your custom code/problem arises because of the custom
code. The author is not responsible for any kind of system/data problem
appears because of usages of this code.Reader/implementer must do it on
his/her own risk/responsibility.