Infolinks

Showing posts sorted by relevance for query xml. Sort by date Show all posts
Showing posts sorted by relevance for query xml. Sort by date Show all posts

Saturday, 21 July 2012

XML Publisher-report-from-rdf

XML Publisher Concurrent program - XMLP

In this blog post I will detail the step by step process of developing a XML publisher report using an RDF type report concurrent program in oracle apps.

The XML publisher windows desktop patch has to be applied in you PC before developing the XML template

Overview


•          XML Publisher is a template based publishing solution by Oracle which allows us to create visually rich documents with numerous formatting options. (Available in ver.11.5.10)
•          XML Publisher makes use of the data retrieved from Reports 6i.
•          The template, designed by the developer is used as the layout for the report.
•          The template will contain the layout with tags that are mapped to the data model of the report.
•          At runtime the data from reports is merged onto the designed template to produce the final report.


Here it goes:
Before we see the step by step process, I will brief the main points:

       ·   Create a report and register it as Concurrent Program of type XML
       ·   Build a Data Definition & XML Template using XML Publisher
       ·   Create a relation between the XML Template & Concurrent Program



Develop a RDF Report concurrent program in oracle apps:

1.      Develop a RDF report and register it in oracle apps

·         Develop the Report (Report Name: Sample XML Report) Data model
·         Develop the Report Layout model
·         Define the RDF executable



·         Define the concurrent program

·         Assign this concurrent program to a responsibility

The RDF report concurrent program is complete, now we have to get the XML data file from the concurrent program and create the .xml file:

2.      Run the report from a responsibility after changing the output format of the concurrent program to XML.

·         Go to the concurrent program definition and change the output format of the concurrent program





·         Run the concurrent program





·         The XML data output of the concurrent program will look like this pic below

If you map the oracle report data model and the xml data file. It will look like this

·         Save this XML data file as filename.xml say FNDWRR.xml

Create the .rtf file. Before you do this, check whether XML publisher desktop patch is applied in your local machine. check the blog post for installing the XML publisher desktop patch: 
http://oracleapps4u.blogspot.com/2011/04/installing-oracle-bi-publisher-xml.html

3.       Load the XML data file to MS Word and save it as .rtf file


·         Load the XML file (FNDWRR.xml) into MS-Word



·         Using table wizard, form the template layout









If you map the xml data file to the word template. It will look like this
We can develop the template layout with out the table wizard, by marking up the text form fields with the corresponding tags. 

11. Insert a Text Form Field from the Forms tool bar (ViewàToolbarsà Forms)
2. Place the Text Form field in a position where you desire.
3. Double click on the form fieldàClick on the Add Help Text button.
4. Go to the Status Bar Tab and type your tag in the text field available.

It will look like this




·         Save the file in .rtf extension, say XXSMPRTF.rtf



A Bit of XML publisher

1.      Go to “XML Publisher Administrator” Responsibility and define the XML Data Definition & XML Template. Also create a relation between the XML Template and the concurrent program.



·         Create the data definition
Define the values as below:
Name: Sample XMLP Report – XML Output (Any Unique name in the Application)
Application: Receivables (Any Application)
Code: XXSMPRPT (This should be same as the Concurrent program short name)
Start Date: Leave default (sysdate)


  
·         Create the template
Define the values as below:
Name: Sample XMPL Report Template (Any Unique name in the application)
Application: Receivables (Any Application)
Data Definition: Sample XMLP Report – XML Output (This should be same as the XMLP Data Definition Name)
Code: XXSMPTMP (Any Unique name)
Start Date: Leave Default (sysdate)
Type: RTF
Default Output Type: PDF (As your wish)



·         Create relation ship between the XML Template and the concurrent program

In the XML Data Definition the Data Definition code should be same as the concurrent program short name. As the XML Template has the XML Data Definition name, this actually creates a relationship between the XML Template and the concurrent program.

Concurrent program
XML Data Definition
XML Template
Code: XXSMPRPT
Code: XXSMPRPT


Name: Sample XMLP Report – XML Output

Name: Sample XMLP Report – XML Output


·         Now run the concurrent program. The program output will be displayed as PDF file.




Wednesday, 4 July 2012

XML Publisher Concurrent Program - XMLP

 XML Publisher Concurrent Program - XMLP

In this article I have listed a step by step demo of XML Publisher as a Concurrent Program in Oracle Apps.

I think it is very important that you get a feel of XML Publisher, as this will become the reporting tool in Fusion [assuming XMLP can become as powerful as Oracle Report in the given time].

Before I explain the steps in details with screenshots, let me brief them:-
a.    Create a report and register it as Concurrent Program of type XML
b.    Build a Data Definition & XML Template using XML Publisher.
c.    Create a relation between XML Template & Concurrent Program.

Sounds simple, it is indeed, but devil lies in detail. Hence read the below carefully.
I have provided the source code with installation instructions for you to try this. Please note to try this you need 11.5.10 environment.

Now lets get into the details….Step by Step…..
1. Create a table xx_emp_demo and insert two records into it.
create table xx_managers ( manager_no integer, manager_name varchar2(200) ) ;
insert into xx_managers ( manager_no, manager_name ) values ( 1000, 'Anil Passi') ;
insert into xx_managers ( manager_no, manager_name ) values ( 1001, 'Martin') ;
commit;

2. Next you need a concurrent program that spit out an XML file to the output of the concurrent program. Such concurrent program can be of type SQL or PL/SQL or Oracle Report or any other supportable type, provided it can produce a XML output.
Hence in this case, we will develop a Report that has all the columns from table xx_managers
Create a plain default Oracle Report using wizard in Oracle Reports 6i.
This can be done using wizard with SQL “select * from xx_managers”

Image
Above picture shows the report output in Reports 6i preview

Do not change anything in DESFORMAT, as Concurrent Manager will take care of passing XML to this. Hence XML Publisher will be fed an XML output by the concurrent manager itself.

3. Add three user parameters P_CONC_REQUEST_ID,  P_RESPONSIBILITY_ID, P_USER_ID
Image
These parameters will make it possible to run a report as concurrent program.
Save the above RDF as XX_MANAGERS.rdf

