XML Publisher Int Questions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

Comparison between XML Publisher and Oracle Reports

In Oracle Reports, a single executable RDF file contains the data source, layout, business
logic, and the language-specific prompts. However, BI Publisher separates these
components into different layers. Following are some of the key limitations of Oracle
Reports that are overcome by BI Publisher:

Multiple layouts If you wish to publish the data from a report in more than one format—for
example, in both an Excel and HTML layout—then multiple RDF files have to be prepared. If
any bug fixes are required, fixes will have to be applied to both RDF files.
Multiple language Global implementations for a large organization usually require the
same report to be developed in multiple languages. In case of Oracle Reports, developers
will have to create different copies of the same RDF files and place them in the <application
top>/reports/<language> directory. In case of any bug fixes to data or any changes to
layout, all the copies of reports have to be amended.
Trivial tasks Even trivial tasks like changing the prompt or minor changes to the layout
require a developer in Oracle Reports. Using BI Publisher, these tasks can be implemented
by trained support staff or business analysts.
Distribution The distribution capabilities in the Oracle Reports tool within E-Business
Suite are very restrictive. To distribute the output of Oracle Reports, many companies
implementing E-Business Suite have to purchase third-party products or even build their
own in-house reports distribution framework. With BI Publisher, a mechanism
named bursting can automate distribution of the reports using industry standard delivery
protocols.
Securing the output When distributing the output of Oracle Reports in E-Business Suite,
it is not possible to secure the output using a password. BI Publisher facilitates password
protection of the documents.

Due to the previously listed limitations, the cost of customization and maintenance is very
high for Oracle Reports in Multilanguage implementations. In the case of BI Publisher, the
data layer, presentation layer, and the translation layer are separate. Additionally, BI
Publisher is based on open standards and thus overcomes many of the limitations of Oracle
Reports. In addressing some of the limitations of Oracle Reports and adopting open
standards, Oracle has allowed implementations to potentially reduce the overall cost of
build, customization, and ongoing maintenance of reports.
1. What is a data template in BI publisher?

Data template is an xml structure which have the queries to be run for a database so that output
can be generated in xml format,
this generated xml output is further applied on a layout template for the final required output.

What is the default output format of the report in BI publisher?


Answer:
The default output format defined during the layout template creation will be used
to generate the output,
the same can be modified during the request submission and it will overwrite the
one defined at layout template.

. 4): What are the various sections in the data template?

Ans: The various sections in the data template in BI publisher are as:
Parameter section
Lexical Section
Trigger Section
SQL statement section
Data Structure section

5): In BIP, how do you display the company logo in the report output?

Ans: In BIP, you can just copy and paste the logo (.gif, .jpg or any format) on the
header section of .rtf file.
Resize the log per the company standards.

What is a layout template in BI publisher?

Answer: Layout template defines how the user views the output,
basically it can be developed using Microsoft word document in rft (rich text
format) or Adobe pdf format.
The data output in xml format (from Data template) will be loaded in layout
template at run time and the required final output file is generated.

In how many ways you can display images in a BI Publisher Report?

Answer: The images can be displayed in below 5 ways:


Direct Insertion into RTF Template
URL Reference
OA_MEDIA directory reference
Image from BLOB datatype from database
Using UI Beans

How to submit the Layout from backend?

we must write a procedure for this using the below code

FND_REQUEST.ADD_LAYOUT (

TEMPLATE_APPL_NAME => 'application name',

TEMPLATE_CODE => 'your template code',

TEMPLATE_LANGUAGE => 'En',

TEMPLATE_TERRITORY => 'US',

OUTPUT_FORMAT => 'PDF'

);
How to submit the XML/BI report from Back end?

we must write a procedure for this using the below code

FND_REQUEST.ADD_LAYOUT (

TEMPLATE_APPL_NAME => 'application name',

TEMPLATE_CODE => 'your template code',

TEMPLATE_LANGUAGE => 'En',

TEMPLATE_TERRITORY => 'US',

OUTPUT_FORMAT => 'PDF'

);

