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.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.
9 comments:
Another great article. I like that you are very honest and direct to the point.
I would like to say this is an excellent blog that I have ever come across. Very informative. Please write more so that we can get more details.
Web Design
oracle report is nice stuff
how i can get printer name
Your code not execute.
how can i create .prt file for my printers?
I am very happy to be able to find this good article
Honestly, this is one article that gives me incredible information and is very useful and very helpful
maybe I will visit this site again to find other articles that can be useful for me :)
Cara Menghilangkan Miom Di Rahim Secara Alami Cara Menghilangkan Bisul Pantat Cara Menyembuhkan Eksim Secara Alami Cara Menghilangkan Benjolan Di Leher Cara Mengeluarkan Batu Ginjal Obat Sesak Napas Cara Menghilangkan Nyeri Pinggang Saat Hamil Cara Menyembuhkan ISK Cara Mengatasi Rasa Nyeri Di Dada Sebelah Kiri Cara Mengatasi Kulit Kering & Bersisik Pada Selangkangan
Thanks Bersama, sure you can visit any time or email me for oracle related queries.
Post a Comment