4 Replies Latest reply on May 7, 2012 3:44 PM by Michael Ferrante-Oracle

    Calling report using RUN_PRODUCT on Forms 6i and 11g

      I have a form which calls a report. We are maintaining form's source code in FORMS 6i but the form has to be compiled and executed by FORMS 6i and 11g. We have to maintain source code in FORMS6i as we have clients running multiple version of FORMS. The report calling mechanism uses RUN_PRODUCT which is not supported by FORMS11g. Please suggest a method (other then RUN_REPORT_OBJECT) to support report calling simultaneously on FORMS6i and 11g.
      The reason for not using RUN_REPORT_OBJECT is that we don't want to attach report to form.

      Thanks and Regards
      Babar Baig
        • 1. Re: Calling report using RUN_PRODUCT on Forms 6i and 11g

          your in wrong forum,this is forms forum,plz post your thread on Report Forum.

          • 2. Re: Calling report using RUN_PRODUCT on Forms 6i and 11g
            Check this link..


            Hope this helps
            • 3. Re: Calling report using RUN_PRODUCT on Forms 6i and 11g
              You don't have to use run_report_object in web forms. Instead, you can use web.show_document(<the_full_report_url>).
              <the_full_report_url> is the same url you would use if you called the report directly from your browser (not via Forms).
              • 4. Re: Calling report using RUN_PRODUCT on Forms 6i and 11g
                Michael Ferrante-Oracle
                You said that you do not want to "attach" a report to the form. You do not have to attach any particular report to the form. You simply need to have an "object" for a report. Think of it as a place holder. So in the Object Navigator under "Reports" simply add a dummy entry. You don't really need to worry about its properties on the Property Palette either, although I would set values to properties which you believe should have desired "default" values. Once this object has been created, you can then programatically decide which report you want to run and exactly what properties should be set and to what value.

                Here is an example (slightly modified) of the code extracted from the white paper provided by Oracle regarding the Integration of Forms and Reports. In the form where this lives, it contains a dummy report object as I previously mentioned and text items on a canvas where the report name (.rdf) and path can be entered. There is also a text field for the Rep Server name and other settings, but these could easily be programatic entries rather than user defined.

                Keep in mind that this is a simplified example and you might need to modify the code to include other situations.
                     repid                REPORT_OBJECT; 
                     v_rep                varchar2(512); 
                     rep_status           varchar2(512); 
                       -- "REPORT1" is the dummy object created at design-time.
                       repid := find_report_object('REPORT1');
                -- Set Report Object properties 
                           SET_REPORT_OBJECT_PROPERTY(repid, REPORT_DESTYPE, CACHE);
                           SET_REPORT_OBJECT_PROPERTY(repid, REPORT_DESFORMAT, 'HTML'); 
                           -- Comm mode 1 = SYNCHRONOUS
                           -- Comm mode 2 = ASYNCHRONOUS
                           SET_REPORT_OBJECT_PROPERTY(repid, REPORT_COMM_MODE, 1);
                           SET_REPORT_OBJECT_PROPERTY(repid, REPORT_SERVER, :block1.SERVERNAME);           
                           SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME, :block1.REPNAME);
                -- Run report and get status
                           v_rep           := RUN_REPORT_OBJECT(repid); 
                          rep_status      := report_object_status(v_rep); 
                -- Wait for Reports to generate results
                    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') 
                          rep_status := report_object_status(v_rep); 
                    END LOOP; 
                -- If DESTYPE is appropriate for displaying to user, execute WEB.SHOW    
                    IF rep_status = 'FINISHED' THEN 
                    END IF;