Home » Developer & Programmer » Forms » Call report from Form 10g. (Oracle Forms 10g.)
Call report from Form 10g. [message #541551] |
Wed, 01 February 2012 02:23 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
hi all, i have problem follow:
I have a form and i want to call report name is " DOCK_RECEIPT". I
already create parameter report on this Form name is " REPORT82" and set property this parameter report contain {Name is REPORT82, filename is DOCK_RECEIPT.rdf, execution Mode is Batch, Communication Mode is Synchronous}.
I also create a procedure name is F_PRO_PRINT follow:
PROCEDURE F_PRO_PRINT IS
pl_id ParamList;
rep_id REPORT_OBJECT;
V_rep VARCHAR2(100);
rep_status VARCHAR2(20);
rep_job_id varchar2(100);
v_mine_type varchar2(50);
v_palletid NUMBER(10):=0;
v_printer_name varchar2(200);
v_host_name varchar2(200);
V_MODEL VARCHAR2(30):=NULL;
v_alter integer;
cursor v_server_name is
select * from server_mean where server_note= 'ap_server';
v_list_sv v_server_name%rowtype;
ap_sv_name varchar2(256);
BEGIN
OPEN v_server_name;
LOOP
FETCH v_server_name INTO v_list_sv;
EXIT WHEN v_server_name%NOTFOUND;
ap_sv_name:=v_list_sv.server_name;
--select SUBSTR(NAME_MODEL,1,6) INTO V_MODEL FROM MODEL_MASTER WHERE MERCHANDISE=:PALLET.MERCHANDISE;
pl_id := Get_Parameter_List('QVHK02_REPORT');
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List(pl_id);--CO ROI THI XOA DI DE TAO LAI
END IF;
pl_id := Create_Parameter_List('QVHK02_REPORT');
--Add_Parameter(pl_id,'DESTYPE',TEXT_PARAMETER,PRINTER);
Add_Parameter(pl_id, 'PC_CAR_NO', TEXT_PARAMETER,:control.TXT_CAR_NO);
Add_Parameter(pl_id, 'PC_CONTAINER', TEXT_PARAMETER,:control.TXT_CONTAINER_NO);
Add_Parameter(pl_id, 'PC_DELIVERY', TEXT_PARAMETER,:control.TXT_DELIVERY_NO);
Add_Parameter(pl_id, 'PC_SEAL_NO', TEXT_PARAMETER,:control.TXT_SEAL_NO);
Add_Parameter(pl_id, 'PC_WH', TEXT_PARAMETER,:CONTROL.TXT_TO_LOC);
-- Add_Parameter(pl_id, 'P_SYSTEM_RELEASE', TEXT_PARAMETER,to_char(:PALLET.SYSTEM_STOP,'dd-mm-rrrr'));
-- Add_Parameter(pl_id, 'P_HOUR_RELEASE', TEXT_PARAMETER,to_char(:PALLET.SYSTEM_STOP,'hh24:mi'));
--1. auto ra may in
Begin
v_host_name:=WEBUTIL_CLIENTINFO.get_host_name;
form_errors.push(v_host_name);
select distinct rv_meaning into v_printer_name from CG_REF_CODES where rv_domain = 'PRINTER'
and lower(rv_low_value)=lower(v_host_name);
Exception when others then
form_errors.push('Can not get printer name!');
Raise form_trigger_failure;
End;
rep_id := FIND_REPORT_OBJECT('REPORT82');
SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_COMM_MODE, SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_EXECUTION_MODE, BATCH );
SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_DESTYPE,PRINTER);--CACHE PRINTER
SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_DESNAME,v_printer_name);--v_printer_name
SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_DESFORMAT, 'PDF'); --PDF HTML
SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_OTHER, 'paramform=no');
SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_FILENAME, upper('DOCK_RECEIPT'));--HK_12_2_intest
SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_SERVER, 'rep_'||ap_sv_name);--rep_icampas
rep_job_id := RUN_REPORT_OBJECT(rep_id, pl_id);
--Neu muon in BC ra man hinh thi them doan nay
rep_status := REPORT_OBJECT_STATUS(rep_job_id);
WHILE rep_status in ('RUNNING' ,'OPENING_REPORT', 'ENQUEUED') LOOP
rep_status := REPORT_OBJECT_STATUS(rep_job_id);
END LOOP;
If rep_status <> 'FINISHED' Then
-- Bao cao chay OK. Show ket qua
--FORM_ERRORS.PUSH('REPORT SUCCESSFUL! Printer: '||v_printer_name,'W');
--else
form_errors.push ('Printer Trouble!');
Raise form_trigger_failure;
End If;
END LOOP;
CLOSE v_server_name;
EXCEPTION
WHEN NO_DATA_FOUND THEN
form_errors.push('APP-14000','W');
RAISE FORM_TRIGGER_FAILURE;
WHEN OTHERs THEN
form_errors.push('Plz check printer!','W');
RAISE FORM_TRIGGER_FAILURE;
END;
Now i have button and in trigger when-button-press add this code call procedure above
When i click button call report and appear error.
FRM-41214: Unable to run report
Now, i want to call report from form 10g.
How do i do?
Please help me, thanks.
|
|
|
Re: Call report from Form 10g. [message #541865 is a reply to message #541551] |
Thu, 02 February 2012 22:05 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.gravatar.com/avatar/b0919056cea651e0a6d20a1437c20ade?s=64&d=mm&r=g) |
ollivier
Messages: 19 Registered: January 2012 Location: chihuahua
|
Junior Member |
|
|
I`think you have some problem in your report, it could be some inconsistence of data !
did you check your REPORT_SERVER (SET_REPORT_OBJECT_PROPERTY(rep_id,REPORT_SERVER, 'rep_'||ap_sv_name);--rep_icampas)
using:
//serverhp:8888//reports/rwservlet/showjobs?server=repjet
repjet is your REPORT_SERVER !
good luck ! For Thouse About to Rock ! We salute You ! AC/DC
|
|
|
Goto Forum:
Current Time: Fri Aug 23 14:27:50 CDT 2024
|