Invoking XML Publisher Report from PL/SQL

Hi,
I have a PL/SQL procecedure which invokes the Concurrent Request for the XML Publisher Report. This one finishes with a warning and I get 'Unable to publish output' when I try to view the output. Exact Error: "Unable to find the published output for this request "
But if I run the same report using Concurrent program, the Report executes with no error. Also the desired output is coming. I am not sure where I am doing wrong in code.
My code which invokes the XML Publisher Report (from PL/SQL package)is something like this:
declare
x boolean;
l_no_of_copies varchar2(45);
l_printername varchar2(45);
l_print_style varchar2(45);
l_result boolean;
y number;
begin
x := fnd_request.add_layout (template_appl_name => 'XXTMG', template_code => 'XXT_5001_BOL_T', template_language => 'EN', template_territory => 'US', output_format => 'XML');
l_no_of_copies := fnd_profile.VALUE ('XXTMG_SH_BOL_REPORT_NO_OF_COPIES');
l_printername := fnd_profile.VALUE ('XXTMG_SH_BOL_REPORT_PRINTER');
l_print_style := NULL; --For setting the Printer Options
l_result := fnd_request.set_print_options (l_printername, l_print_style, l_no_of_copies, TRUE, 'N');
l_result := fnd_request.add_printer (l_printername, 0);
y := fnd_request.submit_request ('XXTMG', 'XXT_5001_BOL', '', TO_CHAR (SYSDATE, 'YYYY/MM/DD HH24:MI:SS'), FALSE, 'CH-120079') ;
end;
Please let me know where I might be going wrong
Thanks