4. FTP XX_MANAGERS.rdf  to $AR_TOP/reports/US
Silly it is, but for demo I will use standard Application [forgive me, but I am making it easier for you to run the source code].

5. Create Concurrent program executable for XMLP report, as if it is a normal report
Image


6. Create a concurrent program for the executable. Note that I have kept the shortname and the program name both as XX_MANAGERS.
IMPORTANT:- Note that format is XML
Image


7. Register this program with Receivables request group.
DECLARE
BEGIN
FND_PROGRAM.add_to_group
    (
     PROGRAM_SHORT_NAME  =>'XX_MANAGERS'
    ,PROGRAM_APPLICATION =>'AR'
    ,REQUEST_GROUP       => 'Receivables All'
    ,GROUP_APPLICATION   =>'AR'
    ) ;  
  commit;
exception
    when others then
           dbms_output.put_line('Object already exists');
END ;
/

8. Run the report and you will see an xml output appearing. Save the output as XX_MANAGERS_241106.xml on your computer. You will need to use menu /Tool/Copy to open this XML output in browser, and then save it as XX_MANAGERS_241106.xml on your PC.
Image


NOW THE TIME TO DO XML PUBLISHER BIT…

9. Install this XML Publisher Desktop software on your pc, ensuring that you have MS-Word installed(for this demo)
The XML Builder Desktop Patch for Word is Patch Number: 4561835
This software can be downloaded from
http://updates.oracle.com/download/4561835.html

This is a tool given by Oracle[Desktop XML Publisher] that will read any XML file, will create the fields automatically.


10. Open MS Word after installing as per step 9, and you will now see something similar to below in Microsoft Word

Now in MS Word, click on “Load XML Data” and select file XX_MANAGERS_241106.xml that was created in Step 8.
Image


Image



11. Now, click on Insert/Table Form
And then drag and drop “List G Manager No” within the template section and click on OK.
Image


Effectively by doing these steps, you have just created a Layout for the report in XML Publisher. The layout will look like this [as below].
Image


Save this MSWord file as MANAGER_XML_TEMPLATE.rtf

By clicking on Preview, you will see the output as below
Image

12. Now, lets do the real bit in attaching the Concurrent Program definition to XML
Publisher. Logon to responsibility “XML Publisher Administrator”.
Image

Click on “Data Definition” menu as above…so that we can create the XMLs source data Definition. Effectively we are saying that output of the Concurrent program becomes the data definition for XMLP.

Lets define the value in below fields
Name : XX_MANAGERS
Application : Receivables
Code : XX_MANAGERS  [Note: This is the short name of the Concurrent program]
Start Date : Leave it to default Sysdate
Click on “Apply”
Image


13. Now lets define a template as below for XML Publisher.

For doing so, click on Templates Tab. We need to create a Template for the data-definition of previous step.
Image


Name : XX_MANAGERS  [this is the name of the template]
Code : XX_MANAGERS  [short name of conc program]
Application : Receivables
Data Definition : XX_MANAGERS [the one that we created in prior step 12]
Start Date: : Leave this default.
Type : RTF
Click on browse and select the RTF file[MANAGER_XML_TEMPLATE.rtf] that you had saved in Step 11.
xmlp_A_14



Click on Apply, and you will get the below record.
Image


14. Navigate to “Receivables Manager” and submit report XX_MANAGERS.
Click on Output button to see the report as pasted below.
Image

Tuesday, 15 May 2012

XML-INFO OF TAGS

Template Builder – XMLP Directives
• for-each loop
• data fields
• page header/footer
• page numbering
• sorting
• page breaks
• calculated fields
• extended functions
• conditional logic
• images/logos
• Dynamic data columns
• Rows per page
• Last Page Only content
• Re-grouping xml data
• Cell highlighting
• Page totals

====
for-each loop
• Define groups to notify XML Publisher to loop through repeating information
• Insert the following tag before the first element
<?for-each:XML group element tag name?>
• Insert the following tag after the last element
<?end for-each?>
• E.g. The XML group element tag name “G_INVOICE” for recurring invoice
information
<?for-each:G_INVOICE?>
……invoice lines……
<?end for-each?>
==
Data fields
• Placeholders map the template field to the XML data field
• Syntax - <?XML element tag name?>
• Placeholder must match XML element tag name exactly
• Case sensitive
• E.g. The placeholder <?TRX_NUMBER?> identifies the Invoice Number
====
Page Header/Footer
• Enclose the body area of the report within the following tags
<?start:body?>
<?end body?>
• Elements occurring before the <?start:body?> tag compose the header
• Elements occurring after the <?end body?> tag compose the footer
===
Page Numbering
• Use Microsoft Word page numbering
• From Insert menu, select Page Numbers
• Select the position, alignment and format as desired
===
Sorting
• Insert sort tag within the group
• <?sort:element name?>, for example to sort by transaction number
– Enter the following after the <?for-each:G_INVOICE?>
<?sort:trx_number?>
• No end tag
• Sort on multiple elements possible, use multiple sort tags
– Example: <?sort:trx_number?><?sort:trx_date?>
• Sort on calculated fields supported
====
Additional Sorting
• Sort order descending
• Data type sorting
– Number
– Date
• Separated by semi-colon (;)
• <?sort:trx_number;
data-type=‘number’;
order=‘descending’?>
===
Page Breaks
• Just before the <?end for-each?> tag either…
– Insert a Microsoft Page Break
• Insert->Break->Page Break
-or-
• <Ctrl> + <Enter>
– Use XML Publisher directive
• <?split-by-page-break:?>
• This avoids extra blank page at the end of report
====
Calculated Fields
• Use field names and operand(s)
– + - Addition
– - - Minus
– * - Multiplication
– / - Division
• Example <?field1 + field2?>
• Not required to be in form field
===
Extended functions
• Some SQL functions can be used in template
 RPAD, LPAD, REPLACE
 INSTR, SUBSTR, LENGTH
 DECODE
 SYSDATE
 TO_NUMBER, TO_CHAR
 UPPER, LOWER
 GREATEST, LEAST
 ROUND, CEIL, FLOOR
 Usage is <?xdofx:function_name(params)?>
 It is NOT case sensitive
 Not required to be in a form field
