Forum Stats

  • 3,872,457 Users
  • 2,266,425 Discussions
  • 7,911,207 Comments

Discussions

How and where can we set variable for report server to be used in every form redirecting to a Report

User_S7PVR
User_S7PVR Member Posts: 19 Green Ribbon

Problem Description

---------------------------------------------------

We have recently completed FMW, Forms and Reports 12.2.1.4.0 version.

We can run forms and reports successfully.

However in the code which redirects to reports from a form- this is a part of PL/SQL trigger block which calls report from a form.

-----------

SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT,'PDF');

SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,CACHE);

SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE,SYNCHRONOUS);

SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_SERVER,'rep_wls_reports_kbn1pp-oawl003');

vc_ReportServerJob:=RUN_REPORT_OBJECT(v_report_id);

vjob_id := substr(vc_ReportServerJob,instr(vc_ReportServerJob,'_',-1)+1);

vc_rep_status := REPORT_OBJECT_STATUS(vc_ReportServerJob);

IF vc_rep_status = 'FINISHED' THEN

WEB.SHOW_DOCUMENT('http://kbn1pp-oawl003:8002/reports/rwservlet/getjobid'|| vjob_id ||'?server=rep_wls_reports_kbn1pp-oawl003','_blank');

ELSE

message ('Report failed with error message '||vc_rep_status);

END IF;

WHILE vc_rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')

LOOP

vc_rep_status := report_object_status(vc_ReportServerJob);

END LOOP;

-------------------

We do not want to define Server name every time in code when redirecting to Report from a Form.

How and where we can set a global variable in configuration and use it in the code ?

Answers

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,479 Employee
    edited Mar 9, 2022 9:16PM

    There are several options. The most generic and effective (and secure) would be to use a proxy server (e.g. OHS) in front of WebLogic. The result would be that you would not need to provide server:port in the code at all. With OHS in front of WLS, the new code would look more like this:

    WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'|| vjob_id ||'?server=rep_wls_reports_kbn1pp-oawl003','_blank');

    Alternatively, if you didn't want to use the proxy idea, which as I said adds a layer of security, you could set the REPORTS_SERVER in the Forms environment configuration then read it in code. So something like this:

    o Add WLS_REPORTS_SRV=http://kbn1pp-oawl003:8002 to the Forms environment config (e.g. default.env)

    o Change your code to something more like this:

    ...
    IF vc_rep_status = 'FINISHED' THEN
    TOOL_ENV.GETVAR ('REPORTS_SERVER', REPSERVER);
    WEB.SHOW_DOCUMENT(REPSERVER || '/reports/rwservlet/getjobid' || vjob_id ||'?server=rep_wls_reports_kbn1pp-oawl003','_blank');
    ELSE
    ...
    

    Once this code is in place, it will not need to be changed again, at least as it relates to the host server. All you need to do is set the desired server value in the configuration, so no code change.


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM