6 Replies Latest reply: Jan 24, 2013 11:11 PM by yash_08031983 RSS

    how to get the html or pdf file name based on report_job_id ?

    yash_08031983
      hello experts,
      when we run a report then, file is generated against the report_job_id. i want to get that file name?

      please help me.

      thanks
      yash
        • 1. Re: how to get the html or pdf file name based on report_job_id ?
          AlexDiniasi
          Hello

          If if the report is generated from forms, you can use web.show_document along with getjobid:

          WEB.SHOW_DOCUMENT('http://machine:port/reports/rwservlet/getjobid'||your_job_id||'?'||'server='||reportServer,'_blank');

          or you can access the job id directly from the browser:
          http://machine:port/reports/rwservlet/getjobidyour_job_id?server=yourreportServer


          Example:
          http://testsrv:8889/reports/rwservlet/getjobid83?server=rep_serv

          Kind regards,
          Alex

          If someone's answer is helpful or correct please mark it accordingly.
          • 2. Re: how to get the html or pdf file name based on report_job_id ?
            yash_08031983
            thanks alex,
            i am trying to take the report output in text form for this i do the following,

            my requirement is , generate the output in text or excell at server and open that file in clients browser with the help of web.show_document
                 DES_FILE_NAME := to_char(sysdate,'ddmmyy_hh24miss')||'.txt';
                 REPID := FIND_REPORT_OBJECT('RP2RRO');
                 set_report_object_property(repid,report_filename,FILE_NAME);
                 set_report_object_property(repid,report_server,REP_SERVER);
                 set_report_object_property(repid,report_execution_mode,BATCH);
                 set_report_object_property(repid,report_comm_mode,synchronous);
                 set_report_object_property(repid,report_destype,FILE);
                 SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_DESNAME,'E:\TEST\'||DES_FILE_NAME);
            
            ------------------------------- parameter list creation---------------------------------------------
            pl_id := Create_Parameter_List('tmpdata'); 
                                 Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
                            Add_Parameter(pl_id,'locn_code',TEXT_PARAMETER,:global.company_gl_locn);
                           Add_Parameter(pl_id,'comp',TEXT_PARAMETER,:global.company_name);
                              Add_Parameter(pl_id,'from_party',TEXT_PARAMETER,:from_item);
                                    Add_Parameter(pl_id,'itnm',TEXT_PARAMETER,:from_desc);
                                    Add_Parameter(pl_id,'itm_cd',TEXT_PARAMETER,:from_item);
                                    Add_Parameter(pl_id,'to_cd',TEXT_PARAMETER,:to_item);
                                    Add_Parameter(pl_id,'price_type',TEXT_PARAMETER,:price);
                                    Add_Parameter(pl_id,'UOM',TEXT_PARAMETER,:uom_code);
                                    Add_Parameter(pl_id,'foxcd',TEXT_PARAMETER,:fox_cd);
                                  
            
            ----------------------------------------CODE TO CALL REPORT THROUGH RUN_REPORT_OBJECT---------------------------
            
            REPORT_SERVER_JOB := RUN_REPORT_OBJECT(REPID,PL_ID);
            REPORT_JOB_ID := SUBSTR(REPORT_SERVER_JOB,LENGTH(REP_SERVER)+2,LENGTH(REPORT_SERVER_JOB));
            REPORT_STATUS := REPORT_OBJECT_STATUS(REPORT_SERVER_JOB);
            
            IF REPORT_STATUS ='FINISHED' THEN
            --     web.show_document('http://'||'192.168.1.216:8889'||'/reports/rwser
            --vlet/getjobid'|| REPORT_JOB_ID||'?
            --server='||REP_SERVER,'_blank'); 
            
            WEB.SHOW_DOCUMENT('http://'||'192.168.1.216'||'/test/'||DES_FILE_NAME,'_BLANK');
            ELSE
                 message ('error when running report'||REPORT_STATUS);
            end if; 
            note: test is folder create in e: drive at server. and i wanted to open that text file in browser.
            but The page cannot be displayed error is showing in browser.....

            please help me to sort out this

            thanks
            yash
            • 3. Re: how to get the html or pdf file name based on report_job_id ?
              AlexDiniasi
              Hello,

              Did you create a virtual mapping in httpd.conf for test directory?
              Otherwise you will not be able to access:http://192.168.1.216/test/

              Kind regards,
              Alex
              • 4. Re: how to get the html or pdf file name based on report_job_id ?
                yash_08031983
                no, i did not create the vertual directory. please let me know how to create it, as
                i don't know how to create?

                thanks
                yash
                • 5. Re: how to get the html or pdf file name based on report_job_id ?
                  AlexDiniasi
                  Hello,

                  1. Using the current directory: E:\TEST\.

                  2. open the Oracle HTTP Server httpd.conf file and add the following ->


                  Alias /rep_files/ "E:\TEST\"


                  3. Stop and start the Forms services.

                  4. Test that the mapping is correct by a accessing a file from the E:\TEST ->

                  http://192.168.1.216:8889/rep_files/<file name>

                  Kind regards,
                  Alex
                  • 6. Re: how to get the html or pdf file name based on report_job_id ?
                    yash_08031983
                    i install the appache 2.2.9 and add the alias in httpd file as:
                    -----------------------------------------
                    alias /mytest "d:\test"
                    <Directory "d:\test"> 
                             Order allow,deny 
                          Allow from all 
                         </Directory> 
                    --------------------------------------
                    when i run the
                    http://192.168.1.34/

                    in browser text shows: its working

                    its means apache server is running well.


                    now i start the form service.

                    after that i take a button on canvac :

                    button code:
                    web.show_document('http://192.168.1.34/mytest/abc.txt','_blank');

                    abc.txt is a html page in d:\test folder.

                    text file as well as excell file opened.

                    thanks alex for help.

                    i then try same url from other system in network. page can not display erro is comming.
                    is some browser setting is restricting it. or some permission have to set for alias.





                    thanks
                    yash

                    Edited by: yash_08031983 on Jan 24, 2013 9:07 PM