[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Printing SQRs to different printer types.



With version 6 of Tools there is  new SQCs setup31.sqc (Portrait) and
setup32.sqc
    (Landscape). These SQCs are similar to setup01.sqc and setup02.sqc,
except that they can now use
    different PRINTER_TYPEs. The PRINTER_TYPE substitution variable is
set in setenv.sqc
    !Printer
    !
    #define PRINTER_TYPE LINEPRINTER
    !#define PRINTER_TYPE POSTSCRIPT
    !#define PRINTER_TYPE HPLASERJET
    !
    !Paper Size
    !
    #define PAPER_SIZE LETTER
    !#define PAPER_SIZE A4
    !

    If your environment has different printer types you need to first
decide on the printer type your workstation
    will use. Then copy the setenv.sqc on each workstation, say in
C:\USER\SQR directory. Now change the
    PRINTER_TYPE to the printer type you are going to use.
    The -i report argument in SQRFLAGS should point to the the c drive
first
    eg : SQRFLAGS=-iC:\USER\SQR\;N:\HR600\SQR\ .........
    All SQRs using setup01.sqc should now use setup31.sqc while those
using setup02.sqc should use
    setup32.sqc.

    Customers on Tools prior to 6 can use this functionality, by adding
the above code in setenv.sqc and
    creating setup31.sqc, setup32.sqc, setlyout.sqc


!***********************************************************************

    ! SetUp31: Printer and Page-Size Initialization (Portrait) *

!***********************************************************************

    begin-setup
    #include 'setupdb.sqc' ! Database specific setup

    #ifndef MVS
    #ifndef OS400

    #if {PRINTER_TYPE} = 'LINEPRINTER'
    declare-printer LP-definition
    type=LINEPRINTER

init-string=<27>E<27>(0N<27>&l0O<27>&l8D<27>&l88F<27>(s16.66H<27>&k2G
    ! | | | | | | |
    ! | | | | | | --> CR
    ! | | | | | --> Line Prntr font
    ! | | | | --> 88 text lines
    ! | | | --> 8 lines per inch
    ! | | --> Portrait orientation
    ! | --> ISO 8859-1 symbol set
    ! --> Reset
    before-bold=<27>[r
    after-bold=<27>[u
    end-declare
    #endif
    !
    ! For POSTSCRIPT and HPLASERJET, the specified font in the specified

    ! size must be loaded on the printer being printed to, otherwise the

    ! the font used will be determined by the printer.
    ! If you use -PRINTER:WP as an SQRW option, it means to use the
default
    ! Windows printer and associated printer driver, so it would need to

    ! know about the font you want.
    ! The intention of the following declarations is to make reports
using
    ! each of the printers as close to the older formats as possible.
    !
    #if {PRINTER_TYPE} = 'POSTSCRIPT'
    declare-printer PS-definition
    type=POSTSCRIPT
    point-size=7
    font=3 ! Courier font
    !
    ! add STARTUP-FILE=dir\filename to change the symbol set
    !
    end-declare
    #endif

    #if {PRINTER_TYPE} = 'HPLASERJET'
    declare-printer HP-definition
    type=HPLASERJET
    point-size=8
    symbol-set=0U ! ASCII symbol set
    pitch=17 ! Characters per inch
    font=3 ! Courier font
    end-declare
    #endif

    #endif
    #endif

    #define PAGE_ORIENTATION PORTRAIT
    #define PAGE_MAX_COLS 125
    #define PAGE_MAX_LINES 79
    #include 'setlyout.sqc'

    #Define ColR 108 !Column # referenced by Standard Headings

    end-setup


!***********************************************************************

    ! SetUp32: Printer and Page-Size Initialization (Landscape) *

!***********************************************************************

    begin-setup
    #include 'setupdb.sqc' ! Database specific setup

    #ifndef MVS
    #ifndef OS400

    #if {PRINTER_TYPE} = 'LINEPRINTER'
    declare-printer LP-definition
    type=LINEPRINTER

init-string=<27>E<27>(0N<27>&l1O<27>&l8D<27>&l66F<27>(s16.66H<27>&k2G
    ! | | | | | | |
    ! | | | | | | --> CR
    ! | | | | | --> Line Prntr font
    ! | | | | --> 66 text lines
    ! | | | --> 8 lines per inch
    ! | | --> Landscape orientation
    ! | --> ISO 8859-1 symbol set
    ! --> Reset
    before-bold=<27>[r
    after-bold=<27>[u
    end-declare
    #endif
    !
    ! For POSTSCRIPT and HPLASERJET, the specified font in the specified

    ! size must be loaded on the printer being printed to, otherwise the

    ! printer will determine the font to be used.
    ! If you use -PRINTER:WP as an SQRW option, it means to use the
default
    ! Windows printer and associated printer driver, so it would need to

    ! know about the font you want.
    ! The intention of the following declarations is to make reports
using
    ! each of the printers as close to the older formats as possible.
    !
    #if {PRINTER_TYPE} = 'POSTSCRIPT'
    declare-printer PS-definition
    type=POSTSCRIPT
    point-size=7
    font=3 ! Courier font
    !
    ! add STARTUP-FILE=dir\filename to change the symbol set
    !
    end-declare
    #endif

    #if {PRINTER_TYPE} = 'HPLASERJET'
    declare-printer HP-definition
    type=HPLASERJET
    point-size=8
    symbol-set=0U ! ASCII symbol set
    pitch=17 ! Characters per inch
    font=3 ! Courier font
    end-declare
    #endif

    #endif
    #endif

    #define PAGE_ORIENTATION LANDSCAPE
    #define PAGE_MAX_COLS 177
    #define PAGE_MAX_LINES 58
    #include 'setlyout.sqc'

    #Define ColR 160 !Column # referenced by Standard Headings

    end-setup


!***********************************************************************

    ! SetLyOut: Set the layout for the SQR report *

!***********************************************************************

    #if {PAPER_SIZE} = 'LETTER'
    #define PAGE_PAPER_SIZE (8.5,11)
    #if {PAGE_ORIENTATION} = 'PORTRAIT'
    #if {PRINTER_TYPE} = 'LINEPRINTER'
    #define PAGE_LEFT_MARG 0.82
    #define PAGE_TOP_MARG 0
    #endif
    #if {PRINTER_TYPE} = 'POSTSCRIPT'
    #define PAGE_LEFT_MARG 0.82
    #define PAGE_TOP_MARG 0.6
    #endif
    #if {PRINTER_TYPE} = 'HPLASERJET'
    #define PAGE_LEFT_MARG 0.5
    #define PAGE_TOP_MARG 0.5
    #endif
    #endif
    #if {PAGE_ORIENTATION} = 'LANDSCAPE'
    #if {PRINTER_TYPE} = 'LINEPRINTER'
    #define PAGE_LEFT_MARG 0
    #define PAGE_TOP_MARG 0.125
    #endif
    #if {PRINTER_TYPE} = 'POSTSCRIPT'
    #define PAGE_LEFT_MARG 0.25
    #define PAGE_TOP_MARG 0.75
    #endif
    #if {PRINTER_TYPE} = 'HPLASERJET'
    #define PAGE_LEFT_MARG 0
    #define PAGE_TOP_MARG 0.6
    #endif
    #endif
    #endif

    #if {PAPER_SIZE} = 'A4'
    #define PAGE_PAPER_SIZE (8.25,11.625)
    #if {PAGE_ORIENTATION} = 'PORTRAIT'
    #if {PRINTER_TYPE} = 'LINEPRINTER'
    #define PAGE_LEFT_MARG 0.595
    #define PAGE_TOP_MARG 0.3125
    #endif
    #if {PRINTER_TYPE} = 'POSTSCRIPT'
    #define PAGE_LEFT_MARG 0.595
    #define PAGE_TOP_MARG 0.9125
    #endif
    #if {PRINTER_TYPE} = 'HPLASERJET'
    #define PAGE_LEFT_MARG 0.375
    #define PAGE_TOP_MARG 0.8125
    #endif
    #endif
    #if {PAGE_ORIENTATION} = 'LANDSCAPE'
    #if {PRINTER_TYPE} = 'LINEPRINTER'
    #define PAGE_LEFT_MARG 0.3125
    #define PAGE_TOP_MARG 0
    #endif
    #if {PRINTER_TYPE} = 'POSTSCRIPT'
    #define PAGE_LEFT_MARG 0.5625
    #define PAGE_TOP_MARG 0.625
    #endif
    #if {PRINTER_TYPE} = 'HPLASERJET'
    #define PAGE_LEFT_MARG 0.3125
    #define PAGE_TOP_MARG 0.475
    #endif
    #endif
    #endif

    declare-layout DEFAULT
    paper-size={PAGE_PAPER_SIZE}
    orientation={PAGE_ORIENTATION}
    max-columns={PAGE_MAX_COLS}
    max-lines={PAGE_MAX_LINES}
    left-margin={PAGE_LEFT_MARG}
    top-margin={PAGE_TOP_MARG}

    #if {PRINTER_TYPE} = 'POSTSCRIPT'
    line-height=9 ! 72/printer_point-size
    char-width=4.32 ! points, to handle max cols
    #endif ! Printer_type POSTSCRIPT

    #if {PRINTER_TYPE} = 'HPLASERJET'
    line-height=9 ! 72/printer_point-size
    char-width=4.32 ! points, to handle max cols
    #endif ! Printer_type HPLASERJET

    end-declare
begin:          vcard
fn:             Larry  Oltmanns
n:              Oltmanns;Larry
org:            Soft Link Inc.
adr:            4500 Cedar Lake Road South;;;Minneapolis;Minnesota;55416;United States of America
email;internet: skyway@mn.uswest.net
title:          PeopleSoft Consultant
tel;work:       612-624-8352
tel;fax:        612-626-1332
tel;home:       612-374-3181
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard