Infolinks

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

               


  

No comments:

Post a Comment