Adsense Ad

Wednesday, 28 March 2018

How to Print Oracle Report To A Network Shared Printer

In this post I will demonstrate how to send Oracle Report print job direct to a network shared printer.(WINDOWS ONLY)

Assuming you are running your application on Oracle Application Server 10g.

WHEN-BUTTON-PRESSED

DECLARE
pl_id ParamList;
lv_repid REPORT_OBJECT;
lv_report VARCHAR2(100);
BEGIN
pl_id := Get_Parameter_List('tmpdata');
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List( pl_id );
END IF;
pl_id := Create_Parameter_List('tmpdata');
Add_Parameter(pl_id,'P_1',TEXT_PARAMETER,:STUDENTS.STDCODE);
Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
lv_repid:=FIND_REPORT_OBJECT('std_ledger');
SET_REPORT_OBJECT_PROPERTY(lv_repid, REPORT_FILENAME, 'c:\apps\reports\std_ledger1.rep');
SET_REPORT_OBJECT_PROPERTY(lv_repid, REPORT_EXECUTION_MODE, RUNTIME);
SET_REPORT_OBJECT_PROPERTY(lv_repid, REPORT_COMM_MODE , SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(lv_repid, REPORT_DESTYPE ,PRINTER);
SET_REPORT_OBJECT_PROPERTY(lv_repid,REPORT_DESNAME,'\\192.168.1.69\hpLaserJ');
SET_REPORT_OBJECT_PROPERTY(lv_repid, REPORT_DESFORMAT ,'hpl.prt');
SET_REPORT_OBJECT_PROPERTY(lv_repid, REPORT_SERVER , 'rep_localhost_oracleas');
lv_report := RUN_REPORT_OBJECT (lv_repid,pl_id);
END;


No comments: