Re: Printer Control Codes and Reports
Posted in 1993
Greg Woodard (wood@genesis.MCS.COM) wrote: : Is there any way to imbed printer control codes for a printer into : a 4GL report??? Informix mentioned using a C external or program. Has anyone : written such code or fought this problem??? Sure it is possible. We are doing things like that all the time! No need for any fancy C programming. Here comes an example from a program that is used in daily routine. I added some English comments Excerpt from a 4GL REPORT routine: FORMAT PAGE HEADER LET r_flag = ARG_VAL(3) LET grau = TRUE PRINT ASCII 27, "&l1o45f4D", ### Landscape etc. ### "LABORPARAMETER LEBERTRANSPLANTATION ", r_pat.patname CLIPPED, 1 SPACE, r_pat.patvname CLIPPED, 1 SPACE, r_pat.gebdat USING "DD.MM.YY"; IF r_flag THEN PRINT COLUMN 90, "***** BITTE IN DER KURVE ABHEFTEN *****" ELSE PRINT END IF ### Paint gray rectangles for easier reading ### PRINT ASCII 27, "&f0S"; ### Save cursor posit. ### FOR i = 1 TO 13 PRINT ASCII 27, "*c10g3250a80b2P", ### Gray Shading ### ASCII 27, "&a+2R"; ### Cursor down ### END FOR PRINT ASCII 27, "&f1S"; ### Recall cursor ### SKIP 1 LINE PRINT COLUMN 1, "DATUM"; FOR i = 0 TO anz PRINT COLUMN 25+(i*12), r_datum - anz + i USING "DD.MM.YY"; END FOR PRINT " " .. As you can see, it is easily possible to print the escape codes from the 4GL routine. However, either our LJIIID or 4GL get confused with their column count after such an escape code is put out. "PRINT COLUMN xxx" does not work in the same line. In our applications, we could live with this, but it may cause problems if you are tight with your lines. Hope this helps, Richard -- +----------------------------+-------------------------------------------+ | Dr. Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de | | EDV-Gruppe Anaesthesie | Tel : +49-89-7095-3421 | | Klinikum Grosshadern | FAX : +49-89-7095-8886 | | 81366 Munich, Germany | | +----------------------------+-------------------------------------------+