Home » Developer & Programmer » Reports & Discoverer » Send report directly to network printer (Oracle 10g, Windows 7 64bit)
icon8.gif  Send report directly to network printer [message #681538] Wed, 29 July 2020 01:14 Go to next message
a.mughees0009
Messages: 2
Registered: July 2020
Junior Member
Hi Friends! I'm searching something I couldn't search on internet for days.

Please guide me how to send report print directly to the printer without printing on screen.
I'm developing a POS system and need to print invoice

Here is the code I'm using, I guess I'm stuck on 'report_desname'

SET_REPORT_OBJECT_PROPERTY ('REP_OBJ',
REPORT_FILENAME,
PATH || REPORT_NAME || '.rdf');
V_REP_NAME := 'REP_OBJ';
V_REPID := FIND_REPORT_OBJECT (V_REP_NAME);
SET_REPORT_OBJECT_PROPERTY (V_REPID, REPORT_DESTYPE, PRINTER);
SET_REPORT_OBJECT_PROPERTY (V_REPID, REPORT_DESNAME, '\\172.16.6.12\HP LaserJet P2050 Series PCL6');
SET_REPORT_OBJECT_PROPERTY (V_REPID, REPORT_DESFORMAT,'dflt');
SET_REPORT_OBJECT_PROPERTY (V_REPID, REPORT_SERVER, REPORT);

Best Regards.
Re: Send report directly to network printer [message #682222 is a reply to message #681538] Sat, 10 October 2020 22:52 Go to previous message
shahzad-ul-hasan
Messages: 566
Registered: August 2002
Senior Member
Check this..

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.101.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;

Note:
In my case I am using HP Laserjet printer. hpl.prt is the name of printer file shipped with oracle and located in your ORACLE_ASHOME/reports/printer directory.
Previous Topic: Securing Oracle Reports 12c
Next Topic: Print Current Vouchers
Goto Forum:
  


Current Time: Thu Oct 22 02:17:43 CDT 2020