Hi!
I am new to oracle forms and reports 12c. I've been developing forms and reports on the older versions for quite some time now(forms and reports 6i). I've tried creating a basic report and save it in my reports path then I made a simple form with just 1 button to call the report. No need to pass parameters whatsoever. When I press the button after running the form on web, an error message pops up "FRM-41214 unable to run report" followed by "FRM-41217 unable to get job status".
When I check the jobs at http://localhost:9002/reports/rwservlet/showjobs and there are multiple jobs in the table.
I also tried calling the report directly at the web browser and the reports loads successfully http://localhost:9002/reports/rwservlet/getjobid14?server=rep_wls_reports_desktop-6d63e3t
Here is whats inside my button trigger
DECLARE
v_repid REPORT_OBJECT;
v_rep VARCHAR2(100);
v_rep_status VARCHAR2(100);
v_param VARCHAR2(200) := NULL;
v_valor VARCHAR2(200);
v_url VARCHAR2(2000) := 'http://localhost:9002';
v_repserver varchar2(100) := 'rep_wls_reports_desktop-6d63e3t';
v_report varchar2(100) := 'D:\Oracle\Middleware\Oracle_Home\reports\printers\MODULE2.jsp';
v_PARAMETRO varchar2(100) := '';
BEGIN
v_repid := FIND_REPORT_OBJECT('MODULE2'); -- report is an element from object navigator report
SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_FILENAME, v_report);
SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_COMM_MODE, SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESTYPE, cache);
SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESFORMAT, 'pdf' );
SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESNAME, v_report);
SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_SERVER, v_repserver);
SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_OTHER, 'paramform=no '||v_PARAMETRO);
v_rep := RUN_REPORT_OBJECT(v_repid);
v_rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE v_rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
v_rep_status := REPORT_OBJECT_STATUS(v_rep);
END LOOP;
IF v_rep_status = 'FINISHED' THEN
message(v_rep);
message(v_rep);
WEB.SHOW_DOCUMENT(v_url||'/reports/rwservlet/getjobid'||
SUBSTR(v_rep, INSTR(v_rep,'_', -1)+1)||'?'||'server='||v_repserver, '_blank');
END IF;
END;
I also tried this code but still gave the same errors.
DECLARE.
vc_reportserver varchar2(256) := 'rep_wls_reports_desktop-6d63e3t'; /* Name of the report Server */
vc_runformat varchar2(256) := 'pdf'; /* Any of these formats: html | css | pdf | xml | delimited | rtf */
v_report_id Report_Object; /* Forms Report Object Name containing the rdf filename for the Report */
vc_reportoj varchar2(256) := 'Module2';
vc_ReportServerJob varchar2(100); /* Unique id for each Report request */
vc_rep_status varchar2(100); /* Status of the Report job */
vjob_id varchar2(100); /* job_id as number only string */
BEGIN
/* Get a handle to the Report Object */
v_report_id := FIND_REPORT_OBJECT(vc_reportoj);
/* Define the report output format and the nname of the Reports Server as well as a user-defined parameter.
Pass the department number from Forms to Reports. There is no need for a parameter form to be displayed,
so paramform is set to "no". */
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT, vc_runformat);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE, CACHE); /* FILE, PRINTER, MAIL, PREVIEW, FTP, FAX, WEBDAV, ORACLEPORTAL */
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE, SYNCHRONOUS); /* SYNCHRONOUS, ASYNCHRONOUS */
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_SERVER, vc_reportserver);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER, 'paramform = no');
vc_ReportServerJob := RUN_REPORT_OBJECT(v_report_id);
vjob_id := substr(vc_ReportServerJob, instr(vc_ReportServerJob, '_', -1)+1);
/* Check the report status. Because this was a synchronous call (REPORT_COMM_MODE), the status check will only return FINISHED or an
error. If COMM_MODE is set to "ASYNCHRONOUS", a timer should be used to periodically change the status of the running report before
attempting to display it. */
-- vc_rep_status := REPORT_OBJECT_STATUS(vc_ReportServerJob);
IF vc_rep_status = 'FINISHED' THEN
/* Call the Reports output to be displayed in the browser. The URL for the relative addressing is valid only when the Reports Server
resides on the same host as the Forms Server and is accessed via the same port.
For accessing a remote Reports environment, you must use a fully qualified URL (i.e. http://hostname:port ) */
WEB.SHOW_DOCUMENT ('http://localhost:9002/reports/rwservlet/getjobid' || /*vjob_id ||*/ '?server=' || vc_reportserver, '_blank');
ELSE
message ('Report failed with error message ' || vc_rep_status);
END IF;
END;
Please let me know if I made any mistake. I am still learning and after successfully running a report from forms I will try to update our old forms and reports to 12c from 6i.
Thank you very much!