===
Conditional logic
• Support for IF and CASE statements
• IF
– <?if:boolean_test?>
<?end if?>
– Example : to display only invoice lines with a line type of “LINE”
– Enclose the invoice line output within the tags below
• <?if:LINE_TYPE='LINE' ?>
• <?end if?>
 CASE
 <?choose?>
<?when:boolean_test?>
<?end when?>
<?otherwise?>
<?end otherwise?>
<?end choose?>
====
Images/Logos…
 Use a table for complete control of image behavior
 Static Images
 Paste the image directly into layout template
 URL
 Dummy image on template
 Specify URL in alternative text section
 Double click on image, go to web tab, alternative text field
 url:{‘www.myspace.com/xml_example/myimage.gif’}
 Server-side Images (in EBS)
 Dummy image on template
 Specify URL in alternative text section
 url:{‘${OA_MEDIA} /myimage.gif’}
 Also supported
 URLs and Paths in XML elements or combination of elements
 BLOBS from database
===
Dynamic data columns
 Dynamic Column Header
 <?split-column-header:group element name?>
 Dynamic Column Data
 <?split-column-data:group element name?>
 Example: Print departments in column header and demand qty as column
data
 Column header
 <?split-column-header:G_DEPT_CLASS?><?DEPT_CLASS?>
 Column data
 <?split-column-data:G_DEPT_CLASS?><?SUM_QTY?>
====
Rows per page
 Define row counter variable in a form field
<?xdoxslt:set_variable($_XDOCTX, ’Counter’, 0)?>
 Increment counter for each line (again in a form field)
<?xdoxslt:set_variable($_XDOCTX, ’Counter’, xdoxslt:
get_variable($_XDOCTX, ’Counter’) + 1)?>
 Break if the number of rows is reached (say 6 rows in this example)
<?if: xdoxslt:get_variable($_XDOCTX, ’Counter’) mod 6=0?>
<?split-by-page-break:?>
<?end if?
====
Last Page Only Content
• Create a section break in MSWord (Insert->Break->Section break Next
page)
• Insert the following syntax on the final page:
<?start@last-page:body?>
<?end body?>
• Content on the page above and below these tags will appear only on last
page
• Headers or footers previously defined for the report must be reinserted on
the last page
===
Re-grouping XML Data
 Not limited by the structure of the data source
 Use the tags
 <?for-each-group: BASE-GROUP;GROUPING-ELEMENT?>
 <?end for-each-group?>
 Can establish nested groupings
 <?for-each:current-group(); GROUPING-ELEMENT?>
 <?end for-each-group?>
 Example: CD Catalog XML data is grouped by CD. To change to group
by country, use the syntax below:
 <?for-each-group:CD:COUNTRY?>
===
Cell highlighting
• Native XSL embedded within XMLP using xdofo:ctx component
• Example: Change cell color to red if debit amount > 1000
<?if:debit>1000?>
<xsl:attribute xdofo:ctx="block“
name="background-color">red
</xsl:attribute>
<?end if?>
===
Page totals
• Declare variable to hold page totals, following data element declaration
• <?add-page-total:TotalFieldName;'element'?>
• Display total field
• <?show-page-total:TotalFieldName;'Oracle-number-format'?>
• Example: Suppose we want to total the field “debit”
• Create a page total variable called “dt” (it follows the placeholder)
<?debit?><?add-page-total:dt;'debit'?>
• Insert the show page total syntax in the page footer
<?show-page-total:dt;'C9G990D00';'(C9G990D00)'?>
• Page totalling available only for PDF output type
===
Template Builder – Load XML Data
• First step - Load the sample XML output file using Data->Load XML Data
Template Builder – Inserting Placeholders
• Insert placeholders using Insert->Field menu option.
• Text form fields
• Tag name is visible by clicking the Add Help Text button within the Text form field
• Use Microsoft Word tables for better alignment
Template Builder Preview
• Preview template as PDF, HTML, Excel or RTF output
• Finetune till desired output is achieved
• Save template as .rtf file
Template Manager – E-Business Data Definition
• Navigate to XML Publisher Administrator responsibility
• Home->Data Definitions->Then Click on Create Data Definition button
• Enter details * Note: the Code is same as the concurrent program short
name – RAXINV_SEL
Template Manager – E-Business Template
• Navigate to XML Publisher Administrator responsibility
• Home->Templates>Then Click on Create Template button
• Assign the template to the Data Definition created earlier
• Upload the RTF file
Run concurrent using SRS
• Run the concurrent program using SRS
• Click Options button
• Select Output Layout Format – Default PDF
==
Exceptions
• Navigate System Administrator->Concurrent->Manager->Administer
• Select Output Post Processor
• Click on Processes button
• Select the active process
• Click on Manager Log button
• Review the log for exceptions
• More details and options for debugging – Refer Metalink Note 364547.1
==
References and more info.
• XML Publisher Blog
– http://blogs.oracle.com/xmlpublisher/
• XML Publisher Oracle Product Site
– http://www.oracle.com/technology/products/xml-publisher/index.html
• XML Publisher Forum
– http://forums.oracle.com/forums/forum.jspa?forumID=245
• User Guides
– Oracle XML Publisher User’s Guide
– Oracle XML Publisher Report Designer’s Guide
• Metalink Notes
– Metalink Note 422508.1 – About XML Publisher Release 5.6.3
– Metalink Note 364547.1 - Troubleshooting Oracle XML Publisher for Oracle Applications 11i
• Oracle Tutorial for XML Publisher for EBS
– http://www.oracle.com/technology/obe/obe_bi/xmlp_ebiz/index.html
==

Monday, 2 March 2015

XML Publisher Questions with Answers



Overview: Oracle XML Publisher is a template-based publishing solution delivered with the Oracle E-Business Suite. It provides a new approach to report design and publishing by integrating familiar desktop word processing tools with existing E-Business Suite data reporting. At runtime, XML Publisher merges the custom templates with the concurrent request data extracts to generate output in PDF, HTML, RTF, EXCEL (HTML), or even TEXT for use with EFT and EDI transmissions
Basic Need for XML: Consider the following scenarios
We have a RDF report with tabular layout which prints in English
New Requirements:
  1. User1 wants the same Report needs to be printed in Spanish
  2. User2 wants the Same Report needs to be printed in chart format
  3. User3 wants the Same Report output in Excel
  4. User4 wants the Same Report output to be published on intranet or internet
  5. User5 wants the Same Report output eliminating few columns and adding few other
