Re: Formatting report output
Posted in 1995
A technique we used that was very successful was to pipe your report to a C file. The C program must sus out which printer you are going after and read in the correct ESCAPE sequences for that printer. Typically we put the C program in the /usr/spool/lp/admins/lp/interfaces printer files. The way it worked was as follows : Informix 4gl report.... print "~.BO Hi Everybody ~.RS" My C program would scan for ~. and then look up the BO or RS in a file which held the different codes for each printer. This file would probably look like the following : hp4 :BO=\\E21:RS=\\ERS hp3 :BO=\\E21:RS=\\ERS etc. Then in your printer interface file you would probably substitute the normal cat 2>&1 to something like pcat hp4 2>&1 where pcat is the C program that reads a standard input looking for ~. The beauty about this approach was it allowed us to have any number of codes; our reports were completely independant of printers - some reports ran on daisy wheels, others ran on lasers; and it was highly maintainable. At the time the only thing we battled with was the page lengths but I think there have been subsequent posts that help on this subject. Good luck one and all. -- ---------------------------------------------------------------------------- Neil @ Storm. Any ideas expressed above are the feelings of my employer. I own the company. ----------------------------------------------------------------------------