Local printing help please
Posted in 1995
Topics: General Discussion
Informix/Unix gurus,
We have a canned financial package, written in informix, and we use the
same technique as suggested by B. Wheeler below to acomplish local/lan
printing. We have written a proc (included at end of note) which we use
as a "print" command (I.E. print.local myfile ). This works fine outside
of our application from the $ prompt, however; from within our
application, the <CR> is being stripped from the list, which don't look
so good when it prints :( . I think is has to do with the termcap we
are using, because we were having screen re-mapping problems until we
changed an auto-wrap boolean operator in the termcap. As near as I can
tell, that was when this proc stopped working in our application. I
will tell you up front that I am a unix/informix *newbie* (I was dragged
kicking and screaming from the mainframe arena), and I am at a loss. I
tried to get the proc to use it's own termcap, to no avail. Any help would
be appreciated. We are on a RISC6000, with Informix SE.
TIA,
Steve Updike
---------- Forwarded message ----------
Date: Mon, 17 Jul 95 16:07:00 +0200
From: BILLY WHEELER <billy.wheeler@digitec.co.za>
To: informix-list@rmy.emory.edu
Subject: Local printing from ACE on SCO UNIX
-> Can anyone tell me how I can set up my local printer from ISQL. I do not
-> want to print to a system printer but can see how to do this. I am currently
-> printing ACE reports to a file for later printing direct from SCO but this
-> is not ideal.
Right: if I understand you correctly, you have a printer attached to your
terminal / PC being used as a terminal, and you want printed output to go to
that device.
In order to do this, you must let your reports go to the screen (no REPORT TO
section) and in your FIRST PAGE HEADER you must print the control code that
opens the printer port. This is typically something like "^[[5i" for ANSI or
VT100. (ESCAPE, open square bracket, 5, i)
At the end of you report you must send the characters "^[[4i". (ESCAPE, open
square bracket, 4, i). ESCAPE is ASCII 27. This string will close the printer
port.
HTH,
billy.wheeler@digitec.co.za
---Our print.local proc (some char may be lost when this is mailed
because of the <ESC> sequences, but you get the general idea) :) --->
#
# echo the local-printer START output sequence
#
echo -n "[5i\\c"
cat $1
#
# echo a FORM FEED character
#
echo -n "\\f\\c"
#
# echo the local-printer STOP output sequence
#
echo -n "[4i\\c"