Home » Developer & Programmer » Forms » can not print on clients default printer-webutil tool
can not print on clients default printer-webutil tool [message #300884] Mon, 18 February 2008 08:22 Go to next message
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 #300963 is a reply to message #300884] Mon, 18 February 2008 18:23 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please look at http://www.orafaq.com/forum/mv/msg/97330/300757/67467/#msg_300757

David
Re: can not print on clients default printer-webutil tool [message #301090 is a reply to message #300884] Tue, 19 February 2008 03:16 Go to previous messageGo to next message
tisekofti
Messages: 21
Registered: February 2008
Junior Member
i am sorry that didn't help me much... i am still having troubles..
It is always printer on the default printer that is assigned on the server..
is there any other way to solve this?
Re: can not print on clients default printer-webutil tool [message #301274 is a reply to message #301090] Tue, 19 February 2008 23:17 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please post your new code.

David
Re: can not print on clients default printer-webutil tool [message #301277 is a reply to message #301274] Tue, 19 February 2008 23:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have a look at http://www.orafaq.com/forum/m/245496/67467/?srch=local+print#msg_245496

There may be something there that is helpful.

David
Re: can not print on clients default printer-webutil tool [message #301284 is a reply to message #300884] Tue, 19 February 2008 23:53 Go to previous messageGo to next message
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 #301291 is a reply to message #301284] Wed, 20 February 2008 00:13 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Is that printer defined on the server that is running the report?

David
Re: can not print on clients default printer-webutil tool [message #301293 is a reply to message #300884] Wed, 20 February 2008 00:16 Go to previous messageGo to next message
tisekofti
Messages: 21
Registered: February 2008
Junior Member
yes it is defined
Re: can not print on clients default printer-webutil tool [message #301295 is a reply to message #301284] Wed, 20 February 2008 00:17 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use a 'message' command to display 'name2' and verify that you do not have a 'case' problem.

David
Re: can not print on clients default printer-webutil tool [message #301297 is a reply to message #300884] Wed, 20 February 2008 00:20 Go to previous messageGo to next message
tisekofti
Messages: 21
Registered: February 2008
Junior Member
i have used it and the name is showned on screen correctly... An example of what i received back is \\CentralSrv\hp2420N5TH which the name of my printer
Re: can not print on clients default printer-webutil tool [message #301299 is a reply to message #301297] Wed, 20 February 2008 00:22 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
And you KNOW that the printer is defined as 'hp2420N5TH' and not 'HP2420N5TH'.

David

[Updated on: Wed, 20 February 2008 00:22]

Report message to a moderator

Re: can not print on clients default printer-webutil tool [message #301300 is a reply to message #300884] Wed, 20 February 2008 00:26 Go to previous messageGo to next message
tisekofti
Messages: 21
Registered: February 2008
Junior Member
i am not sure about this, i will have a look at this and let you know...
Re: can not print on clients default printer-webutil tool [message #301302 is a reply to message #301300] Wed, 20 February 2008 00:30 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Also make sure that you are not losing the leading backslashes.

David
Re: can not print on clients default printer-webutil tool [message #301304 is a reply to message #300884] Wed, 20 February 2008 00:34 Go to previous messageGo to next message
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 #301314 is a reply to message #301304] Wed, 20 February 2008 00:49 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What's 'REP-50159'? Is the local printer an Acrobat capable printer? I think you may need to scan the 'reports' forum and see if there is anything there that may help as I have run out of ideas.

David
Re: can not print on clients default printer-webutil tool [message #301330 is a reply to message #300884] Wed, 20 February 2008 01:31 Go to previous messageGo to next message
tisekofti
Messages: 21
Registered: February 2008
Junior Member
well, REP-50159: Executed successfully but there were some errors when distribute the output when distributing to a printer.

Yes i have tested the printer before and it is acrobat capable.

ok i will have a look at the reports forum to see what i can find.

Thank you for your help
Re: can not print on clients default printer-webutil tool [message #301496 is a reply to message #301330] Wed, 20 February 2008 19:40 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Did you verify that you were not losing the backslashes?

David
Re: can not print on clients default printer-webutil tool [message #301498 is a reply to message #301496] Wed, 20 February 2008 19:53 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I believe the message is "REP-50159: Executed successfully but there were some errors when distributing the output" I googled it and found http://download.oracle.com/docs/cd/B25221_04/core.1013/b25781/odg_reports.htm#BEIGHDHB

It seems to think you are sending something to an email handler.

Can you run something at the command line that will cause ANY output to appear on this printer?

David
Re: can not print on clients default printer-webutil tool [message #301524 is a reply to message #300884] Wed, 20 February 2008 23:40 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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?
Re: can not print on clients default printer-webutil tool [message #301812 is a reply to message #301609] Thu, 21 February 2008 17:49 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I am really, really glad that we got that one sorted (and I am NOT being sarcastic). So often it is not the form or report that is wrong but the string being passed out of the form or report which when parsed by the server has special characters 'manipulated' into something unwanted.

Create a PDF file on the server, copy it to the PC, print in from the PC. Consider ALWAYS creating a PDF file on the server, then either print to server named printer or move to PC (look for writeable directory via environment variables 'tmp' or 'temp' and then print it.

David
Re: can not print on clients default printer-webutil tool [message #301831 is a reply to message #300884] Thu, 21 February 2008 23:01 Go to previous messageGo to next message
tisekofti
Messages: 21
Registered: February 2008
Junior Member
ok i will try this one out and thanks so much for your help.
Re: can not print on clients default printer-webutil tool [message #301932 is a reply to message #300884] Fri, 22 February 2008 06:15 Go to previous messageGo to next message
tisekofti
Messages: 21
Registered: February 2008
Junior Member
how to i copy the file from the server to the pc?
Re: can not print on clients default printer-webutil tool [message #302212 is a reply to message #301932] Sun, 24 February 2008 22:48 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use the 'webutil' facilities. That's how we get the name of the 'tmp' or 'temp' directory.

David
Previous Topic: Maximum number of columns in LOV
Next Topic: OLE2 related E-book or Help
Goto Forum:
  


Current Time: Fri Sep 27 10:30:39 CDT 2024