DECLARE-PRINTER

Function

Overrides the printer defaults for specified printer type.

Syntax

DECLARE-PRINTER printer_name
[FOR-REPORTS=(report_name1[,report_namei]...)]
[TYPE=printer_type_lit]
[INIT-STRING=initialization_string_txt_lit]
[RESET-STRING=reset_string_txt_lit]
[COLOR=color_lit]
[POINT-SIZE=point_size_num_lit]
[FONT-TYPE=font_type_int_lit]
[SYMBOL-SET=symbol_set_id_lit]
[STARTUP-FILE=file_name_txt_lit]
[PITCH=pitch_num_lit]
[FONT=font_int_lit]
[BEFORE-BOLD=before_bold_string_txt_lit]
[AFTER-BOLD=after_bold_string_txt_lit]
END-DECLARE

Arguments

printer_name

Unique name used to reference a printer definition and its attributes.

Table 32 describes the other DECLARE‑PRINTER arguments.

Description

Each printer has a set of defaults in Table 32. DECLARE‑PRINTER overrides these defaults.

Use DECLARE-PRINTER in the SETUP section to define the characteristics of the printer or printers to use. If you need to change some of the arguments depending on the run-time environment, you can use ALTER‑PRINTER in any part of the program except the PROGRAM and SETUP sections.

A program can contain no more than one DECLARE-PRINTER command for each printer type for each report. If you do not provide a printer declaration, the default specifications are used. The default printer attributes can be overridden by providing a DECLARE-PRINTER specification for each printer. Their names are: DEFAULT-LP for line printer, DEFAULT-HP for HP LaserJet, DEFAULT-HT for HTML, and DEFAULT-PS for PostScript.

Table 32 describes each of the arguments, the possible choices, and the default values.

Table 32. DECLARE-PRINTER Command Arguments

Argument

Choice or Measure

Default

Description

AFTER‑BOLD

any string

(none)

See BEFORE-BOLD.

BEFORE‑BOLD

any string

(none)

BEFORE-BOLD and AFTER‑BOLD are for line printers only. They specify the character string to turn bolding on and off. If the string contains blank characters, enclose it in single quotes (‘...’).

To specify non-printable characters, such as ESC, enclose the decimal value inside angle brackets as follows:

