Monday, 16 July 2012

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');


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 dev intance is not availble some one cross check and 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


Barcode in XML:

For generating reports with barcodes

1) You should have barcode font in your system i.e. Font name FREE3OF9 (Find as attachment)

2) Copy and paste the attached “Free 3of9” font in your machine directories “C:\WINDOWS\Fonts” and $JAVA_HOME\ lib\fonts

Example Java path “C:\Program Files\Java\j2re1.4.2_10\lib\fonts”

3) There is one configuration file i.e. file name is “xdo” as attachment)

4) Copy and paste the configuration file in your “XML Publisher Desktop\Template Builder for Word\config”

Example “C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\config”
?xml version = '5.5.0' encoding = 'UTF-8'?
config version="1.0.0" xmlns=""
font family="Free 3 of 9" style="normal" weight="normal"
truetype path="C:\Program Files\Java\j2re1.4.2_12\lib\fonts\FREE3OF9.TTF"/

include the tags..i removed the some problems when posting..check the configuration file once..

5) Once you have done the above setups, you can see the “Free 3of 9” font type under your MSWORD font.

6) Which column you have to display as barcode, just put this font to that column.

One thing to take care is convert the data to upper case before generating the XML
do it at the SQL level only..

No comments:

Post a Comment