A new RDF needs to be created for each requirement stated above or an existing RDF needs to be modified with huge amount of effort but whereas with XML Publisher it can be done very easily.
XML Publisher separates a reports data, layout and translation components into three manageable pieces at design time; at runtime all the three pieces are brought back together by XML Publisher to generate the final formatted, translated outputs like PDF, HTML, XLS and RTF. In future, if any there is any change in layout we just need to add/modify the Layout file
Data Logic: Data extracted from database and converted into an XML string.
Layout: The layout templates to be used for the final output are stored and managed in the Template Manager.
Translation: The translation handler will manage the translation that is required at runtime
In brief the steps are as follows:-
a.    Create a procedure and register it as Concurrent Program so that we write XML  tags  into output file.
b.    Build a Data Definition & XML Template using XML Publisher.
c.    Create a relation between XML Template & Concurrent Program and run the concurrent program
Requirements for XML Data Object Reports
  1. Oracle XML Publisher Release 5.5 patch 4206181
  2. Template Builder 5.5
Template builder is used to create template/layout for your report. Usually Template builder 5.5 is available in Oracle XML Publisher patch itself but you can also download it from http://edelivery.oracle.com. First select Oracle Application Server Products then select your platform and then locate the Oracle XML Publisher Release 5.6.2 Media Pack v1 for Microsoft Windows, as below:
Download the Desktop edition from the below:
When you download the XML Publisher Desktop edition you get a Zip file containing setup for  XML Publisher Desktop Install Shield, this installs some components into Microsoft Word.
After installing, the Word Add-Ins is attached to the menu bar for the word document. This menu lets you attach an XML data source document, add the XML data to your template, set preferences and preview the output.
In detail along with screenshots:-
A concurrent program is written that spit out an XML file as output such concurrent program can be of type SQL or PL/SQL or Oracle Report or any other supportable type, provided it can produce a XML output.
1. Here I have a very simple PL/SQL procedure, which fetch the records from AR tables and write the output in xml tags.
CREATE OR REPLACE PROCEDURE APPS.Demo_XML_Publisher (errbuf VARCHAR2,retcode NUMBER,v_customer_id VARCHAR2)
AS

/*Cursor to fetch Customer Records*/
CURSOR xml_parent
IS
SELECT   customer_name , customer_id
FROM      ra_customers
WHERE   customer_id = to_number(v_customer_id);

/*Cursor to fetch customer invoice records*/
CURSOR xml_detail(p_customer_id1 NUMBER)
IS
SELECT ra.customer_trx_id customer_trx_id, ra.ship_to_customer_id ship_to_customer_id, ra.trx_number trx_number,aps.amount_due_original ams
FROM  ra_customer_trx_all ra, ar_payment_schedules_all aps
WHERE  ra.ship_to_customer_id = p_customer_id1
AND aps.customer_trx_id = ra.customer_trx_id
AND      ROWNUM<4;

BEGIN
/*First line of XML data should be <?xml version="1.0"?>*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<CUSTOMERINFO>');
FOR v_customer IN xml_parent
LOOP
/*For each record create a group tag <P_CUSTOMER> at the start*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<P_CUSTOMER>');
/*Embed data between XML tags for ex:- <CUSTOMER_NAME>ABCD</CUSTOMER_NAME>*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<CUSTOMER_NAME>' || v_customer.customer_name
|| '</CUSTOMER_NAME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<CUSTOMER_ID>' || v_customer.customer_id ||
'</CUSTOMER_ID>');

FOR v_details IN xml_detail(v_customer.customer_id)
LOOP
/*For  customer invoices create a group tag <P_INVOICES> at the start*/

FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<P_INVOICES>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<CUSTOMER_TRX_ID>' ||
v_details.customer_trx_id || '</CUSTOMER_TRX_ID>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<CUSTOMER_ID>' ||
v_details.ship_to_customer_id || '</CUSTOMER_ID>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<INVOICE_NUMBER>'||
v_details.trx_number||'</INVOICE_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<AMOUNT_DUE_ORIGINAL>'||
v_details.trx_number||'</AMOUNT_DUE_ORIGINAL>');

/*Close the group tag </P_INVOICES> at the end of customer invoices*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</P_INVOICES>');
END LOOP;

/*Close the group tag </P_CUSTOMER> at the end of customer record*/

FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</P_CUSTOMER>');
END LOOP;

/*Finally Close the starting Report tag*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</CUSTOMERINFO>');
exception when others then
FND_FILE.PUT_LINE(FND_FILE.log,'Entered into exception');
END Demo_XML_Publisher;
/

2. Create an executable SampleXmlReport for the above procedure Demo_XMML_Publisher.
Go to Application Developer Responsibility->Concurrent->Executable
3. Create a new concurrent program SampleXmlReport that will call the SampleXmlReport executable declared above. Make sure that output format is placed as XML.
Go to Application Developer Responsibility -> Concurrent ->Program
4. Make sure we declare the parameters for the procedure.
5. Add this new concurrent  program with Receivables request group. Either using the following code or through below application screen.
DECLARE
BEGIN
FND_PROGRAM.add_to_group
(
PROGRAM_SHORT_NAME  =>'CUST_XML_SAMPLE'
,PROGRAM_APPLICATION =>'AR'
,REQUEST_GROUP       => 'Receivables All'
,GROUP_APPLICATION   =>'AR'
) ;
commit;
exception
when others then
dbms_output.put_line('Object already exists');
END ;
/

Go to System Administrator Responsibility ->Security ->Responsibility->Request
6. From the receivables responsibility (depends on which responsibility we added our concurrent program here it is receivables)
From the menu View->Requests->Submit A New Request->Single Request
Note: The layout field is blank as we haven’t attached any Template or layout to this concurrent program yet.
By submitting the above request we get the output in xml (depending on procedure) as follows:
<?xml version=”1.0″ ?>

- <CUSTOMERINFO>
- <P_CUSTOMER>
<CUSTOMER_NAME>UNIV OF CHICAGO HOSP</CUSTOMER_NAME>
<CUSTOMER_ID>1119</CUSTOMER_ID>
- <P_INVOICES>
<CUSTOMER_TRX_ID>929476</CUSTOMER_TRX_ID>
<CUSTOMER_ID>1119</CUSTOMER_ID>
<INVOICE_NUMBER>2484403</INVOICE_NUMBER>
<AMOUNT_DUE_ORIGINAL>8000</AMOUNT_DUE_ORIGINAL>
</P_INVOICES>
- <P_INVOICES
<CUSTOMER_TRX_ID>929374</CUSTOMER_TRX_ID>
<CUSTOMER_ID>1119</CUSTOMER_ID>
<INVOICE_NUMBER>2484267</INVOICE_NUMBER>
<AMOUNT_DUE_ORIGINAL>380.68</AMOUNT_DUE_ORIGINAL>
</P_INVOICES>
- <P_INVOICES>
<CUSTOMER_TRX_ID>806644</CUSTOMER_TRX_ID>
<CUSTOMER_ID>1119</CUSTOMER_ID>
<INVOICE_NUMBER>2421373</INVOICE_NUMBER>
<AMOUNT_DUE_ORIGINAL>615.96</AMOUNT_DUE_ORIGINAL>
</P_INVOICES>
</P_CUSTOMER>
</CUSTOMERINFO>
7. Save the above code as SampleXmlReport.xml
Note: Before saving the XML string in notepad remove the dashes –
8. Create Template/Layout for the report using Template Builder. Here is a sample template.
Note the following:
The data fields that are defined on the template
For example: Customer Name, Customer Id
The elements of the template that will repeat when the report is run.
For example, Customer trx id , Invoice Number and Original Amount Due. All these fields on the template will repeat for each Employee that is reported.
9. Mark up your template layout.
Like a mail-merge document there’s placeholders for the data you’re going to add, and then you can add whatever formatting you like.
10. Now the next step is to select Data > Load XML Data from the toolbar menu, then pick up the XML data a file ie.SampleXmlReport.xml. Once the data is loaded, a “Data Loaded Successfully” dialog box comes up and you can then start adding data items to the template.
11. To add data items from the XML file into your report, you locate in the document the placeholder for the field you’re going to add, highlight it and then select Insert > Field from the toolbar. A dialog box comes up with all of the available data items, you select the one you want and click insert as shown below:
12. You can add repeating rows into your document by selecting Insert > Table/Form from the toolbar. This brings up a different dialog box that lets you drag a parent node – in this case, “P Invoices” – into the middle section, which becomes your repeating rows.
13. Calculate the average for amount due original. Select Insert->Field from the Add Ins toolbar. Then select the tag that calculates the average for that particular field.
14. Once we are done with adding up all the fields in the template save it as an rtf which looks as below:
To confirm the output from the template we build.  Click on preview and select the type in which format the output is required.
15. Adding the Template to ORACLE Application.
In order to add the template to application the user should have the responsibility XML Publisher Administrator assigned.
In this step we do 2 processes, registering concurrent program as Data Definition in template manager
And register the template using the data definition created.
Go to XML Publisher Administrator->Data Definitions->Create Data definition.
Here we fill all the details to create data definition
NOTE: Make sure the code of the data definition must be the same as the short name of the Concurrent Program we registered for the procedure. So that the concurrent manager can retrieve the templates associated with the concurrent program
We can add our xml file SampleXmlReport.xml in data definition here:
16. Now create the template with the help of template manager
At the runtime the concurrent managers request interface will present the list of available templates with respect to the data definition registered. We will upload the rtf template file created here. We will select the language and territory.
We can upload different templates for different languages and territories.
17. Now run the concurrent program to get the desired output.
From the receivables responsibility, use the submit request form to run the concurrent request.
The default layout is displayed which we can change as per the requirement. For changing the template click on options to look for all templates register with that concurrent program.
Here in the above example my template is SampleXmlReport which is displayed in layout field.
And once the request is submitted we will get the output in PDF as
This is the final output as desired in the PDF format.

Dynamic Content using Sub Templates
By Tim Dexter-Oracle on Dec 01, 2011
I have written about sub templates in the past on a few occasions; the principle behind them is pretty simple. If you have common report components that can be shared across reports; be they blocks of text like standard contract clauses or maybe some common calculation or function, drop them into a sub template and share the love. Develop once, use everywhere!
A colleague was recently tasked with conditionally bringing into a report output, paragraphs of static text based on some user preferences. That’s an ideal candidate for a sub template approach; drop all of the paragraphs in to an RTF subtemplate and then just conditionally pull them in based on some boolean expressions.
You might, quite naturally think about conditionally importing a series of sub templates rather than defining one, with all the content. However, XSL does not allow the conditional import of sub templates so you must take the single template approach. You can of course, import multiple sub templates if you have a lot of content to bring in but in most cases I would expect a single sub template will suffice.

BIP does need to know what those paragraphs need to be for each user whether that’s as a set of parameter values or a data element in the incoming data set. For this example I have used both approaches and they work all flavors of BIP. Implementation of the sub template onto the servers is going to be a little different but the main principle is the same. I have mercilessly ripped out a nice graphic from Leslie’s (doc writer extraordinaire) documentation.



This is for the 11g version that supports loading sub templates into the report catalog as objects.  They can then be referenced in your main template using the import statement:

<?import:xdoxsl:///subtemplatefolder/subtemplatename.xsb?>

The subtemplate folder is going to be from the /SharedFolders  or /My Folders root. For instance, I have a sub template ‘paragraphs’ loaded into a ‘test’ folder under  Shared Folders. The import statement in my main template is ‘<?import:xdoxsl:///Test/ParaSubTemplate.xsb?>’
Update from Leslie

For those of you testing using your own My Folder area. The syn tax is
<?import:xdoxsl:///~username/path to subtemplate.xsb?> where username is your user name. For example: <?import:xdoxsl:///~tdexter/Subtemplates/Template1.xsb?>
Recommend you move them into the shared folder area in production.
For 10g you will either need to drop them into an accessible directory and use the file URI or mount them into the web server directory structure and access them via an http URI. I normally mount them in a directory under the ‘xmlpserver’ directory e.g J2EE_HOME\applications\xmlpserver\xmlpserver\subtemplates, a template is then accessible via the URI ‘http://server:port/subtemplates/template.rtf’
Make sure you set the Allow External References property to true for the report so that the sub template can be accessed.



The actual content of the sub template is pretty straight forward. It’s a series of paragraphs bounded by the ‘template’ command e.g.
<?template:para1?>
…
…
<?end template?>
<?template:para2?>
…
…
<?end template?>
<?template:para3?>
…
…
<?end template?>
Now we have the dynamic content defined it’s a case of conditionally bringing it into the main template. For this example I have demonstrated two approaches; both rely on the required paragraph information to be in the main dataset:
1.    Using parameters to allow the user to select the appropriate paragraphs to be brought in.
This means creating the parameters and ensuring that you have set the property on the data model to include the parameter values in the XML result set.

Once that’s done its just a simple case of using id statements to check if a given paragraph should be included:
<?if:.//PARA1='1'?><?call:para1?><?end if?>


This assumes my parameter is called PARA1 and that a ‘1’ means include it, it could easily be a ‘Y’ or ‘True’ value, you are just testing for it.

2.    Including a value in the data to define what paragraphs should be included. If you have stored what paragraphs should be included for a given entity i.e. customer, supplier, employee, etc. Then you can extract those values into the data set and test for them. For this demo I have a 5 character set of ‘1’s and ‘0’s to represent the paragraphs that need to be included e.g. 10110. I just use a substring command to find out if a particular paragraph needs to be included.
<?if:substring(.//PARAS,1,1)='1'?><?call:para1?><?end if?>

Where PARAS is the element holding the ‘1’s and ‘0’s string to be parsed.
You can of course use some other means of marking whether a paragraph needs to be included or not. It’s just a case of parsing out the values with a substring or similar command.
You should be able to generate dynamic content such as this:

XML Publisher Interview Questions and Answers


1.     What are the XML publisher tables.
Ans>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
2.     how to create report with out .rdf?
Ans> Using Data template…..see below link
http://appstechnical01.blogspot.in/2012/08/using-multiple-quires-data-template-code.html
3.     how to write a loop in rtf template design ?
Ans> <?for-each:G_invoice_no?>
     ……………………..<?end for each?>
4.     how to design  sub templates in rtf layout ?
Ans> using following tags..
                <?template:template_name?>
                      This is Last Page
                               <?end template?>
5.     how to call a header or footer ?
          Ans> using this tag <?call:header?> and <?call:footer?>
                We have to use header section and footer section of the page.

6.     How to break the page in specific condition ?
Ans>  <?split-by-page-break:?>
7.     How to use section break ?
Ans>  <?for-each@section:G_CUSTOMER(This is group name)?>
8.     How to create multi layouts in XMLP ?
        Ans>  using below conditions
               <?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?>
9.     How to calculate the running total in XMLP?
Ans>           <?xdoxslt:set_variable($_XDOCTX, 'RTotVar', xdoxslt:get_variable($_XDOCTX, 'RTotVar') + ACCTD_AMT(This is                                                column name) )?><?xdoxslt:get_variable($_XDOCTX, 'RTotVar')?>
10.   How to submit a layout in the backend ?
       Ans>  we have to 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'
                             );
11.   How to display the images in XMLP?
        Ans> 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?
Ans>  <REPORT>
<PAGESTART>200<\PAGESTART>
....
</REPORT>
Enter the following in your template:
<?initial-page-number:PAGESTART?>

13.How to display  last page is differently in XML Publisher Reports.

Ans> what you want to dispay the test anything write in last of page

last page header 

<?start@last-page-first:body?>    <?end body?>

more questions i will update soon......... 
 we have any doubts on this please give the comment....i will respond...u r comment

What is BI Publisher?
       A. It is a reporting tool for generating the reports. More than tool it is an engine that can be
            integrated with systems supporting the business.

    Is BI Publisher integrated with Oracle Apps?
        Yes, it is tightly integrated with Oracle Apps for reporting needs. In 11.5.10 instances xml publisher was used, in R12 we can it BI Publisher

    What is the difference between xml publisher and BI Publisher?
        Name is the difference, initially it was released on the name of xml publisher( the initial patchset), later on they have added more features and called it Business Intelligence Publisher. In BI by default we have integration with Datadefinitions in R12 instance. Both these names can be used interchangeably

    What are the various components required for developing a BI publisher report?
        Data Template, Layout template and the integration with Concurrent Manager.

    How does the concurrent program submitted by the user knows about the datatemplate or layout template it should be using for generating the output?
        The concurrent program ‘shortname’ will be mapped to the ‘code’ of the Datatemplate. Layout template is attached to the datatemplate, this forms the mapping between all the three.

    What is a datatemplate?
        Datatemplate is an xml structure which contains the queries to be run against the database so that desired output in xml format is generated, this generated xml output is then applied on to the layout template for the final output

    What is a layout template?
        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.

    What are the output formats supported by layout template?
        xls, html, pdf, eText etc are supported based on the business need.

    Do you need to write multiple layout templates for each output type like html/pdf?
        No, only layout template will be created, BI Publisher generates desired output format when the request is run

    What is the default output format of the report?
        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

    Can you have multiple layout templates for a singe data template?
        Yes, multiple layouts can be defined, user has a choice here to use one among them at run time during conc request submission


    Where do you register data and layout templates?
        Layout template will be registered under xml publisher administrator responsibility>Templates tab.
        Data template will be registered under xml publisher admininstrator responsibility> Data Definitions

    I want to create a report output in 10 languages, do I have to create 10 layout templates?
        No, BI Publisher provides the required translation for your templates, based on the number of languages installed in your oracle apps environment requires outputs are provided

    What is the required installation for using BI Pub report?
        BI Publisher deskop tool has be installed. Using this tool you can preview or test the report before deploying the same on to the instance.

    How do you move your layout or data template across instances?
        xdoloader is the utility that will be used.

    What is the tool to map required data output and layout templates so that they can be tested in local machine?
        Template viewer will be used for the same.

    Which component is responsible for generating the output in xml format before applying it to layout template?
        DataEngine will take DataTemplate as the input and the output will be generated in xml format which will then be applied on layout template

    Can BI publisher reports be used in OAF pages?
        XDO template utility helper java classes are provided for the same.

    Name some business use cases for BI  reports?
        Bank EFT, customer documents, shipping documents, internal analysis documents or any transactional documents

    How do you pass parameters to your report?
        Concurrent program parameters should be passed, ensure that the parameter name/token are same as in the conc prog defn and the data template

    What are the various sections in the data template?
        Parameter section
        Trigger Section
        Sql stmt section
        Data Structure section
        Lexical Section

    What does lexical section contain?
        The required lexical clause of Key Flex field or Descriptive FF are created under this section

    What triggers are supported in Data template?
        Before report and After report are supported

    Where is the trigger code written?
        The code is written in the plsql package which is given under ‘defaultpackage’ tag of data template.

    what is the file supporting the translation for a layout template?
A. xliff is the file that supports the translation, you can modify the same as required.

  Q. How do you display the company logo on the report output?
A. Copy and paste the logo (.gif. or any format) on the header section of .rtf file . Ensure you resize per the company standards.

RTF Template : Working with variables


Let’s see how we can use the variables to store temporary data or use for calculation.  This is achieved using  “xdoxslt:” function. These are the BI Publisher extension of standard xslt functions.  
Use xdoxslt:set_variable () function to set /initialize the variable  and xdoxslt:get_variable() function to get the variable value.  $_XDOCTX is the System variables to set the XDO Context.

/*initialize a variables*/
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?>
/*update the variable’s value by adding the current value to MY_CNT, which is XML element */
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, xdoxslt:get_variable($_XDOCTX, ‘counter’) + MY_CNT)?>
/* accessing the variables */
<?xdoxslt:get_variable($_XDOCTX, ‘counter’)?>

