Infolinks

Saturday 21 July 2012

Oracle BI publisher training with OA Frame work

Oracle BI publisher training with OA Frame work

You may have known different ways of generating the XML data while using the same RTF layout template. In this example, you will generate a BI Publisher report using OA Framework. In OA Framework, you do not need to use a data template or an Oracle Report to generate a BI Publisher report. Instead, the XML data is sourced from something known as view objects.

In this example, you will develop a very simple page with a button on it. When you click the Show BI Report button, the BI Publisher report will be displayed to the user on the screen. Behind the scenes, the following events will happen when the button is clicked:


1. Trap button click event The OA Framework page is attached to a controller class, and its method processFormRequest is executed when the button is clicked.
2. Retrieve data Inside the processFormRequest, you execute a query on a view object. A view object query retrieves the data from customer and invoice tables used in this example.
3. Generate XML In OA Framework, the view objects have a method named writeXML that can dump the entire data returned by their SQL Query into XML. Therefore, you invoke writeXML on the view object and its output is written to a byte output stream.
4. Generate PDF output The BI Publisher API named TemplateHelper.processTemplate is executed, to which the template name and result of writeXML() are passed as input parameters. 

The complete list of parameters passed to the BI Publisher API for this example is shown in Table 8-2.

Table 8-2: Parameters Passed to the BI Publisher API
Description: b24-bluearrowOpen table as spreadsheet
BI Publisher API Parameter
Value Passed
AppsContext
In OA Framework, the application module has a method that returns a handle to the current database session; using this, you can return the AppsContext object.
Template
The short code of the template, which in this example will be XX_CUST_INV_TEMPLATE.
Template Application Short Name
The application short name, which in this example is CUSTOM, but in your case will be the relevant custom application short name on your instance.
Data Input Stream
The XML generated using ViewObject.writeXML() is converted into byte array input stream, which is passed as parameter to the TemplateHelper API.
Language and Territory
The language and the locale, which you can get from the current OA Framework session using oadbtransaction.getCountry and oadbtransaction .getUserLocale.
Data Output Stream
A new ByteArrayOutput stream, which you create; the template helper API writes the BI Publisher output contents (PDF in this case) into the ByteArrayOutput. The byte array received from TemplateHelper is written into the ServletResponse of the user’s browser session. This makes it possible for the user to see the BI Publisher output.

5. Display PDF output The BI Publisher API returns a stream for PDF output, which is then redirected to the browser.

No comments:

Post a Comment