Error calling report from forms FRM-41219
Hello,
I am trying to call a report using RUN_REPORT_OBJECT, but I am running into error 41219 when the form is executed and the report is called. After the first error, I get FRM-40738: Argument 1 to builtin RUN_REPORT_OBJECT cannot be null. I guess I am passing something incorrectly to the procedure but I am unsure what. Here is my code:
PROCEDURE RUN_REPORT_OBJECT_PROC (vc_reportoj Varchar2, vc_reportserver
varchar2, vc_runformat varchar2) IS
v_report_id Report_Object;
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 itself. */
v_report_id:= FIND_REPORT_OBJECT('cq3_listing.rdf');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,CACHE);
/* Define the report output format and the name of the Reports Server
as well as a user-defined parameter, passing the department number from
Forms to the Report. Theres 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_SERVER,vc_reportserver);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER,'p_deptno='||:block3.project_id||'paramform=no');
vc_ReportServerJob:=RUN_REPORT_OBJECT('report_id');
vjob_id :=substr(vc_ReportServerJob,length('reportserver')+2,length(vc_ReportServerJob));
/* If finished, check the report status . */
vc_rep_status := REPORT_OBJECT_STATUS(vc_ReportServerJob);
IF vc_rep_status='FINISHED' THEN
/* Call the Reports output to be displayed in a separate browser
window. The URL for relative addressing is valid only when the Reports
Server resides on the same host as the Forms Server. For accessing a
remote Reports, you must use the prefix http://hostname:port/ */
WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid4'|| vjob_id
||'?server=vc_reportserver,''_blank');
ELSE
message ('Report failed with error message '||vc_rep_status);
END IF;
END;
**** I then call the procedure with:
run_report_object_proc('CQ3','myrepserv','pdf');
Please help!
Thanks,
Jordan