4 Replies Latest reply: May 7, 2012 8:17 AM by InoL RSS

    Generate multiple pdf files without showing on the screen

    18865
      I need to generate many pdf file in a particular folder so I'm using web.show_document in a loop, but for each record it opens up Internet explorer window and I have thousands of records.
      How to generate pdf files without showing on the screen? I'm using Forms 10g.
      It was easily done in Forms 6i

      any suggestions?
      Thanks
      Tariq
        • 1. Re: Generate multiple pdf files without showing on the screen
          932794
          Hi,
          Just an idea, I've never tried this....
          Using webutil (WebUtil_File_Transfer.URL_To_Client)
          Cheers
          LS
          • 2. Re: Generate multiple pdf files without showing on the screen
            18865
            Thanks, but I don't think it will resolve my issue. I'm using below in a loop

            web.show_document('http://....../rwservlet?userlogin&server=rep_TAKUAT_PORTAL_BAJDMD&desformat=PDF&destype=file&desname=d:\apps\bajuat\'||i.v_policy_no||'.pdf&report=d:\apps\bajuat\Annual_Cust_Stat_PRN&paramform=NO&contract_NO='||i.v_POLICY_NO,'_blank');

            but it opens up thousands of IE windows
            I just need to generate pdf files without opening any IE window.

            Thanks
            Tariq
            • 3. Re: Generate multiple pdf files without showing on the screen
              932794
              Hi,
              I've managed to do this using webutil. Following is the code... This assumes that your report is running synchronously (i.e. REPORT_COMM_MODE = SYNCHRONOUS)

              ReportServerJob := run_report_object(report_id);
              rep_status := report_object_status(ReportServerJob);

              IF rep_status = 'FINISHED' THEN
              v_URLin := lc_report_servlet || 'getjobid=' || SUBSTR(ReportServerJob, INSTR(ReportServerJob, '_', -1) +1) || '?' || 'server=' || report_server_name;
              -- This will copy the file from report server to c:\temp\
              v_result:= WebUtil_File_Transfer.URL_To_Client_With_Progress(v_URLin,'c:\temp\test.pdf',0,'Download','Save','Saving Output File');

              IF v_result = TRUE THEN
              -- Then use open it up to the user
              pid1 := webutil_host.nonblocking ( 'cmd.exe /C c:\temp\test.pdf' ) ;
              show_my_alert('SUCCESS');
              ELSE
              show_my_alert('FAILED');
              END IF;
              END IF;

              Thanks
              • 4. Re: Generate multiple pdf files without showing on the screen
                InoL
                You shouldn't use web.show_document, but run_report_object.
                Web.show_document is only used to view the output of the report after the report is finished. If you don't want to view the output, but just leave the generated pdf files in the directory, don't call web.show_document after run_report_object.