2 Replies Latest reply on Apr 14, 2014 2:17 PM by Mike Kutz

    Multiquery PDF report




      I have a requirement where I need to add more than 2 queries to generate my XML for the PDF report. The current setup allows me to to add multiple queries, however there is no mechanism to connect the queries.


      For example I need this


      <EMP LOOP>



           <Emp Number>

           <Orders LOOP>

                <Order number>

                <Customer name>

           </Orders LOOP>

           <Sales LOOP>

                <Sales Value>

                <Sales Amount>    

           </Sales LOOP>

      </EMP LOOP>


      For this I can write three queries with independent transactions. However I cant link them. Like I could do in RDF or even in PLSQL. As a result of that, my query prints all employees together and then prints all Orders , and finally all sales. There is no looping. How do I achieve this?

        • 1. Re: Multiquery PDF report

          Looping, or better known as Grouping, is possible.  What tool are you using to build your template?  For the BI Publisher Microsoft Word plug-in, this is fairly easy to do.  If you need to create an XSL-FO template, then you're going to find things become more complex.  I just recently attempted to create an XSL-FO template using third party tools to allow me to group data.  The problem is that, as of now with PDF printing via ORDS 2.0.6 (or less), only XSLT version 1.0 is supported.  Grouping can be done in 1.0, using various hand-coding methods such as the Meunchian Method, but the actual <current-group> syntax is not supported in 1.0.  I'm not that good at hand-coding XSL-FO, so I had to abandon my report project.  XSLT 2.0, and the tools that help you to create XSL in that version, make grouping a relatively easy affair.

          • 2. Re: Multiquery PDF report
            Mike Kutz

            The APIs  (APEX_UTIL.GET_PRINT_DOCUMENT()/DOWNLOAD_PRINT_DOCUMENT()) are missing a necessary 5th signature that would make this very easy... (takes in XML/CLOB for data and Report Name for layout.)

            You'll need to use the signature that takes in XML/CLOB for the data and XML/CLOB for the Layout.


            Be aware, the Listener/ORDS doesn't like a particulate UTF8 character in the layout - i forgot what it was but you can see it in the Log files of the app server.

            Also, check this form for that problem.