Forum Stats

  • 3,769,478 Users
  • 2,252,969 Discussions
  • 7,875,044 Comments

Discussions

Oracle form 12c- how to call the report without using report_object

SandyM
SandyM Member Posts: 59 Green Ribbon
edited Mar 7, 2021 7:42PM in Forms

I'm currently upgrading forms 6i to 12c, in 6i we don't use report object and pass the report name direclty in run_product. Is it possible to pass the report name directly without using report_object .find_report_object in forms 12c?

«1

Answers

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,897 Employee
    edited Mar 8, 2021 1:32PM

    You do not need to use "FIND_REPORT_OBJECT" however do need to properly set up the needed Report Object and its attributes.

    The only other way to call Reports is to use WEB.SHOW_DOCUMENT to request the report then use WEB.SHOW again to display the results. However, this is often not a good idea as there are security issues that must be carefully considered when doing this.

    Why not do it the recommended way, which is to use RUN_REPORT_OBJECT? In this case, modifying the code will be necessary but the result will be a more manageable than if rewriting the code to use WEB.SHOW or using the FMA to convert the code.

    That said, if you do not want to manually update the code you can use FMA. The FMA (Forms Migration Assistant) will create wrapper code to replace your RUN_PRODUCT calls.

    Refer to the document titled "Upgrading Oracle Forms 6i Applications" for more details. You should review the entire document, however for this topic refer specifically to Chapters 2 and 14.

    https://docs.oracle.com/en/middleware/developer-tools/forms/12.2.1.4/index.html

  • SandyM
    SandyM Member Posts: 59 Green Ribbon

    Thank you Michael.let me check and update

  • SandyM
    SandyM Member Posts: 59 Green Ribbon

    Hi Michael, I tried with RP2RRO.pll by replacing run_product with rp2rro.rp2rro_run_product ,but not working. In the single form I have around 10 report where report name will be selected based on data at run time. My issue is how to pass the report name without report object ? Can you please help me with example and also how to generate the reports in specific folder?

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,897 Employee
    edited Mar 8, 2021 3:27PM

    You do not need to use FIND_REPORT_OBJECT, although it is recommended as doing so makes the RRO call (and others) more efficient. Refer to the Builder Help for using SET_REPORT_OBJECT_PROPERTY and you will see that passing in either the RepID or name is acceptable.

    That said, there must be a report object to reference. If it is the case that one or more attributes are created dynamically then you should create can create one Report Object and set its attributes on the fly as needed before making the RUN_REPORT_OBJECT call.

    For example:

    SET_REPORT_OBJECT_PROPERTY('OurReportObject', REPORT_FILENAME, 'weekly_sales.rdf');
    ... 
    v_rep  := RUN_REPORT_OBJECT('OurReportObject');
    

    In addition to the Builder Help, refer to the Forms and Reports Integration guide found here:

    https://www.oracle.com/application-development/technologies/forms/forms.html#panel2

  • SandyM
    SandyM Member Posts: 59 Green Ribbon
    edited Mar 9, 2021 12:45PM

    Hi Michael, Thanks for your kindly advise. Now I have installed weblogic/forms./reports everything on my laptop to check the sample report. I'm able to print the report using web.show_document but facing below issue when I change the destype to file.

    The report terminated with error:

    REP-69: An internal error occurred REP-56133: Access is denied to write to the specified location. .

    I have followed ( Doc ID 2070662.1 )  but still the same. I'm logging to application with DB user_id not with AD account, hence I have provided even folder access to everyone . Can you please advise ?

    Declare

      xpath  varchar2(80);

      repid REPORT_OBJECT; 

      v_rep VARCHAR2(1000);

      rep_status VARCHAR2(20);  

      PL_ID PARAMLIST; 

      pr_nm varchar2(20):='PNM'; 

      P_FILE_NAME varchar2(100):='C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\reports\output\';

       

      v_rptserver varchar2(30):='MyServer1';

      v_host varchar2(20):='localhost';   

       

    begin

     xpath:='C:\Oracle\Middleware\Oracle_Home\reports\Dept.rdf';

    PL_ID := GET_PARAMETER_LIST(pr_nm); 

         

      if ID_NULL(PL_ID) = FALSE then 

          DESTROY_PARAMETER_LIST(PL_ID); 

          PL_ID := CREATE_PARAMETER_LIST(pr_nm);   

          IF ID_NULL(PL_ID) THEN  

           RAISE FORM_TRIGGER_FAILURE;   

          END IF; 

      ELSE 

       PL_ID := CREATE_PARAMETER_LIST(pr_nm);     

      END IF;

       repid := find_report_object('DEPT');  

      

      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,v_rptserver);

      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_FILENAME,xpath);    

      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');      

      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESNAME,P_FILE_NAME||'TEST'||'.pdf');

      v_rep := RUN_REPORT_OBJECT(repid,PL_ID);

      rep_status := REPORT_OBJECT_STATUS(v_rep);

    End;


    rwserver.conf

    <folderAccess>

       <read>C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\reports\output</read>

       <write>C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\reports\output</write>

      </folderAccess>

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,897 Employee

    Try not writing into the Oracle Home or the Domain. Change the location to something like: C:\temp\reports\output

    Be sure to create the empty directory before testing.

  • SandyM
    SandyM Member Posts: 59 Green Ribbon
    edited Mar 11, 2021 9:05AM

    I'm getting the same error if I call the report from form or run directly at the report server as below.

    REP-56132: Access is denied to the report definition file. Can you please help ?

    http://localhost:9002/reports/rwservlet?server=MyServer1&report=C:\Oracle\Middleware\Oracle_Home\reports\dept.rdf

    I have given folder access in rwserver.conf and followed the help document as well, no luck.

    <folderAccess>

    <read>C:\Temp\Reports\output</read>

    <write>C:\Temp\Reports\output</write>

    </folderAccess>

    Below is the output of showenv, Am i missing any configuration ?

    Oracle Reports Services - Server and Engine Environment Variables


    PATH C:\Oracle\Middleware\Oracle_Home\bin

    DISPLAY

    LD_LIBRARY_PATH

    ORACLE_HOME C:\Oracle\Middleware\Oracle_Home

    TNS_ADMIN C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\config\fmwconfig

    NLS_LANG AMERICAN_AMERICA.WE8MSWIN1252

    USER_NLS_LANG

    RW C:\Oracle\Middleware\Oracle_Home\reports

    REPORTS_PATH C:\Oracle\Middleware\Oracle_Home\reports;C:\Temp\Reports\output;

    REPORTS_TMP C:\TEMP

    REPORTS_TAGLIB_URI /WEB-INF/lib/reports_tld.jar

    java.class.path C:\Oracle\Middleware\Oracle_Home\jdbc\lib\ojdbc6dms.jar;C:\Oracle\Middleware\Oracle_Home\reports\jlib\rwrun.jar

    sourceDir C:\Oracle\Middleware\Oracle_Home\reports

    tempDir c:\Temp



    I can see the job owner is RWUser when running from report server , do we need to create this in DB? I'm really confused now.

    http://localhost:9002/reports/rwservlet/showjobs?server=MyServer1

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,897 Employee

    That a look at these MyOracleSupport documents:

    REP-69 And REP-56132 When Running a Report in 12c version 12.2.1.0 (Doc ID 2113022.1)

    REP-69 REP-56133 Errors When Trying to Run Reports With DESTYPE=FILE in Reports 12c (Doc ID 2070662.1)

  • SandyM
    SandyM Member Posts: 59 Green Ribbon
    edited Mar 12, 2021 1:15PM

    Thank you Michael, somehow able to print the report only in the path maintained under <write>C:\Temp\Reports\output</write>. My requirement will be at runtime policy folder will be created and reports needs to be printed inside the policy folder. How to give access ?

    I have tried with <write>C:\Temp\Reports\output\*</write> still not working.


    For example C:\Temp\Reports\output\JA2007722\Closing 001

    Do I need to install this below patch for the report version 12.2.1.4.0 ?

    https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=459761217447560&id=2107541.1&_adf.ctrl-state=1aofeh7ccc_9

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,897 Employee

    Wildcard characters are not supported in versions earlier than 12.2.1.3. If you are not already using 12.2.1.4, you should upgrade to it as soon as possible. Earlier versions are no longer entitled to error correction support.

    Refer to MyOracleSupport Note 2107541.1