Tuesday, April 1, 2008

XMLPUBLISHER--Template Based on Parameter

Hi All,
Today i come across a problem of selecting layout based on parameter in XML Publisher..After a bit of R&D i come up with this solutionOne way of doing it is
1.Create a plsql procedure with all the parameter of the report

2.Based on the parameter select the layout either if Else logic or some where defined in the database.

3.set the layout using this function define below submit the report concurrent request from plsql

4.This should solve the problem

Modify your PL/SQL procedure to add a line similar to xml_layout:

1. First you must declare the variable xml_layout boolean;

2. Then you must call the ADD_LAYOUT API prior to submitting your Concurrent Program.
xml_layout := FND_REQUEST.ADD_LAYOUT('FND','FNDSCURS','en','US','PDF');

req_id := FND_REQUEST.SUBMIT_REQUEST('FND','FNDSCURS','FNDSUBMIT - Active Users XML');


Just for checking whethere working properly or not..

Note: The easiest way to find out the parameters for the ADD_LAYOUT API is to run the concurrent program from standard submission then check the OPP Manager log for the parameters after a successful submission.


i.e. From $APPLCSF/$APPLLOG/FNDOPP10367.txt[5/10/05 12:08:13 PM] [10367:RT239207] Starting XML Publisher post-processing action.[5/10/05 12:08:13 PM] [10367:RT239207] Template code: FNDSCURS
Template app: FND
Language: en
Territory: US
Output type: PDF[5/10/05 12:08:14 PM] [10367:RT239207] XML Publisher post-processing action complete.[5/10/05 12:08:14 PM] [10367:RT239207] Completed post-processing actions for request 239207.


The syntax of the ADD_LAYOUT is as follows:
-- Name -- add_layout -- Purpose -- Called before submission to add layout options for request output. --
-- Arguments -- Template_APPL_Name -
Template Application Short name. --
Template_code - Template code --
Template_Language -
Template File language (iso value) --
Template_Territory - Template File Territory (iso value) --
Output Format - Output Format --
function add_layout (template_appl_name in varchar2, template_code in varchar2, template_language in varchar2, template_territory in varchar2, output_format in varchar2) return boolean;
I didn't try this solution..as dev intance is not availble some one cross check and confirm..in the mean time i will see whether it can be done with writing plsql wrapperPlz try this one set the layout in the after report trigger..hope this should avoid the wrapper

5 comments:

Unknown said...

Hi Murthy,

Thanks for your post on XML publisher.
My requirement is like the report need to display in a language based on a customer language.
I defined a different layouts for different languages.
While running the report manually by selecting the language or template then it runs in a particular language.
But i need to run it dynamically based on the customer language. Assume i have a query to get a customer language.
I tried addlayout api option in before report and after report trigger of my RDF. but it is not working.
Note: am registered the report using RDF for data and RTF template for layout thru a concurrent program.
Kindly suggest me an work around for this.

Anonymous said...

HI I WAS WORKING ON ORACLE REPORTS ..I HAVE A REQIREMENT THAT I NEED TO PRODUCE EXCEL OUTPUT FROM REPORT AFTER REGISTERING IT IN CONCURRENT PROGRAM..I HAVE ISSUES IN THAT,, IM GETTING PDF OUTPUT BUT STRUCKED WITH EXCEL OUTPUT

Unknown said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by the author.
Anonymous said...

hi

i am also searching for the same solution where i can set the default template through Code,
Can we apply layout by writing sql code for set_layout in conc. prog parameter.