Hi Sumit,
You can try with this code:
exec dbms_application_info.set_client_info(org_id)
exec fnd_global.APPS_INITIALIZE(user_id,resp_id,appl_id);
declare
x boolean;
l_no_of_copies varchar2(45);
l_printername varchar2(45);
l_print_style varchar2(45);
l_result boolean;
y number;
begin
x := fnd_request.add_layout ('XXTMG' --template_appl_name 
          ,'XXT_5001_BOL_T' --template_code
          ,'en' --template_language 
     ,'US' --template_territory
     ,'XML' --output_format
if (x=TRUE) then
y := fnd_request.submit_request (
                    'XXTMG'           --application 
                    ,'XXT_5001_BOL'      --program
                    ,SYSDATE          --start_time
                    ,FALSE               --sub_request
                    ,'CH-120079'          --argument1 (Program's Parameter)
if y>0 then
          dbms_output.put_line('Request ID '||y);
end if;
end if; --if (x=TRUE) then
end;
Make sure that program has only one input parameter. If program has other parameters then you can pass those parameters like argument1, argument2... etc.
Now you can see this submited request in your application using your user id. If you able to see your request in concurrent request then you can add printer parameters in this programs.
You don't need to pass all 100 parameters.
I am executing many programs/reports using this code.
Thanks
Ravi
[email protected]
Message was edited by:
Ravi Tripathi

Similar Messages

  • How to invoke XML publisher report from APPS 11i forms

    I have a requirement in oracle application forms menu where I need to call the XML publisher report when user clicks the menu item.
    I am using following two API's
    fnd_request.add_layout
    fnd_request.submit_request
    But I am getting the error message
    java.sql.SQLException: No corresponding LOB data found :SELECT L.FILE_DATA FILE_DATA.......
    your help is truly appreciated.
    Thanks
    Siva

    I have registered the report using admin responsibility and ran the reprt form SRS and completed successfully. Eeven from the forms it is submitting the request but the request completed as warning with above message. I can see the out put by clicking the View XML button but it unable to publish output.
    Thanks guru your quick response.
    Thanks
    siva

  • XML Publisher Report with PL/SQL

    Hi
    Like to know how to develop the XML Publisher Report with PL/SQL, i did the following
    1. created a pkg like as below
    CREATE OR REPLACE PACKAGE BODY APPS.TEST_XMLTAG_PKG AS
    PROCEDURE main (errbuf OUT VARCHAR2,
    retcode OUT NUMBER
    ) IS
    BEGIN
    DECLARE
    ctx DBMS_XMLGEN.ctxHandle;
    xml CLOB;
    BEGIN
    ctx := dbms_xmlgen.newcontext('select * from scott.emp');
    dbms_xmlgen.setrowtag(ctx, 'MY-ROW-START-HERE');
    xml := dbms_xmlgen.getxml(ctx);
    dbms_output.put_line(xml);
    Fnd_file.put_line (fnd_file.LOG, XML);
    END;
    END;
    END TEST_XMLTAG_PKG;
    this pkg produces the output with xml tag in the view log.
    I have registered the conc program & xml rtf but it does not produce the output in PDF, , I am not able to get the xml tag when i click the Diagnostics --> View XML.
    can you please let me know the next steps involved.
    Regards
    Yram

    I think the problem is because there is no begin and end tag. save the xml from the logfile and open with xml editor or IE.. then you will see the problem.
    add Begin and end tag...then you should be fine.. i.e
    fnd_file.put_line(fnd_file.output,'<EMP_DATA>'); -- begin Tag
    tx := dbms_xmlgen.newcontext('select * from scott.emp');
    dbms_xmlgen.setrowtag(ctx, 'MY-ROW-START-HERE');
    xml := dbms_xmlgen.getxml(ctx);
    dbms_output.put_line(xml);
    Fnd_file.put_line (fnd_file.LOG, XML);
    fnd_file.put_line(fnd_file.output,'</EMP_DATA>'); -- End Tag
    Hope this helps..>Good Luck
    Ravi

  • How to generate XML Publisher report from PLSQL Stored Procedure in APPS

    Hi,
    I have concurrent program of type PLSQL Stored procedure.I need to generate XML Publisher report from the same.I have changed the output of the concurrent program as "XML" but when I tried running it,the XML tags are not generated.Due to this I am unable to create the template.Its a urgent issue.
    Please help me out .
    Thanks in advance.
    Kaveri

    Hi Kaveri
    Sadly there is nothing magic about that output field. The only program type that you can flip it to XML and then magically get XML is for Oracle Reports. For plsql you will need to recode the plsql to generate XML rather than text that you have now.
    You have some options, best option first:
    1. Move the sql to a data template - check the user guide and blog for help or
    2. Use SQL XML or XMLGEN (not great for large datasets) or
    3. Use dbms_output.put_line and write the XML file manually - not performant at all
    Regards, Tim

  • How to invoke XML Publisher report in 11i

    Can anybody please guide me on How can we invoke xml publisher report in 11i and how can we call XML publisher report from form or OA framework.
    Thanks

    Hi
    1. From a form ... a little tricky. Forms 6i has v limited java support so calling the XMLP apis directly is going to be tough. We do have a few products and customers that do it, here are a few scenarios:
    a. Have a button/menu item to call the report, this actually kicks off the concurrent manager to submit a report that XMLP will format
    b. Have a button that calls the plsql package, 'htp', this in turn can call an OA page where a report can be rendered in the page.
    2. From OAF page - much easier. You can call the TemplateHelper API form your page passing data, template reference, lang, terr, output format - the API will return the output.
    For the OAF approach and option'b' for forms I would recommend using the XMLP common region. This is a region that can be plugged into your custom page. Its very configurable - you can point it to a concurrent request, a completed document e.g. a PDF doc, you can pass it XML data from your BC4J objects or a data template. You can then configure what changes the user can make, change template, language, locale, output - please check the user guide for details on the Common Region.
    Tim

  • Call Xml Publisher report from Jdeveloper

    Hi,
    I am first time integrating XML publisher with Jdevloper.
    I need to call xml publisher report from Jdeveloper.
    I followed all steps from anilpassi link for sample
    its showing error while tring to open pdf file
    Error:
    Adobe Reader could not find 'EmpReport[1].pdf' because it is either not a supported file type or because the file has been damaged.
    Please help ,i m stuvk because of this error.
    below is the code
    EmpCO :
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModuleImpl am =
    (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
    am.invokeMethod("initEmpVO");
    // am.invokeMethod("getEmpDataXML");
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModuleImpl am =
    (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
    if ("GenerateReport".equals(pageContext.getParameter(EVENT_PARAM)))
    System.out.println("event fired");
    // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
    DataObject sessionDictionary =
    (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response =
    (HttpServletResponse)sessionDictionary.selectValue(null,
    "HttpServletResponse");
    try
    System.out.println("inside try");
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=EmpReport.pdf";
    response.setHeader("Content-Disposition", contentDisposition);
    response.setContentType("application/pdf");
    // Get the Data XML File as the XMLNode
    XMLNode xmlNode = (XMLNode)am.invokeMethod("getEmpDataXML");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlNode.print(outputStream);
    ByteArrayInputStream inputStream =
    new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    //Generate the PDF Report.
    TemplateHelper.processTemplate(((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    APP_NAME, TEMPLATE_CODE,
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF, null,
    pdfFile);
    // Write the PDF Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    catch (IOException e) {
    System.out.println("Exception1"+e);
    } catch (SQLException e) {
    System.out.println("Exception2"+e);
    } catch (XDOException e) {
    System.out.println("Exception3"+e);
    pageContext.setDocumentRendered(false);
    EmpAMImpl:
    public void initEmpVO() {
    EmpVOImpl vo = getEmpVO1();
    if (vo == null) {
    MessageToken errTokens[] =
    { new MessageToken("OBJECT_NAME", "EmpVO1") };
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    } else {
    vo.executeQuery();
    public XMLNode getEmpDataXML() {
    OAViewObject vo = (OAViewObject)findViewObject("EmpVO1");
    XMLNode xmlNode =
    (XMLNode)vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);
    return xmlNode;
    Please help !!

    Hi,
    I tried the way suggested by Anil in the above link as well today, but still am getting the same error while openning the pdf .
    Dont know why it shows error that either the file is not a supported file type or because the file is damaged.
    Please suggest way to solve this error or some other way of calling xml report from OAF page.
    Edited by: user13573749 on Apr 10, 2011 9:59 PM

  • Submitting a XML Publisher Report from JSP page

    Hello,
    We have need to submit a XML Publisher report from Quoting/iStore module in Oracle Ebusiness. The out put should be viewable in PDF format and user should be able to print. can anyone pls help on how this can be achieved.
    TIA

    Really appreciate your response. Can you pls give little more details.
    1] Are there any standard API's which I can use to submit XML publisher report from the JSP pages
    2]Is there any sample code snippet for any of the options that I can refer to..or pls let me know the API's, I will check on them
    Appreciate any help

  • Displaying xml publisher report from adf page.

    I am using jdev 10.1.3.3
    I have an requirment of displaying an xml publisher report on click of command button.
    any suggestion.how this can be achived.
    according to my understanding.
    if we create a folder in our web server which oc4j in our case.and we transfer the xml report through FTP in that folder.can we able to pick the report from that folder.
    can we display or call that report.please let me know??
    Is that possible.????????????
    any help would be helpfull

    Really appreciate your response. Can you pls give little more details.
    1] Are there any standard API's which I can use to submit XML publisher report from the JSP pages
    2]Is there any sample code snippet for any of the options that I can refer to..or pls let me know the API's, I will check on them
    Appreciate any help

  • Running custom BI (XML) publisher report from BPEL

    We would like to run a custom BI publisher (XML publisher) report from BPEL process and the resultant PDF report output needs to be FTPed to specific location. BPEL can pass on the XML content required for the report.
    Is this possible or any workaround for this ?

    Any light on this ?

  • Calling a XML Publisher report  from FND_SUBMIT_REQUEST

    Hi,
    I need to submit a XMLP report from FND_SUBMIT_REQUEST.
    The report will have say, 4 templates for 4 seperate languages.
    Now, when i call the report from submit request, i need to give the name of a template that will get attached.
    Does anybody have any idea which parameter in the submit request parameter list takes the name of a template?
    Please let me know if anybody has any info on this.
    Can mail me at [email protected]
    Regards,
    Satrajit

    Hi,
    You can use FND_REQUEST.SUBMIT_REQUEST for submitting the report. The syntax is as follows:
    function FND_REQUEST.SUBMIT_REQUEST
    (application IN varchar2 default NULL,
    program IN varchar2 default NULL,
    description IN varchar2 default NULL,
    start_time IN varchar2 default NULL,
    sub_request IN boolean default FALSE
    argument1,
    argument2, ..., argument99,
    argument100) return number;
    Here is the code that I used for submitting XML Report Publisher from within my Oracle Report's AfterReport trigger. The parameters are explained.
    a:=FND_REQUEST.SUBMIT_REQUEST('XDO', 'XDOREPPB','Varun XML Report Printing', NULL, FALSE, :P_CONC_REQUEST_ID , 'MYONT','MY_PREPACK_XML','en-US' ,'N', 'RTF', :p_output_format,NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL );
    srw.message(123,'Value of New Request : ' || a ||' Output Format :'||:p_output_format);
    Hope it helps.
    Thanks
    Varun

  • Calling a xml publisher report from Ebs - question

    Hi,
    I know how to call a xml report from ebs using concurrent manager. But i want to open it from a form in application.
    My situation is this:
    There is a form in the payables modelue, where i search for all the invoices.
    There is also a button action in this form wich take the id of the row in wich it is my position and open a rtf raport with this id.
    What i need to do is to call my xml report in this button . To pass my raport the id of the row in wich i am and open my report with paramateres.
    Can this be done? Has anyone tried this before?
    Thanks in advance,
    Best regards

    Hi,
    You can use FND_REQUEST.SUBMIT_REQUEST for submitting the report. The syntax is as follows:
    function FND_REQUEST.SUBMIT_REQUEST
    (application IN varchar2 default NULL,
    program IN varchar2 default NULL,
    description IN varchar2 default NULL,
    start_time IN varchar2 default NULL,
    sub_request IN boolean default FALSE
    argument1,
    argument2, ..., argument99,
    argument100) return number;
    Here is the code that I used for submitting XML Report Publisher from within my Oracle Report's AfterReport trigger. The parameters are explained.
    a:=FND_REQUEST.SUBMIT_REQUEST('XDO', 'XDOREPPB','Varun XML Report Printing', NULL, FALSE, :P_CONC_REQUEST_ID , 'MYONT','MY_PREPACK_XML','en-US' ,'N', 'RTF', :p_output_format,NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL );
    srw.message(123,'Value of New Request : ' || a ||' Output Format :'||:p_output_format);
    Hope it helps.
    Thanks
    Varun

  • Scratch 22: Creating XML Publisher report from scratch in eBS

    Problem:
    How to build a XML Publisher (XMLP) report in eBS from scratch. Thus NOT adapting or converting an existing report.
    Context:
    I have an eBS R12 Vision instance up and running where I want to learn building XMLP reports.
    This is what all tutorials I can find tell me to do:
    Most reports apparently consist of a layout template e.g. TEST.rtf and a data template e.g. TEST.xml. Now in order to generate a new report layout I am supposed to take existing output in XML format and (using ‘Load Data’ function in Template Builder plugin in Word) specify in my layout template where and how I want the actual data to pop up. So far so good.
    But now I want to build the data template from scratch and use it combined with a layout template. So I build the data template but can’t use that for building the layout template. For that I need output, for which I need a layout template.....
    Sounds like Catch 22 to me. How do I break this?
    1. Can I generate an XML-output file from the XML Data Template alone?
    2. Can I build my (RTF) layout template directly based upon the XML Data Template?
    3. Or have I completely lost the plot?
    Oh yes, dunno the first thing about Java and do not have My Oracle Support..
    Edited by: rjvencken on Jul 5, 2012 10:39 AM
    Edited by: rjvencken on Jul 5, 2012 10:51 AM

    1. Can I generate an XML-output file from the XML Data Template alone?
    create data definition with your data template-> create concurrent -> output as xml -> run -> view output and your xml
    I thought the XDODTEXE engine would pick up the (Layout) Template through concurrent program definition CPD short name which in turn points to the Data Definition (and thus Data Template). So does your answer mean I can call straight from CPD to Data Definition? I tried registering my Data Template in the Template Tab but it will not take XML as a type.2. Can I build my (RTF) layout template directly based upon the XML Data Template?
    if you want to use xml publisher desktop then you need xml (with data, not definition)
    So that's not an option I understand. Weird cuz I'd expect this to be technically easier.btw you can create your layout (rtf) without xml (data) and without data template (xml with select statement)
    create filed and past tag definition
    Yes but in that case I'd have an empty report. How would that help me?bouble click on filed:
    "Text Form Field Options" -> "Add Help Text ..." -> "Status Bar" (tab) -> "Type your own:"
    if you use bi publisher desktop plugin
    bouble click on filed:
    "BI Publisher Properties" -> "Advanced" -> "Code"
    or switch to Word Properties
    "BI Publisher Properties" -> "Word Properties" and use above path
    3. Or have I completely lost the plot?
    may be ;)

  • Call BI Publisher report from PL/SQL

    Hi,
    I was looking for a solution to "download" a PDF report from BI Publisher in a PL/SQL procedure. After the download, I need to insert it into a table.
    I can't believe noone ever done this, but I can't find a good solution.
    Thanks,
    Jan

    intersting...
    look at java api
    so as idea you can try to use java for working with report in database then wrap it by plsql and use
    look at Oracle&amp;reg; Fusion Middleware Developer's Guide for Oracle Business Intelligence Publisher 11g Release 1 (11.1.1) - …
    7 Using the BI Publisher Java APIs
    8 Using the Delivery Manager Java APIs

  • Calling XML Publisher Report from OAF using the conc programs xml output

    Hi all
    I am trying to call a report from oa Framework. I have developed the Template in the Ms-Word and for Generating the xml data i used the view object defined in OAF, this approach is working for me...i used the following code to do this in the AM as mentioned in many places...
    public XMLNode getEmpDataXML()
    OAViewObject vo = (OAViewObject)findViewObject("EmpVO1");
    XMLNode xmlNode = (XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);
    return xmlNode;
    now i want that instead of the view object i should use the xml generated by the report which is registered as concurrnet program with output as xml.
    I am submitting the concurrent program and able to get the request id ...
    Now from here what should i do.. please suggest...

    Hi,
    I am thinking of doing something very similar. What i was planning on doing is submitting the request, and then redirecting the user to the concurrent request page. They can then use the standard functionality to view output and get the xml to use the appropriate template.
    i would be interested in how you get the concurrent request id from the submitted job.
    Many thanks
    Rupesh

  • Accessing XML Publisher Reports from Java application

    How to accesss the XDO Reports from Java application?
    I am wondering that we need to get the URL for accessing the report and call the URL with in Java program?
    Is that right? Is there any other option? Any help is greatly appreciated.

    You need to write some class based on the BI Publisher APIs taking data, template, output format, etc.
    Pehaps the following Blog of Tim Dexter shines some light on your question
    http://blogs.oracle.com/xmlpublisher/2007/02/27#a166
    Marcos

Maybe you are looking for

  • Vendor email ID

    Hi experts, I need to take a all vendor email Id for a particular plant. the solution given as Use table - LFA1 and ADR6 and field SMTP ADDR. + T code SE11 and LFA1 +Get the address number from field ADRNR + Then from ADR6 table get the record for AD

  • AD integration, making AD groups members of OD groups

    Hello everyone! I have a 10.4.8 server bound to AD. It is an OD master. On order to define Mac OS X preferences for my users/client computers, I need to work with OD groups. So I create a new OD group, and grab the appropriate AD user groups and make

  • Crystal Report with Windows Vista Home Premium

    (Why I added Code and my paragraph becomes dis-order??) Dear all, This is my first post in this forum. So, if I put at wrong section, Mod please kindly move my thread. Here is what I'm facing now. I have an application which is coded in Visual Studio

  • Final Cut Pro X looks out of place in yosmite

    In yosmite fcpx looks really weird... Its icon and overall design hasn't been updated for yosmite

  • Searching word docs with verity - strange problem

    I am searching word documents using cfsearch. These documents are basically forms. Some of the fields such as name etc. are with back fill enable for user input. So if I search the names in this field with back fill I get 0 records. If it's a plain t