can not print on clients default printer-webutil tool [message #300884] |
Mon, 18 February 2008 08:22  |
tisekofti
Messages: 21 Registered: February 2008
|
Junior Member |
|
|
Hi, I am trying to print on clients default printer but i am always printing on my local printer.
I am currently using webutil tool.
The code I have used is as following:
DECLARE
vrepid report_object;
vrep VARCHAR2 (100);
v_show_document VARCHAR2 (2000) := '/reports/rwservlet?';
v_report_server VARCHAR2 (30) := 'servername';
BEGIN
IF GET_APPLICATION_PROPERTY (user_interface) = 'WEB'
THEN
client_HOST('cmd /c rwrun server=servername report=test1.rdf userid=usernmae/password@develop desformat=pdf destype=printer');
ELSE
vrepid := FIND_REPORT_OBJECT ('REPORT1');
vrep := RUN_REPORT_OBJECT (vrepid);
web.show_document
( '[url]http://server:port/reports/rwservlet/getjobid[/url]'
|| SUBSTR (vrep, INSTR (vrep, '_', -1) + 1)
|| '?'
|| 'server=servername',
'_blank'
);
END IF;
END;
|
|
|
|
|
|
|
Re: can not print on clients default printer-webutil tool [message #301284 is a reply to message #300884] |
Tue, 19 February 2008 23:53   |
tisekofti
Messages: 21 Registered: February 2008
|
Junior Member |
|
|
I am able to detect the default printer of the user, but when i am placing the name of the printer as the desname i get the following error REP-50159. This is the code that am currently using.
DECLARE
vrepid report_object;
vrep VARCHAR2 (100);
v_show_document VARCHAR2 (2000) := '/reports/rwservlet?';
v_report_server VARCHAR2 (30) := 'server';
name1 VARCHAR2 (50);
name2 VARCHAR2 (50);
BEGIN
name1:=client_win_api_environment.read_registry
('HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows',
'Device',true);
name2:=SUBSTR(name1,1,instr(name1,',',1)-1);
IF GET_APPLICATION_PROPERTY (user_interface) = 'WEB'
THEN
v_show_document := v_show_document
-- Report server
|| '&server='
|| v_report_server
-- Report name
|| '&report=test1.rdf'
-- Reports parameters
|| '&destype=printer'
|| '&desformat=PDF'
|| '&desname='
|| name2;
web.show_document (v_show_document);
ELSE
vrepid := FIND_REPORT_OBJECT ('REPORT1');
vrep := RUN_REPORT_OBJECT (vrepid);
web.show_document( '[url]http://servername:port/reports/rwservlet/getjobid[/url]'||
SUBSTR (vrep, INSTR (vrep, '_', -1) + 1)|| '?'|| 'server=server','_blank');
END IF;
END;
Upd mod: Add 'code' tags.
[Updated on: Wed, 20 February 2008 00:12] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: can not print on clients default printer-webutil tool [message #301304 is a reply to message #300884] |
Wed, 20 February 2008 00:34   |
tisekofti
Messages: 21 Registered: February 2008
|
Junior Member |
|
|
i have used the name with uppercase and lowercase letters and i have received the same result REP-50159.
I have given it another name that does not exist just to see if i received an error and when a printer does not exists then i get : invalid printer name.
Does it have to do anything with the access rights of the printer? if yes how can i check this
|
|
|
|
|
|
|
Re: can not print on clients default printer-webutil tool [message #301524 is a reply to message #300884] |
Wed, 20 February 2008 23:40   |
tisekofti
Messages: 21 Registered: February 2008
|
Junior Member |
|
|
i have used this command on the command window of the server and it is working correctly when i define the a different printer on the desname.
rwrun server=repsrv1 report=test1.rdf userid=login/login@develop desformat=PDF destype=printer desname=hp2420N5TH');
for the backslashes at the code i have used the following combinations, i might have been doing something wrong so correct me.
'&desname=\\CentralSrv\hp2420N5TH'
and this
'&desname=\hp2420N5TH'
i am now creating a log file to see where exactly the function crushes and this is the result:
02/20/08:23:37:58:Started printing with command line C:\oracle\FRHome_1\reports\logs\repsrv1\repsrv1-rwlpr-666.log true -P "\\CentralSrv\hp2420N5TH" -#1 C:\oracle\FRHome_1\reports\cache\hp2420N5TH37180533.pdf
02/20/08:23:37:58:printer=\\CentralSrv\hp2420N5TH:docname=C:\oracle\FRHome_1\reports\cache\hp2420N5TH37180533.pdf:filename=C:\oracle\ FRHome_1\reports\cache\hp2420N5TH37180533.pdf:copies=1
02/20/08:23:37:58:Opening Printer \\CentralSrv\hp2420N5TH
02/20/08:23:37:58:StartDocPrinter for \\CentralSrv\hp2420N5TH
02/20/08:23:37:58:StartDocPrinter 1 for \\CentralSrv\hp2420N5TH
02/20/08:23:37:58:StartDocPrinter 2 for \\CentralSrv\hp2420N5TH
02/20/08:23:37:58:Error while StartDocPrinter for \\CentralSrv\hp2420N5TH
02/20/08:23:37:58:ClosePrinter start for \\CentralSrv\hp2420N5TH
02/20/08:23:37:58:ClosePrinter done for \\CentralSrv\hp2420N5TH
I will also have a look at the link you provided me with.
|
|
|
Re: can not print on clients default printer-webutil tool [message #301609 is a reply to message #300884] |
Thu, 21 February 2008 02:51   |
tisekofti
Messages: 21 Registered: February 2008
|
Junior Member |
|
|
you were right...the problem was occuring because the name of the printer was not defined correctly.
Now i am able to print on clients printer when the printer is in a network.
However,I am having problem with the local printers now. i received the following error.
REP-713: Invalid printer name 'IBMPro' specified by parameter DESNAME.
this is occuring because i haven't defined the printer on my server.
When i do define it, i received the message that file was sent to the printer but nothing is happens. The files are spooled and place into queue on the servers printer instead on clients local printer.
Is there any way that i can avoid this? or any way yo solve it?
|
|
|
|
|
|
|