/*Working in a loop*/
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?>
<?for-each:G1?>
/*increment the counter*/
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, xdoxslt:get_variable($_XDOCTX, ‘counter’) + 1)?>
<?end for-each?>
<?xdoxslt:get_variable($_XDOCTX, ‘counter’)?>

Hope this help in understanding variable gimmicks.
Need help on RTF template design or BI Publisher implementation, please contact info@adivaconsulting.com

What is XML Publisher?

Oracle XML Publisher is a template-based publishing solution delivered with the Oracle E-Business Suite. It provides a new approach to report design and publishing by integrating familiar desktop word processing tools with existing E-Business Suite data reporting. At runtime, XML Publisher merges the custom templates with the concurrent request data extracts to generate output in PDF, HTML, RTF, EXCEL (HTML), or even TEXT for use with EFT and EDI transmissions.

XML Publisher has been ported over to the PeopleSoft enterprise ERP suite. XML Publisher will be the reporting tool of choice from Oracle when Fusion Applications become available.

What are the various sections in the data template?

The data template is an XML document that consists of 5 basic sections:
  1. Properties
  2. Parameters
  3. Triggers
  4. Data Query
  5. Data Structure

How do you migrate layout or data template across instances?

We can use XDOLoader utility to migrate both data template and layout. Below is the example:

