Home » Developer & Programmer » Forms » how do i issue a lp command from forms.
how do i issue a lp command from forms. [message #262707] Tue, 28 August 2007 02:02 Go to next message
harshalonline22
Messages: 74
Registered: March 2007
Location: Pune
Member
I want print a list file which is stored in unix directory.
my O.S. is XP.

When i run a forms which calls sql by host.
i spool the result on my local m/c's C: drive
and i also ftp that file to unix.

now i want to print that file from forms only instead of
going to unix directory & type lp command.

Can any body tell me.
Re: how do i issue a lp command from forms. [message #262709 is a reply to message #262707] Tue, 28 August 2007 02:07 Go to previous messageGo to next message
Littlefoot
Messages: 20893
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you try to use HOST command?
Re: how do i issue a lp command from forms. [message #263123 is a reply to message #262707] Wed, 29 August 2007 02:21 Go to previous messageGo to next message
harshalonline22
Messages: 74
Registered: March 2007
Location: Pune
Member
No.
Please give the syntax.

i hv tried to connect like this

host('telnet xxx.x.xxx.x');

but it ask for user name & password.

can we give username & passwd in above command.

If it gets connect to unix then and only then we can issue LP command.

Thanky for your reply.

Regards.


[EDITED by LF - removed IP address]

[Updated on: Wed, 29 August 2007 14:56] by Moderator

Report message to a moderator

Re: how do i issue a lp command from forms. [message #263342 is a reply to message #263123] Wed, 29 August 2007 14:53 Go to previous messageGo to next message
Littlefoot
Messages: 20893
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm terribly sorry; if I had carefully read your initial post, I'd see that you already used HOST command.

LP is used to ... what? Print a file on a line printer? I guess that's why you are using telnet (BTW, don't use real IP address when posting on public forums - it can be abused. I'll remove it from your post). I wouldn't know whether it is possible to send credentials (as you can with FTP, for example) to automatically open a telnet session. Even if it was possible, wouldn't it imply security problem?

Also, once telnet session is established, it would require end user to know how to use LP command. Do your user know how to do that? It must be a *huge* print file if you want to print it there instead of a locally connected printer; shouldn't that be maintained by an operator (someone has to insert correct paper, etc.)?

The question is: could you automatically use HOST to say something like "LP from Windows XP to UNIX"? I don't know, sorry.

Phew ... so many words, and - at the end - I have no idea how to help you. I'm completely useless.
Re: how do i issue a lp command from forms. [message #263392 is a reply to message #263342] Wed, 29 August 2007 23:20 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you tried a client_host('print') command?

David
Re: how do i issue a lp command from forms. [message #263474 is a reply to message #263392] Thu, 30 August 2007 02:31 Go to previous messageGo to next message
harshalonline22
Messages: 74
Registered: March 2007
Location: Pune
Member

Littlefoot sir,

LP is unix command to print the document.And IP add was not an original.I just typed it.
Let me tell you the complete scenario.

1)
I am running a form ,for eg. suppose abc.fmb from my local machine (O.S. is Xp and forms 6i) which calls the sql script.

The SQL script is stored on n/w machin and i called it by this
syntax :

host('sqlplus -s scott/tiger@xyz @\\nwmachine\sql\mgr '||:yymm,no_hide);

2)
The sql script runs successfully.And spools the output file on my machine's C drive.I also ftp that o/p file from form itself by puttin the following syntax :

host('ftp.exe -i -s:\\nwmachine\sql\mgr.txt xxx.x.xxx.x',no_hide);

3)
The mgr.txt contains the mput command of that file to unix directory.

4)
This step also runs successfully

5)
now comes the printing part.
What we do that, we exit from form abc.fmb
Then, i now manually go to unix.Then i have to go to that directory.
Then i issue the lp mgr.lst command from the unix(SCO-UNIX) promt.


Instead of doing step 5 manually,i am trying to accomplish it from form 6i.
So do you think its possible.

when i am trying to connect to unix by using this command
host('telnet xxx.x.xxx.xx')

it asks the user name and passwd.

can we give user name & passwd in host command when telnet.
and other is that , can we also give a lp command from form 6i .


Thanx n Regards,
Harshal








Re: how do i issue a lp command from forms. [message #263623 is a reply to message #263474] Thu, 30 August 2007 09:24 Go to previous messageGo to next message
Littlefoot
Messages: 20893
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Thank you for the explanation; really nice. However, I figured that out myself but still don't know how to automatically connect to UNIX server. This is 'telnet' help:
C:\>telnet -?

telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]]
 -a      Attempt automatic logon. Same as -l option except uses
         the currently logged on user's name.
 -e      Escape character to enter telnet client prompt.
 -f      File name for client side logging
 -l      Specifies the user name to log in with on the remote system.
         Requires that the remote system support the TELNET ENVIRON option.
 -t      Specifies terminal type.
         Supported term types are vt100, vt52, ansi and vtnt only.
 host    Specifies the hostname or IP address of the remote computer
         to connect to.
 port    Specifies a port number or service name.

Now, -a and -l *look like* useful options. But, there's still no option to send password as well as username. I'm sorry, but I can not help you.
Re: how do i issue a lp command from forms. [message #263825 is a reply to message #263623] Fri, 31 August 2007 02:20 Go to previous messageGo to next message
harshalonline22
Messages: 74
Registered: March 2007
Location: Pune
Member

Thank you for your reply.

i tried like this

telnet -a -l usrnm xxx.x.xxx.x

but still asking for login & password.

So,i think it is not possible to get connect automatically .

Thank you.
Re: how do i issue a lp command from forms. [message #264290 is a reply to message #263825] Sun, 02 September 2007 21:25 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have a look at the following: http://p2p.wrox.com/topic.asp?TOPIC_ID=26136 and http://www.devhardware.com/forums/programming-82/bat-to-login-to-telnet-session-89574.html

David

Re: how do i issue a lp command from forms. [message #264362 is a reply to message #262707] Mon, 03 September 2007 02:10 Go to previous message
harshalonline22
Messages: 74
Registered: March 2007
Location: Pune
Member
thanks david.
I will see it.
Previous Topic: When Validate Item Trigger problem.................
Next Topic: Forms fonts size(height) Problem in JRE
Goto Forum:
  


Current Time: Mon Dec 05 05:11:48 CST 2016

Total time taken to generate the page: 0.10356 seconds