1 Reply Latest reply: Jan 21, 2013 5:25 AM by tl*434940*hu RSS

    error when run report from PLSQL

    850256
      Hi all,

      I want to run the report from plsql but I have the error:

      SQL> exec generate_report('/u01/app/oracle/10.1.2/devbi/guicommon/tk/admin/TTF/fonttest.rdf');
      BEGIN generate_report('/u01/app/oracle/10.1.2/devbi/guicommon/tk/admin/TTF/fonttest.rdf'); END;

      *
      ERROR at line 1:
      ORA-31011: XML parsing failed
      ORA-19202: Error occurred in XML processing
      LPX-00243: element attribute value must be enclosed in quotes
      Error at line 4
      ORA-06512: at "XDB.DBMS_XMLPARSER", line 156
      ORA-06512: at "KMDW.SRW", line 313
      ORA-06512: at "KMDW.SRW", line 859
      ORA-06512: at "KMDW.GENERATE_REPORT", line 19
      ORA-06512: at line 1
      SQL>

      *******************************************************
      The source code of procedure "generate_report" is:
      CREATE OR REPLACE PROCEDURE KMDW.GENERATE_REPORT(p_report_name VARCHAR2)
      AS
      v_paramlist srw_paramlist;
      v_jobident srw.job_ident;
      v_status srw.status_record;
      BEGIN
      srw.start_debugging;
      v_paramlist := srw_paramlist(srw_parameter('', ''));
      srw.add_parameter(v_paramlist, 'GATEWAY', 'http://192.168.50.53:7778/reports/rwservlet?');
      srw.add_parameter(v_paramlist, 'SERVER', 'rep_dev');
      srw.add_parameter(v_paramlist, 'REPORT', p_report_name); --path to where report is
      srw.add_parameter(v_paramlist, 'USERID', 'eoc/eoc123456@eoc');
      srw.add_parameter(v_paramlist, 'DESTYPE', 'FILE');
      srw.add_parameter(v_paramlist, 'DESFORMAT', 'PDF');
      srw.add_parameter(v_paramlist, 'DESTINATION', '/u01/');path to where xml file
      srw.add_parameter(v_paramlist, 'DESTINATION', '/u01/distribution.xml');--path to where xml file
      srw.add_parameter(v_paramlist, 'DISTRIBUTE' , 'YES');
      v_jobident := srw.run_report(v_paramlist);
      v_status := srw.report_status(v_jobident);
      srw.stop_debugging;
      END;
      /

      ****************************************************************
      file distribution.xml
      <destinations>
      <file id="myfile1" name="/u01/report1.pdf" format="pdf">
      <include src="report"/>
      </file>
      <file id="myfile2" name="/u01/report2.pdf" format="pdf">
      <include src="report"/>
      </file>
      </destinations>

      Please advise me the solution,
      Thanks.
        • 1. Re: error when run report from PLSQL
          tl*434940*hu
          I know this question has been asked a long back, but seems to be unanswered.

          I found the solution for this, thought of documenting it somewhere.

          Removing ? from srw.add_parameter(v_paramlist, 'GATEWAY', 'http://192.168.50.53:7778/reports/rwservlet?'); will solve the problem.

          The question mark appended to the end is causing this error because SRW.add_parameter will add &paramname at the end if there is a question mark found in the url.

          Thanks & Regards
          Anantha