DECLARE-PRINTER
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
Description
Overrides the printer defaults for the specified printer type.
Each printer has a set of defaults as listed in the DECLARE-PRINTER Command Arguments table. The DECLARE-PRINTER command overrides these defaults.
Use the DECLARE-PRINTER command in the SETUP section to define the characteristics of the printer or printers to be used. If you need to change some of the arguments depending on the runtime environment, you can use the ALTER-PRINTER command 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. You can override the default printer attributes by providing a DECLARE-PRINTER specification for each printer. The names are:
-
DEFAULT-LP for line printer.
-
DEFAULT-HP for HP LaserJet.
-
DEFAULT-HT for HTML.
-
DEFAULT-PS for PostScript.
This table lists the arguments, provides the possible choices or measure, lists the default values, and describes the arguments.
| Argument | Choice or Measure | Default | Description |
|---|---|---|---|
|
FOR-REPORTS |
NA (Not Applicable) |
ALL |
The name of the reports that use this printer definition. The default is ALL, for all reports. This argument is required only for a program with multiple reports. If you are writing a program that produces only a single report, you can ignore this argument. |
|
TYPE |
LINEPRINTER, POSTSCRIPT, HPLASERJET, HTML, LP, PS, HP, HT |
LP |
The output type specific to each printer. LINEPRINTER (LP) files can be viewed by a text editor. POSTSCRIPT (PS) files require you to know PostScript to understand what will be shown on the printer. HPLASERJET (HP) files are binary files and cannot be edited or viewed. HTML (HT) files can be viewed by a browser. |
|
INIT-STRING |
NA |
(none) |
Sends control or other characters to the printer at the beginning of the report. This parameter is designed primarily for the LINEPRINTER and has limited use with other printer types. Specify nondisplay characters by placing their decimal values inside angle brackets. For example, <27> is the ESC or escape character. |
|
RESET-STRING |
NA |
(none) |
Sends control or other characters to the printer at the end of the report. This parameter is designed primarily for the LINEPRINTER and has limited use with other printer types. Specify nondisplay characters by placing their decimal values inside angle brackets. For example, <27> is the ESC or escape character. |
|
COLOR |
Yes, No |
No |
Specifies whether this printer can print in color. |
|
POINT-SIZE |
points |
12 |
This argument does not apply to LINEPRINTER printers. It is the beginning size of the selected font. |
|
FONT-TYPE |
PROPORTIONAL, FIXED |
Depends on the font |
This argument applies only to HPLASERJET printers and needs to be specified only for font types not defined in the Fonts Available for HP LaserJet Printers in the SQR table. |
|
SYMBOL-SET |
HP defined sets |
0U |
This argument applies only to HPLASERJET printers. The default value of 0U is for the USASCII symbol set. For a complete list of the symbol sets, see the HP LaserJet Technical Reference Manual. |
|
STARTUP-FILE |
file name |
POSTSCRI.STR |
This argument applies only to POSTSCRIPT printers. This argument is used to specify an alternate startup file. Unless otherwise specified, the default startup file is located in the directory pointed to by the environment variable SQRDIR. |
|
PITCH |
characters/inch |
10 |
This argument is for HPLASERJET printers only. If you specify a fixed pitch font, you should also indicate the pitch. |
|
FONT |
font_number |
3 |
This is the font number of the typeface to use. For HPLASERJET 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, SQR 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, so that you can use the same font number for reports to be printed on both types of printers. You can modify the font list in POSTSCRI.STR to add or delete fonts. Read the POSTSCRI.STR file for instructions. The Fonts Available for HP LaserJet Printers in SQR table lists the fonts available in SQR internally. The Fonts Available for PostScript Printers table lists the fonts available in the SQR POSTSCRI.STR file. |
|
BEFORE-BOLD |
any string |
(none) |
The BEFORE-BOLD and
AFTER-BOLD arguments are for LINEPRINTER printers only. They specify
the character string to enable or disable boldfacing. If the string
contains blank characters, enclose it in single quote marks ('...').
To specify nonprintable characters, such as ESC, enclose the decimal
value inside angle brackets as shown here: These arguments work with the BOLD argument of the PRINT command. |
|
AFTER-BOLD |
any string |
(none) |
See BEFORE-BOLD. |
This table lists the fonts that are available in SQR for use with the FONT argument for HPLASERJET printer types.
| 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 that 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 the Fonts Available for HP LaserJet Printers in SQR table, you must indicate the font style using the FONT-TYPE argument to ensure that the correct typeface is selected by the printer.
This table lists the fonts that are available in SQR for use with the FONT argument for PostScript printer types:
| Value | Typeface | Boldface Type Available |
|---|---|---|
|
3 |
Courier |
Y |
|
4 |
Helvetica |
Y |
|
5 |
Times Roman |
Y |
|
6 |
Avant Garde Book |
NA (Not Applicable) |
|
8 |
Palatino Roman |
Y |
|
11 |
Symbol |
NA |
|
12 |
Zapf Dingbats |
NA |
|
17 |
Zapf Chancery Medium Italic |
NA |
|
18 |
Bookman Light |
NA |
|
23 |
New Century Schoolbook Roman |
Y |
|
30 |
Courier Oblique |
Y |
|
31 |
Helvetica Oblique |
Y |
|
32 |
Times Italic |
Y |
|
33 |
Avant Garde Demi |
NA |
|
34 |
Avant Garde Book Oblique |
NA |
|
35 |
Avant Garde Demi Oblique |
NA |
|
36 |
Palatino Oblique |
Y |
|
37 |
New Century Schoolbook Italic |
Y |
|
38 |
Helvetica Narrow |
Y |
|
39 |
Helvetica Narrow Oblique |
Y |
|
40 |
Bookman Demi |
NA |
|
41 |
Bookman Light Italic |
NA |
|
42 |
Bookman Demi Italic |
NA |
Other type faces can be added to the POSTSCRI.STR file.
Different fonts are available in SQR for Microsoft Windows when you are printing with Microsoft Windows printer drivers (using the -PRINTER:WP command-line flag). When you use the -PRINTER:WP flag, your report is sent directly to the default Microsoft Windows printer. To specify a nondefault Microsoft Windows printer, enter -PRINTER:WP:{printer name}. The {printer name} is the name assigned to your printer. For example, to send output to a Microsoft Windows printer named NewPrinter, you would use -PRINTER:WP:NewPrinter. If your printer name has spaces, enclose the entire argument in quotes.
Fonts are specified by number in the FONT qualifier of the ALTER-PRINTER command.
This table lists the fonts that are available when you are printing with Microsoft Windows printer drivers:
| 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 Microsoft 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. You can add more fonts by editing the appropriate Fonts section in the pssqr.ini file.
Parameters
| Parameter | Description |
|---|---|
|
printer_name |
A unique name to be used for referencing a printer definition and its attributes. |
Note:
The DECLARE-PRINTER Command Arguments table describes the other arguments of the DECLARE-PRINTER command. The table lists the options, default values, and description of each of the arguments.
Example
The following example illustrates the DECLARE-PRINTER command:
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 ALTER-PRINTER, DECLARE-REPORT