Data Template:

      java oracle.apps.xdo.oa.util.XDOLoader UPLOAD \
      -DB_USERNAME ${apps_user} \
      -DB_PASSWORD ${apps_pwd} \
      -JDBC_CONNECTION ${TNS_STRING} \
      -LOB_TYPE DATA_TEMPLATE \
      -APPS_SHORT_NAME XXCUST \
      -LOB_CODE XX_DT_REPORT \
      -LANGUAGE en \
      -TERRITORY US \
      -XDO_FILE_TYPE XML \
      -NLS_LANG ${NLS_LANG} \
      -FILE_CONTENT_TYPE ‘text/html’ \
      -FILE_NAME XX_DTEMPLATE.xml \
      -LOG_FILE XX_DTEMPLATE.xml.log \
      -CUSTOM_MODE FORCE
      FIN_STATUS=$?

Layout:

    
  java oracle.apps.xdo.oa.util.XDOLoader UPLOAD \
  -DB_USERNAME ${apps_user} \
  -DB_PASSWORD ${apps_pwd} \
  -JDBC_CONNECTION ${TNS_STRING} \
  -LOB_TYPE TEMPLATE_SOURCE \
  -APPS_SHORT_NAME XXCUST \
  -LOB_CODE XX_DT_REPORT \
  -LANGUAGE en \
  -TERRITORY US \
  -XDO_FILE_TYPE RTF \
  -NLS_LANG ${NLS_LANG} \
  -FILE_CONTENT_TYPE ‘application/rtf’ \
  -FILE_NAME XX_LAYOUT.rtf \
  -LOG_FILE XX_LAYOUT.rtf.log \
  -CUSTOM_MODE FORCE      

Do we need to create multiple layout templates for printing report in multiple languages?

We can achieve multi language report by two ways
  1. Different layout template for different languages This approach can be chosen if the layout is also different from language to language.

       2. Generate XLIFF template for each language
           XLIFF (XML Localization Interchange File Format) : format for exchanging localization data. XML based format that enables translators to concentrate on the text to be translated. We use this option when we want to use the same layout and apply specific translation.

Can you have multiple layout templates for a singe data template?

Yes! Multiple layouts can be attached, so that user will have a choice here to use one among them at the time of concurrent program submission

How to get a output of a XMLP report in different formats like PDF, DOC, XLS, TXT ?

While submitting the concurrent program you select the output format in options form of “Up on Completions” selection.

What is Data Template and Layout Template?

Data Template:
Datatemplate is an xml structure which contains the queries to be run against the database so that desired output in xml format is generated, this generated xml output is then applied on to the layout template for the final output

Layout Template:
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.

How does the concurrent request relate both data template and layout template it should be using for generating the output?

