Direct Print [message #585674] |
Wed, 29 May 2013 00:39 |
|
MahdiAbuHassan
Messages: 7 Registered: May 2013 Location: Bahrain
|
Junior Member |
|
|
I want to print a report to the printer directly. The main issue is that I don't want the user to save the report to prevent reprint of legal Order. Below is my code to produce 'PDF' format. Please help me to accomplish my task.
PROCEDURE
run_report_proc (rep_id report_master.REPORT_ID%type,pl_id ParamList ) IS
repid REPORT_OBJECT;
rep_name report_master.REPORT_NAME%type;
v_rep varchar2(1000);
rep_status varchar2(20);
rep_acc char(1);
BEGIN
if rep_id is not null then
begin
select REPORT_NAMe into rep_name from report_master where REPORT_ID = rep_id ;
-- rep_name := 'can_letter2';
exception
when others then
:cnt_blk.msgfld := 'Invalid Report Id ' ;
raise form_trigger_failure;
end;
repid := FIND_REPORT_OBJECT('REP_OBJ');
set_report_object_property(repid,REPORT_FILENAME,'/appsys/ROADCIS/reports/' ||rep_name);
set_report_object_property(repid,REPORT_SERVER,:global.report_server);
set_report_object_property(repid,REPORT_DESTYPE,CACHE);
-- set_report_object_property(repid,REPORT_DESTYPE,screen);
set_report_object_property(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'PDFEMBED=no');
v_rep := RUN_REPORT_OBJECT(repid, PL_ID);
rep_status := REPORT_OBJECT_STATUS(v_rep);
while rep_status = 'RUNNING' loop
rep_status := REPORT_OBJECT_STATUS(v_rep);
end loop;
:CNT_BLK.MSGFLD:=rep_status;
web.show_document(:global.report_url ||'reports/rwservlet/getjobid' || substr(v_rep,:global.rro) || '?server=' ||:global.report_server, '_blank');
:b010.CMS_RePrint := 'N';
Commit_Form;
else
:cnt_blk.msgfld := 'Inavlid Report ID ' ;
RAISE Form_Trigger_Failure;
end if;
end;
|
|
|
|
|
|