BEFORE-BOLD=<27>[r ! Turn on bold AFTER-BOLD=<27>[u ! Turn it off

These arguments work with the BOLD argument of PRINT.

COLOR

Yes, No

No

Defines whether the printer can print in color.

FONT

font_number

3

Font number of the typeface to use. For HP LASERJET printers, this is the typeface value as defined by Hewlett-Packard. For a complete list of the typeface numbers, see the HP LaserJet Technical Reference Manual. For POSTSCRIPT printers, Production Reporting supplies a list of fonts and arbitrary font number assignments in the file POSTSCRI.STR.

The font numbers are the same as those for HP LaserJet printers, wherever possible. You can modify the font list in POSTSCRI.STR to add or delete fonts. Read the POSTSCRI.STR file for instructions. Table 33 lists the fonts available in Production Reporting internally. This table lists the fonts available in the Production Reporting POSTSCRI.STR file.

FONT‑TYPE

PROPORTIONAL, FIXED

Depends on the font

Applies only to HP LASERJET printers and needs to be specified only for font types not defined in Table 33.

FOR‑REPORTS

 

ALL

Name of the reports that use this printer definition (default = ALL). Required only for programs with multiple reports. Ignore this argument for programs that produce a single report..

INIT-STRING

 

(none)

Sends control or other characters to the printer at the beginning of the report. Designed primarily for line printers and has limited use with other printer types. Specify non-display characters by placing their decimal values inside angle brackets. For example, <27> is the ESC or escape character.

PITCH

characters/inch

10

Required for HPLASERJET printers and SPF Viewer. Fixed—pitched fonts should indicate the pitch.

POINT-SIZE

points

12

Beginning size of the font. Does not apply to line printers

RESET-STRING

 

(none)

Sends control or other characters to the printer at the end of the report. Designed primarily for line printers and has limited use with other printer types. Specify non-display characters by placing their decimal values inside angle brackets. For example, <27> is the ESC or escape character.

STARTUP-FILE

filename

POSTSCRI.STR

POSTSCRIPT printers only. Defines an alternate startup file. Unless otherwise specified, the default startup file is located in the directory pointed to by the environment variable SQRDIR.

SYMBOL‑SET

HP defined sets

0U

HP LASERJET printers only. The default value of “0U” is for the ASCII symbol set. For a complete list of the symbol sets, see the HP LaserJet Technical Reference Manual.

TYPE

LINEPRINTER, POSTSCRIPT, HPLASERJET, HTML, LP, PS, HP, HT

LP

Production Reporting creates output specific to each printer.

  • LINEPRINTER (LP) files generally consist of ASCII characters and can be viewed by a text editor.

  • POSTSCRIPT (PS) files consist of ASCII characters, but you need to know PostScript to understand what is shown on the printer.

  • HPLASERJET (HP) files are binary files and cannot be edited or viewed.

  • HTML (HT) files consist of ASCII characters and can be viewed by a browser.

Table 33 lists the fonts available in Production Reporting for use with the FONT argument for HPLaserJet printer types.

Table 33. Fonts Available for HP LaserJet Printers in Production Reporting

Value

Typeface

Style

0

Line printer

Fixed

1

Pica

Fixed

2

Elite

Fixed

3

Courier

Fixed

4

Helvetica

Proportional

5

Times Roman

Proportional

6

Letter Gothic

Fixed

8

Prestige

Fixed

11

Presentations

Fixed

17

Optima

Proportional

18

Garamondi

Proportional

19

Cooper Black

Proportional

20

Coronet Bold

Proportional

21

Broadway

Proportional

22

Bauer Bodini Black Condensed

Proportional

23

Century Schoolbook

Proportional

24

University Roman

Proportional

The font you choose—in orientation, typeface, and point size—must be an internal font, available in a font cartridge, or downloaded to the printer.

For fonts not listed in Table 33, indicate the font style using the FONT‑TYPE argument, or the correct typeface cannot be selected by the printer.

Table 34 lists the fonts available in Production Reporting for use with the FONT argument for PostScript printer types. Those for which bold face types are available are indicated by a “Y” in the Bold column.

Table 34. Fonts Available for PostScript Printers

Value

Typeface

Bold

3

Courier

Y

4

Helvetica

Y

5

Times Roman

Y

6

Avant Garde Book

 

8

Palatino Roman

Y

11

Symbol

 

12

Zapf Dingbats

 

17

Zapf Chancery Medium Italic

 

18

Bookman Light

 

23

New Century Schoolbook Roman

Y

30

Courier Oblique

Y

31

Helvetica Oblique

Y

32

Times Italic

Y

33

Avant Garde Demi

 

34

Avant Garde Book Oblique

 

35

Avant Garde Demi Oblique

 

36

Palatino Oblique

Y

37

New Century Schoolbook Italic

Y

38

Helvetica Narrow

Y

39

Helvetica Narrow Oblique

Y

40

Bookman Demi

 

41

Bookman Light Italic

 

42

Bookman Demi Italic

 

Other type faces can be added to POSTSCRI.STR.

Table 35 lists the fonts available in Production Reporting when printing on Windows printer drivers using -PRINTER:WP. When you use ‑PRINTER:WP, your report is sent directly to the default Windows printer. To specify a non-default Windows printer, use ‑PRINTER:WP:{Printer Name}. The {Printer Name} can be the name assigned to a printer; or, if the operating system permits it, the UNC name (i.e.\\Machine\ShareName). For example, to send output to a Windows printer named NewPrinter, you could use -PRINTER:WP:NewPrinter. If your printer name has spaces, enclose the entire command in double quotes.

Fonts are specified in the ALTER‑PRINTER FONT qualifier by their number.

Table 35. Fonts Available for Windows Printers

Value

Windows Font/Name

Style

3

Courier New

Fixed

300

Courier New

Bold

4

Arial

Proportional

400

Arial

Bold

5

Times New Roman

Proportional

500

Times New Roman

Bold

6

AvantGarde

Proportional

8

Palatino

Proportional

800

Palatino

Bold

11

Symbol

Proportional

Note:

Fonts 6, 8, and 800 are not supplied with Windows. You can get these fonts by purchasing the ADOBE Type Manager (ATM). The advantage of using ATM fonts is the compatibility for PostScript printer fonts.

The Symbol font uses the SYMBOL_CHARSET instead of the usual ANSI_CHARSET character set.

To add more fonts, edit the [Fonts] section in SQR.INI.

Examples

declare-printer HP-definition  ! Default HP definition
  type=HP                      ! for all reports
  font=4                       ! Helvetica
  symbol-set=12U               ! PC-850 Multilingual
end-declare
declare-printer PS-Sales ! PS definition
  for-reports=(sales)    ! for the Sales report
  type=PS
  font=5                 ! Times-Roman
end-declare

See Also

ALTER-PRINTER and DECLARE-REPORT