The concurrent program ‘short name’ will be mapped to the ‘code’ of the Data template. Layout template is attached to the data template, this forms the mapping between all the three.

What are the various components required for developing a BI publisher report?

  1. Data Template
  2. Layout template
  3. Integration with Oracle Concurrent Manager

What is the difference between XML publisher and BI Publisher?

Name is the difference, XML Publisher (today) is only found within E-Business Suite. Prior to release 12, it was added in via a patch. In R12, it comes pre-installed. Both these names can be used interchangeably.
XML Pub operates entirely within EBS and can only be used within EBS. BIP can be installed as a standalone version running off of several OC4J compliant engines, such as Application Server and Tomcat. BIP can be pointed anywhere, so you could do reports out of an OLTP or warehouse database, MSSQL and even within EBS.
Licensing is already included in EBS, and the standalone costs whatever plus maintenance.
BI Publisher is based on OC4J, which is a J2EE compliant engine, which for all practical purposes, is a Web server. You see OC4J in lots of other Oracle products which typically have one thing in common: they expose their application to the user via a Web interface. XMLP is also based on this because EBS runs off of Application Server.
Both include a desktop component, which is an add-in to Word, and the work there is the same regardless of which flavor you’re using. You can create templates and publish them, there being a slight difference in how each version does that.

What triggers are supported in Data template?

There are two different triggers supported by Data Template:
  1. Before Trigger
  2. After Trigger

What are the main XML Publisher database Tables?

Here are the few important tables of XMLP:
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

Where and What is the code written in the Data Template Trigger?

The code is written in the plsql package which is mentioned under ‘defaultpackage’ tag of data template.

what is the file supporting the translation for a layout template?

XLIFF is the file that supports the translation, we have one XLIFF file for each language.

How to do Looping in XMLP?

you can use the below syntax for looping:
 
<?for-each:looping_node_name?>
.
.
.
<?end for-each?>

How to create sub templates in rtf Template?

Here is the Sub Template tag:

<?template:header?>
…sub template design/tags…
<?end template?>

Here ‘header’ is the sub template name.

After that you call ‘header’ sub template any where in the rtf with below syntax:
<?call:header?>

How do you pagebreaks after specific rows?

We can use below tag for page break:
<?split-by-page-break?>
But to use this conditionally we can use below syntax:
<?if:position() mod 5=0 ?>
      <?split-by-page-break:?>
<?end if?>
Note: we should not use split-by-page-break in a table layout.

 

How to create a conditional Layout in XMLP?

Here is the syntax for creating different layouts based on condition:

<?choose:?>

      <?when:CF_CHOICE=’VENDOR’?>
            ..design your Layout here..
       <?end when?>

       <?when:CF_CHOICE=’INVOICE’?>
               ..design your Layout here..
        <?end when?>

       <?when:CF_CHOICE=’RECEIPT’?>
               ..design your Layout here..
        <?end when?>

<?end choose?>

How to restrict rows in a Group based on some condition in XMLP?

We can use below syntax to restricting the rows in the Group based on condition:

Syntax:
<?for-each:Group_Name[./Field_name with Condition]?>

Example:
<?for-each:EMP_DETAILS[EMP_ADDRESS!=”]?>
In this examples it will filter the Records with EMP_ADDRESS is not Null and Displays in the Report.

How to handle NULL values as Exceptions in XMLP?

We use section:not property to handle NULL values.
Syntax:
<?if@section:not(//GROUP_NAME)?>Message/Action<?end if?>

Example:
<?if@section:not(//G_HEADERS)?>No Data Found for the Parameters Provided Master <?end if?>
Displays the Message
” No Data Found for the Parameters Provided Master “

How to find String Length in XMLP?

Tag to find the length of the String

<?string-length(Field_NAME)?>
Example:
<Name>Samantha</Name> (i.e Data Source)
Template Layout:
<?Name?> is <?string-length(Name)?> characters length Word.
Output:
Samantha is 8 characters length Word.

How to use Variables in XMLP?

Here is a small example of how to use variables in XMLP rtf layout:

Declaring the Variable R
<?xdoxslt:get_variable($_XDOCTX, ‘R’)?>
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)?>
Similarly U can use any mathematical Operation to the variable R.

How to Sort Data in the XMLP?

Syntax:-

Case 1:-
<?sort:Field_Name?><?Field_Name?>
It sorts the data in Ascending order by Default.if Order By is not mentioned

Case 2:-
<?sort:Field_Name;’Order by‘?>
It sorts the data based on Order By mentioned here like Ascending Or Descending

Case 3:-
<?sort:Field_Name;’Order by‘;data-type=’text’?>
It sorts the String Data based on Order By mentioned here like Ascending Or Descending

Examples:-

Case 1:-
<?for-each:EMP_DETAILS?>
<?sort:EMP_NO?><?EMP_NAME?><?end for-each?>
Case 2:-
<?for-each:EMP_DETAILS?>
<?sort:EMP_NO;’descending‘?><?EMP_NAME?><?end for-each?>
Case 3:-
<?for-each:EMP_DETAILS?>
<?sort:EMP_NAME;’ascending‘;data-type=’text’?><?EMP_NAME?><?end for-each?>

How to repeat the Header of the template on each and every page of the output in XMLP?

Use <b><@section:?></b> tag to repeat a section in any specific region of a layout
(Or)You can also use header part of rtf (MS word feature) to insert the information you want to repeat on all pages.

What are the different ways to show/insert an image on XMLP layout?

There are 4 different ways to insert/show an image in rtf:
  1. Insert an image directly on rtf just by using MS word standard feature
  2. Using OA_MEDIA: storing on server and giving physical path of the image
  3. Using URL of a image hosted on some website
  4. Retrieving the image store in a database as BLOB type

Can XML publisher reports be used in OAF pages?

We can use XDO template utility helper java classes to embed XMLP report on OA Pages

Which component is responsible for generating the output in XML format before applying it to layout template?

DataEngine will take DataTemplate as the input and the output will be generated in xml format which will then be applied on layout template
More information: http://oracleappsdna.com/2014/10/developing-xml-publisher-reports-using-data-template/

What is the default output format of XMLP report?

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