10 Replies Latest reply: Oct 8, 2012 7:58 AM by Rzuluaga - Oracle-Oracle RSS

    Migrating report from 6i to 11g

    942420
      I am migrating reports from 6i to 11g.
      I am calling report from form. All the reports works fine.
      But in this report I have to pass parameter at runtime and report should save in pdf format at a given location.

      forms & report version : 11.1.2
      Database : 11g
      Operating system : windows 7 professional.

      Below is the code i am running.

      declare
      pl_name VARCHAR2(30) := 'tempdata';
      pl_id ParamList;
      x VARCHAR2(150);
      y NUMBER;
      repid REPORT_OBJECT;
      v_rep VARCHAR2(100);
      rep_status VARCHAR2(20);

      BEGIN
      repid := FIND_REPORT_OBJECT('MALWADKARCONSUMPTIONSTMTDBR1');
      pl_id := Create_Parameter_List(pl_name);

      Add_Parameter(pl_id,'background',TEXT_PARAMETER,'Yes');
      Add_Parameter(pl_id,'PARAMFORM',TEXT_PARAMETER,'NO');
      Add_Parameter(pl_id,'DESTYPE',TEXT_PARAMETER, 'FILE') ;
      Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER, 'PDF') ;
      Add_Parameter(pl_id,'VCOMPANY',TEXT_PARAMETER,:block50.COMPANYNAME);
      Add_Parameter(pl_id,'VLYCOMPANY',TEXT_PARAMETER,:block50.COMPANYNAME);
      Add_Parameter(pl_id,'FROMDATE',TEXT_PARAMETER,VFROMDATE); -- VFROMDATE calculated from query
      Add_Parameter(pl_id,'TODATE',TEXT_PARAMETER,:BLOCK50.DOCDATE);
      Add_Parameter(pl_id,'VACNAME',TEXT_PARAMETER,VACNAME); -- VACNAME calculated from query
      Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER, 'D:\dbr\'||vACNAME||' '||:BLOCK50.DOCDATE||'.PDF') ;

      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,RUNTIME);
      set_report_object_property(repid,report_filename,'D:\dbr\'||vACNAME||' '||:BLOCK50.DOCDATE||'.PDF' );
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,FILE);
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_adminserver_paresh-pc_asinst_1');

      y := LENGTH ('rep_adminserver_paresh-pc_asinst_1') + 2;
      x := RUN_REPORT_OBJECT (repid, pl_id);

      WEB.SHOW_DOCUMENT('http://PARESH-PC:7001/reports/rwservlet/getjobid'||SUBSTR(x, y)||'?server=rep_adminserver_paresh-pc_asinst_1&userid=scott/TIGER@ORCL');

      Destroy_parameter_list('tempdata');
      END;

      Above code doesn't show any error but report is not generated in the provided location.

      Is modification to be done in the above code?

      Please suggest.

      Thanks in advance.

      Edited by: parapr on Oct 2, 2012 1:30 AM
        • 1. Re: Migrating report from 6i to 11g
          Rzuluaga - Oracle-Oracle
          Hi,
          is the location "'D:\dbr...." where you want the report output to be saved a client folder or a folder on the Reports Server Machine? It needs to be a folder on the machine where Reports Server is running.

          Regards, Roberto
          • 2. Re: Migrating report from 6i to 11g
            942420
            Thanks for reply

            I want report to be saved on client location, but currrently I am running report on our development server where Oracle forms & reports are installed.

            I have started Weblogic server and node manager, But my report server is not starting.

            How could I start my report server.
            • 3. Re: Migrating report from 6i to 11g
              942420
              Thanks for your reply

              I want report to be saved on client machine, But currently I am running this form to call a report in our development server where Oracle forms & reports are installed.

              I have started Weblogic server and node manager, but my report server is not starting.

              How can I start report server.
              • 4. Re: Migrating report from 6i to 11g
                Rzuluaga - Oracle-Oracle
                Hi,
                if you want to save the report output on the client side then you can display report output on screen and then allow end-user to save it where they want. If that is not a valid option you can use WebUtil functionality to allow transfer report
                output from server to the client.

                Regarding to the reports server not starting. If you are using a standalone reports server then make sure you start it via opmnctl command. If you are using in-Process Reports Server then make sure WLS_REPORTS is up and running.
                Check if reports server is running with the following URL.
                e.g
                http://hostname:port/reports/rwservlet/showjobs?server=<reports server name>

                Regards, Roberto
                • 5. Re: Migrating report from 6i to 11g
                  942420
                  Hi Roberto,

                  What you are saying is right, but I want to know that the code which I have posted is correct or should any modification is to be needed in that.

                  http://hostname:port/reports/rwservlet/showjobs?server=<reports server name>

                  I run above url, its working fine as shows status of last run jobs.

                  How would I know that I am using standalone reports server OR in-Process Reports Server.

                  Thanks for your help.
                  • 6. Re: Migrating report from 6i to 11g
                    Rzuluaga - Oracle-Oracle
                    Hi,
                    from the code you pasted you have the following.
                    e.g
                    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_adminserver_paresh-pc_asinst_1');

                    That means that you are using a standalone reports server but that is the code that you are using in your development environment. You need to decide which reports server are you going to use in your deployment environment and then
                    change that parameter there. If you will use the in-process reports server then you do not need to pass the name of the reports server because by default it is defined in rwservlet.propeorties file so the report request will be send to in-process by default.

                    Thanks, roberto
                    • 7. Re: Migrating report from 6i to 11g
                      942420
                      We are using standalone report server (i.e rep_adminserver_paresh-pc_asinst_1) only and it has a entry in rwservlet.properties file.

                      We are using same code for our development environment.
                      • 8. Re: Migrating report from 6i to 11g
                        Rzuluaga - Oracle-Oracle
                        ok. What is the error you are getting when trying to run the report on the deployment machine?
                        • 9. Re: Migrating report from 6i to 11g
                          942420
                          Hi Roberto,

                          I am calling report from form and it should be saved to some destination folder.

                          Using above posted code I calling report, but it is not running and not showing any error.
                          • 10. Re: Migrating report from 6i to 11g
                            Rzuluaga - Oracle-Oracle
                            Hi,
                            as stated before if the desname value is pointing to the client filesystem it wont create the output there because Reports Server is not running on the client, it is running on the server as this is the way it is.
                            If you want to save output to the client you need to use the options mentioned before.
                            For testing purposes only change your code as follows.
                            e.g
                            Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER, 'c:\'||vACNAME||' '||:BLOCK50.DOCDATE||'.PDF') ;

                            As you can see I changed the original folder name to C:\ .. (I hope your reports serve is running on a Windows machine if not then changed to /tmp). Run your form and check c:\ or /tmp and see if you see the report output there. If so,
                            than your code is fine the only problem is what I have already stated.

                            Regards, Roberto