FND_REQUEST.SUBMIT_REQUEST ('XDO', --application shot name


'XDOBURSTREP', -- concurrent program shaot
'',
'',
FALSE,
'N',
What are the various XML publisher tables?

Answer:

PER_GB_XDO_TEMPLATES
XDO_DS_DEFINITIONS_B
XDO_DS_DEFINITIONS_TL
XDO_DS_DEFINITIONS_VL
XDO_LOBS
XDO_TEMPLATES_B
XDO_TEMPLATES_TL
XDO_TEMPLATES_VL
XDO_TEMPLATE_FIELDS
XDO_TRANS_UNITS
XDO_TRANS_UNIT_PROPS
XDO_TRANS_UNIT_VALUES

How to get SYSDATE in the header section dynamically when we run the
report?

Answer: You cannot insert form fields in the Header section, but you can just
insert the code to achieve this. For example: insert this in the header section to
view the sysdate: You could format the date as you would like.

<?xdofx: sysdate(‘YYYY-MM-DD’)?>
How to calculate the running total in XMLP?

Answer:

<?xdoxslt:set_variable($_XDOCTX, ‘RTotVar’,
xdoxslt:get_variable($_XDOCTX, ‘RTotVar’) + ACCTD_AMT(This is column
name) )?>
<?xdoxslt:get_variable($_XDOCTX, ‘RTotVar’)?>

How to use Variables in XML publisher?

Answer: In XML publisher the declaration of variables can be done as:

Declaring the Variable R and Assigning the Values 4 to R

<?xdoxslt:set_variable($_XDOCTX, ‘R’, 4)?>

Get the Variable value


<?xdoxslt:get_variable($_XDOCTX, ‘R’)?>

This adds 5 to variable R and displays it


<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)
+5)?>

This subtracting 2 to varaible R and displays it


<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)-
2)?>

1) ‘IF ELSE’ condition in XML publisher


XML Publisher supports the common programming construct “if-then-else”. This is extremely
useful when you need to test a condition and conditionally show a result. For example:
IF X=0 THEN
Y=2

ELSE
Y=3

END IF
You can also nest these statements as follows:
IF X=0 THEN
Y=2

ELSE
IF X=1 THEN

Y=10
ELSE Y=100

END IF
Use the following syntax to construct an if-then-else statement in your RTF template:
<?xdofx:if element_condition then result1 else result2 end if?>
For example, the following statement tests the AMOUNT element value. If the value is greater
than 1000, show the word “Higher”; if it is less than 1000, show the word “Lower”; if it is equal
to 1000, show “Equal”:
<?xdofx:if AMOUNT > 1000 then 'Higher'
if AMOUNT < 1000 then 'Lower'
Else
'Equal'
end if?>

2) How to get SYSDATE in the header section dynamically when we run the
report
You cannot insert form fields in the Header section, but you can just insert the code to achieve
this. For example: insert this in the header section to view the sysdate: You could format the date
as you would like..
<?xdofx: sysdate(‘YYYY-MM-DD’)?>

3) What are the XML publisher tables?


PER_GB_XDO_TEMPLATES
XDO_DS_DEFINITIONS_B
XDO_DS_DEFINITIONS_TL
XDO_DS_DEFINITIONS_VL
XDO_LOBS
XDO_TEMPLATES_B
XDO_TEMPLATES_TL
XDO_TEMPLATES_VL
XDO_TEMPLATE_FIELDS
XDO_TRANS_UNITS
XDO_TRANS_UNIT_PROPS
XDO_TRANS_UNIT_VALUES

4) How to write a loop in rtf template design?


<? For-each:G_invoice_no?>
……………………..<? End for each?>

5) How to design sub templates in rtf layout?


Using following tags..
<? Template: template_name?>
This is Last Page
<? End template?>
6) How to call a header or footer?
Using this tag
<?call:header?> and <?call:footer?>
We have to use header section and footer section of the page.
7) How to break the page in specific condition?
<?split-by-page-break:?>
8) How to use section break?
<?for-each@section:G_CUSTOMER(This is group name)?>
9) How to create multi layouts in XMLP?
<?choose:?>
<?when:CF_CHOICE=’VENDOR’?>
Your template….
<?end when?>
<?when:CF_CHOICE=’INVOICE’?>
Your template….
<?end when?>
<?when:CF_CHOICE=’RECEIPT’?>
Your template….
<?end when?>
<?end choose?>

10) How to submit a layout in the backend?


we have to write a procedure for this using the below code
FND_REQUEST.ADD_LAYOUT ( TEMPLATE_APP
L_NAME => 'application name',
TEMPLATE_CODE => 'your template code',
TEMPLATE_LANGUAGE => 'En',
TEMPLATE_TERRITORY => 'US',
OUTPUT_FORMAT => 'PDF'
);

11) How to display the images in XMLP?


url:{'http://image location'}
For example, enter:

url:{'http://www.oracle.com/images/ora_log.gif'}
url:{'${OA_MEDIA}/image name'}

12) How to pass the page numbers in rtf layout?


<REPORT>
<PAGESTART>200<\PAGESTART>
....
</REPORT>
13) How to display last page is differently in XML Publisher Reports.
<?start@last-page-first:body?> <?end body?>

14)Hide a Field in Oracle XML Publisher

If You Want to Hide a Field:

<?if@column:FIELD!=' '?><?FIELD?><?end if?>

15) Displaying Page Totals in XML Publisher

Add the below tag in the loop (with in for-each)


<?add-page-total:’INV_AMT’;’INVOICE_AMT_PT’?>

Here INV_AMT is a field name and INVOICE_AMT_PT is a varable which


