Home » Developer & Programmer » Forms » Send a report directly to a printer (Forms and report 10G)
Send a report directly to a printer [message #311660] Sat, 05 April 2008 09:55 Go to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Hi everybody!
I use the function web.show_document for calling a report in my form.The fact is i want to send my report to my printer.
In order to get that result i've setted in web.show_document the the following parameters like that:
REPORT_DESTYPE = Printer
REPORT_DESNAME= name_of_my_printer
When i run my form which calling the report on local host after creating a report server, the test succeded. Cool Cool
But when i deploy it on the application server the result is not the same. Shocked Shocked
The report is running but the printer can not launch this one. Mad
I get the following message from a HTML page in my browser:
Operation succeded but problem happen during distribution.
How can i solve it?
Please help me if not i'l d..... Laughing Cool Laughing Cool

Re: Send a report directly to a printer [message #311714 is a reply to message #311660] Sat, 05 April 2008 22:06 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
You printer is directly connected to the server or is it a network printer?
Re: Send a report directly to a printer [message #311891 is a reply to message #311660] Mon, 07 April 2008 05:07 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
my printer is directly connected to my client machine.
That is the machine which is calling the forms hosted on the server.
Re: Send a report directly to a printer [message #311921 is a reply to message #311660] Mon, 07 April 2008 06:38 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
This is probably why you having problem, when you deploy your application, everything is running on the server and the server don`t have access to the printer that is connected on the client machine.

Try plugin the printer directly on the server to see if it work.
Re: Send a report directly to a printer [message #311935 is a reply to message #311660] Mon, 07 April 2008 08:02 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Obviously it work Laughing
But what i want is to run the report on the printer connected to my client machine.It's that's why i ask you if there is a function which allow report to run on the client machine.
If not how can i solve my problem Sad Sad Sad .
Thanks for your help.
Re: Send a report directly to a printer [message #311937 is a reply to message #311660] Mon, 07 April 2008 08:12 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Report are always running on the report server so it`s not possible to run it locally.
Here is what i can suggest you since I did something similar where i am.

1- You need to put the printer on the client machine on share so the server can access it
2- I don`t know how your server is set, but by default, Oracle Services started as system when installed on the server. This prevent the report server from accessing anything outside the server. The way to solve it is to change the setting of Oracle services to start as a user on your domain. A user that must have admin priv on the server. By doing this the server will be able to access the printer on the client computer. you will only have to pass a network path for it in your report. Something like \\client-machine\printer_name
Re: Send a report directly to a printer [message #311962 is a reply to message #311660] Mon, 07 April 2008 09:19 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Ooooooooh i'm so sad!
The fact is it's not only for one machine client but for several.That's why if i set my network path in my report it'll be solve for one case(if it really work).
If there is another way to look for solving my problem i'll take it.
Thanks again for your help.
Re: Send a report directly to a printer [message #311988 is a reply to message #311660] Mon, 07 April 2008 11:21 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
What you can do is also creating all the printer queue on one machine, it can be the report server or another server that will contain only the printing queue to all your printers. So the path will always be the same, only the printer name will change.
Re: Send a report directly to a printer [message #312419 is a reply to message #311962] Tue, 08 April 2008 18:56 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Assuming that your local printer supports pdf, consider writing your report as a pdf file onto the server, copy/move the file to the PC, issue a print command to write it to the local printer.

David
Re: Send a report directly to a printer [message #313032 is a reply to message #312419] Thu, 10 April 2008 07:53 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Please can you show me a code to implement it.
I have no idea of that.
If you haven't a code, please show me the way by example.
Thanks a lot.
Re: Send a report directly to a printer [message #313187 is a reply to message #313032] Fri, 11 April 2008 00:38 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
To produce the report, search this forum for 'web.show_document pdf'. You need to play with the parameter to write to a file. To move the file, search this forum for 'web_util' and 'webutil' along with 'file copy' or 'file move'. To print the pdf to a local printer you need to do a local 'print' command ('prt'?).

David
Re: Send a report directly to a printer [message #313545 is a reply to message #311660] Sun, 13 April 2008 10:16 Go to previous messageGo to next message
pankaj.karule
Messages: 6
Registered: April 2008
Location: doha
Junior Member
hi dear,

can you tell me how you are calling the report
i can help you in this case i also faced similar problem
try unc naming convetion for the printer
Re: Send a report directly to a printer [message #315153 is a reply to message #313545] Sat, 19 April 2008 08:53 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Hi pankaj.karule and everybody!
I use web.show_document for calling my report.
I didn't catch really what you want to say by:try unc naming convetion for the printer. Embarassed Embarassed
If you can be more explicit, it'll better for me and others which will also face similar problem.Cool
Thanks a lot for your help. Laughing Laughing
Re: Send a report directly to a printer [message #315417 is a reply to message #315153] Mon, 21 April 2008 07:51 Go to previous messageGo to next message
pankaj.karule
Messages: 6
Registered: April 2008
Location: doha
Junior Member
hi dear,

You pass this as report desname
the unc naming convention is : \\machine_name\printer_name

machine_name:- the name of the client machine
printer_name:- the name of the printer which is connected to client.

try this i think this will help you.

Re: Send a report directly to a printer [message #315744 is a reply to message #311660] Tue, 22 April 2008 10:46 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Hi pankaj.karule!
I've tried what you said but it didn't work.
When i deploy on my server i got an error: rep-713.
How can i solve it?? Mad Mad Embarassed
Thanks
Re: Send a report directly to a printer [message #316333 is a reply to message #315744] Thu, 24 April 2008 11:56 Go to previous messageGo to next message
pankaj.karule
Messages: 6
Registered: April 2008
Location: doha
Junior Member
hi dear,

will you please send me the code how you are calling your report
and also tell me you have access to your application server?

waiting for your reply

pankaj
Re: Send a report directly to a printer [message #316337 is a reply to message #311660] Thu, 24 April 2008 12:15 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Also remember that if you want to print on network printer, Oracle service on the Report Server must run as user in the domain and not with System user
Re: Send a report directly to a printer [message #316494 is a reply to message #316337] Fri, 25 April 2008 06:37 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Hi everybody!
At first i show you the code i use for calling the report:
WEB.SHOW_DOCUMENT(call_report('r_csd.rdf',
' v_code=' ||'45050'||
' name=' ||'USER',
'&paramform=no',
'&destype=printer',
'&desname=\\mydevice\MYPRINTER',
'&copies=1',
'&orientation=portrait',
'&desformat=pdf',
'&printjob=no',
get_application_property(username),
get_application_property(password),
get_application_property(connect_string),
'RSERVLET'
)
,'_blank').

The code of the function call_report is the following:
function CALL_REPORT(report_name varchar2,
parametre varchar2,
grille_parameters varchar2,
type_of_device varchar2,
name_of_the_device varchar2,
number_of_copies varchar2,
print_direction varchar2,
format_for_the_report varchar2,
dialog_box varchar2,
user_name varchar2,
user_pasword varchar2,
data_base_connexion varchar2,
loc_serv varchar2)return varchar2 is
Result varchar2(3000);
cursor remp_param is select pname,pval from t_parameter where code=loc_serv;
report_server_name varchar2(30);
report_folder varchar2(255);
user_n varchar2(20):= user_name;
user_pwd varchar2(20):= user_pasword;
user_al varchar2(20):= data_base_connexion;
v_url varchar2(3000);
v_conx varchar2(200);
vc_url_temp varchar2(1200);
v_a varchar2(10);
v_b varchar2(10);
i number(10);
begin
open remp_param;
fetch remp_param into report_server_name,report_folder;
close remp_param;
if report_server_name is not null then
v_conx :='userid='||user_n||'/'||user_pwd||'@'||user_al;
for i in 1..length(v_conx) loop
v_a:=ltrim(to_char(trunc(ascii(substr(v_conx,i,1))/16)));
if v_a = '10' then v_a :='A';
elsif v_a = '11' then v_a :='B';
elsif v_a = '12' then v_a :='C';
elsif v_a = '13' then v_a :='D';
elsif v_a = '14' then v_a :='E';
elsif v_a = '15' then v_a :='F';
end If;

v_b:=ltrim(to_char(mod(ascii(substr(v_conx,i,1)),16)));
if v_b = '10' then v_b :='A';
elsif v_b = '11' then v_b :='B';
elsif v_b = '12' then v_b :='C';
elsif v_b = '13' then v_b :='D';
elsif v_b = '14' then v_b :='E';
elsif v_b = '15' then v_b :='F';
end If;

vc_url_temp := vc_url_temp||'%'||v_a||v_b;

end loop;
v_url :='/reports/rwservlet/?server='||report_server_name||'&'||'report='||report_folder||report_name||type_of_device||name_of_the_devi ce||number_of_copies||print_direction||format_for_the_report||dialog_box||'&'||vc_url_temp||' '||parametre||grille_parameters;
Result:= v_url;
return(Result);
else
return(null);
end if;
end ;
Secondly i want to ask sir Kaeluan to be more explicit because i didn't catch really what he said in his last reply.
Thanks everybody for your Help.
Hope that the solution is not so far Laughing Laughing
Re: Send a report directly to a printer [message #316500 is a reply to message #311660] Fri, 25 April 2008 06:47 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Hi,
What i mean is, if you log on the server and go in the control panel, Administrative Tools, Services.
You will see your Oracle services. It should be something like OraclefrASControl and OraclefrProcessManager. By default, those services are running as Local System like many other services.

The problem when it run as Local System is that the Oracle process will not have access to your network since it running as local. You have to change the property of those services in the log on tab to run as domain_name\user_name. And you have to make sure that this domain\user have admin privilege on the server and also have privilege to access your network printer.

Hope it make more sense now.
Re: Send a report directly to a printer [message #316517 is a reply to message #311660] Fri, 25 April 2008 08:18 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Thanks a lot for reply,but i want to know that we are talking about the same thing when we say network printer.
In other words:Do i understand that in the term network printer, we can also include my local printer(that is the printer plug to my client machine)??

Thanks for Help.
Re: Send a report directly to a printer [message #316519 is a reply to message #311660] Fri, 25 April 2008 08:21 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Yes, since your printer is not connected directly on the server it's consider as Network Printer for the server. Also note that you will have to set your printer on your client machine on Share to allow server to see it

[Updated on: Fri, 25 April 2008 08:21]

Report message to a moderator

Re: Send a report directly to a printer [message #316525 is a reply to message #311660] Fri, 25 April 2008 09:30 Go to previous messageGo to next message
jeunot0108
Messages: 21
Registered: April 2008
Junior Member
Hi
How can i share my printer.
I use windows as OS.
I don't want to do something i didn't know really.
I just want to set the good paremeters for allowing the report server to see my local printer.
Just to know: Have you already send a report directly to a printer(local printer)???Laughing
Thanks a lot.
Best regards
Re: Send a report directly to a printer [message #316553 is a reply to message #311660] Fri, 25 April 2008 12:23 Go to previous message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Hello,

Quote:

I just want to set the good paremeters for allowing the report server to see my local printer.



Just right click on your local printer in Windows and select Share. Only set the name of the share printer and the privilege you want to restrict access on the printer.


Quote:

Just to know: Have you already send a report directly to a printer(local printer)???



Yes,
actually we have several file server across canada that have their own printer set on it. And our report server is sending job on the printers set on those server.
Previous Topic: Migration from Forms 6i to Forms 10g
Next Topic: generating thumbnail pictures in batch process
Goto Forum:
  


Current Time: Sat Dec 10 22:39:04 CST 2016

Total time taken to generate the page: 0.08645 seconds