stores the page total.

To show the page total , add the below tag in the footer or Header
<?show-page-total: INVOICE_AMT_PT;’999G999D99’?>

XML Publisher Report Syntax


Sub Templates:
<?template:header?>
This is Last Page
<?end template?>

After that you can type in header or footer section,


<?call:header?>

Last Page:
Take the any one of the insert field type in the following syntax,
Suppose,
Field name : Last page body
Status bar: <?start@last-page-first:body?><?end body?>
This is last page

Page Break:
<?split-by-page-break:?>

Section Break:
<?for-each@section:G_CUSTOMER(This is group name)?>

Properties:
<?PASSWORD?>
In XML we have to write in,
<PASSWORD>welcome</PASSWORD>

Bar Code:
<?register-barcode-
vendor:'oracle.apps.xdo.template.rtf.util.barcoder.BarcodeUtil';'XMLPBarVend
or'?>

<?format-barcode:JOB;'code128a';'XMLPBarVendor'?>

Conditional Formating:
<?if:ACCTD_AMT(This is column name)<1000?><xsl:attribute
xdofo:ctx="block" or “incontext” name="font-weight">bold</xsl:attribute><?end
if?>
Incontext means: column level
Block means: row level

Multi Layout:
<?choose:?>

<?when:CF_CHOICE=’VENDOR’?>

<?end when?>

<?when:CF_CHOICE=’INVOICE’?>

<?end when?>

<?when:CF_CHOICE=’PO’?>
<?end when?>

<?end choose?>

Running Total:
<?xdoxslt:set_variable($_XDOCTX, 'RTotVar',
xdoxslt:get_variable($_XDOCTX, 'RTotVar') + ACCTD_AMT(This is
column name) )?><?xdoxslt:get_variable($_XDOCTX, 'RTotVar')?>

RTotVar means declare variable=0

Brought forward and carried Forward:

<xdofo:inline-total display-condition="exceptlast"
name="InvAmt"><xdofo:show-carry-forward name="InvAmt"
format="99G999G999D00" number-separators=",."/></xdofo:inline-
total>

Carried Forward:
<xdofo:inline-total display-condition="exceptfirst"
name="InvAmt"><xdofo:show-brought-forward name="InvAmt"
format="99G999G999D00" number-separators=",."/></xdofo:inline-
total>

Page Total:
<?add-page-total:’INV_AMT’;’INVOICE_AMT_PT’?>
<?show-page-total: INVOICE_AMT_PT;’999G999D99’?>
Repeating Headre:

For loop
<?for-each:G_CUSTOMER?>
<?end for-each?>

WATERMARK
PAGE LAYOUTWATERMARK (Word 2007)
Format  Background Printed Watermark (Word 2003)

TEXT FIELD
Developercontrolslegacy toolstext field

CONDITIONAL FORMATTING
The XSL code you need is:
<?if:TRANS_AMOUNT_REMAINING >1000?>
<xsl:attribute xdofo:ctx="block" name="background-color">red</xsl:attribute>
<?end if?>

BARCODE
Select File  Properties  Custom Tab
In the Name field enter: xdo-font.Free 3 of 9.normal.normal – notice the name of the font must
match the name of the font in the MSWord font drop down
In the Value field enter: truetype.c:\windows\fonts \FREE3OF9.ttf
SORTING:
<?sort:TRANS_AMOUNT;'ascending';data-type='text'?>

DIFFERENT LAST PAGE:To utilize this feature, you must create a section break in your template
to ensure the content of the final page is separated from the rest of the report and Insert the following
syntax on the final page:
<?start@last-page:body?>
<?end body?>
What is Bursting in XML Publisher?
Lets say we have information of 100 different Customer Invoices in a single report. In case of bursting,
XMLP engine upon a predefined criteria (Bursting criteria), helps generates single output file for each
customer invoice i.e. 100 report files for 100 Customer Invoices and emails each report output file
individually. We can even fax the output.
Bursting Criteria is nothing but a grouping criteria upon which report output gets splitted.
How to use Variables in XMLP
Declaring the Variable R and Assigning the Values 4 to R
<?xdoxslt:set_variable($_XDOCTX, ‘R’, 4)?>

Get the Variable value


<?xdoxslt:get_variable($_XDOCTX, ‘R’)?>

This adds 5 to variable R and displays it


<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)+5)?>

This subtracting 2 to varaible R and displays it

<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)-2)?>

Setting the Password for PDF File sent through XML Publisher

Open the rtf for which you want to set password and do the following things
1) Open the .rtf
2) Go to File – > Properties
Create a new custom property
a) Name :xdo-pdf-security
Type : text
Value :true
b) Name : xdo-pdf-open-password
Type : text
Value : password
<PASSWORD>welcome</PASSWORD>
If You Want to Hide a Field:

You might also like