DECLARE PRINTER
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use DECLARE-LAYOUT and DECLARE-PRINTER.
Syntax
Use this syntax:
DECLARE PRINTER
[TYPE=printer_type_lit]
[ORIENTATION=orientation_lit]
[LEFT-MARGIN=left_margin_num_lit]
[TOP-MARGIN=top_margin_num_lit]
[LINE-SIZE=line_size_num_lit]
[CHAR-SIZE=char_size_num_lit]
[LINES-INCH=lines_inch_int_lit]
[CHARS-INCH=chars_inch_num_lit]
[POINT-SIZE=point_size_num_lit]
[FONT-TYPE=font_type_txt_lit]
[SYMBOL-SET=symbol_set_id_lit]
[STARTUP-FILE=file_name_txt_lit]
[FONT=font_int_lit]
[BEFORE-BOLD=before_bold_string_txt_lit]
[AFTER-BOLD=after_bold_string_txt_lit]
Description
Specifies the printer type and sets printer characteristics.
Use the DECLARE PRINTER command either in the SETUP section or in the body of the report. Generally, you should use it in the SETUP section. However, if you do not know what type of printer you will be using until the report is run, or if you need to change some of the arguments depending on user selection, you can put several DECLARE PRINTER commands in the body of the report and run the one that you need.
The following arguments take effect only once, upon execution of the first PRINT command, and thereafter have no effect even if changed:
LINE-SIZE
CHAR-SIZE
LINES-INCH
CHARS-INCH
ORIENTATION
SQR maps its line and column positions on the page by using a grid that is determined by the LINE-SIZE and CHAR-SIZE (or LINES-INCH and CHARS-INCH) arguments. Each printed piece of text is placed on the page by means of this grid. Because the characters in proportional fonts vary in width, a word or string may be wider than the horizontal space that you have allotted, especially in words containing uppercase letters. To account for this behavior, you can either move the column position in the PRINT statement or indicate a larger CHAR-SIZE value in the DECLARE PRINTER command.
Arguments
The following table describes the arguments for the DECLARE PRINTER command:
| Argument | Choice or Measure | Default Value | Description |
|---|---|---|---|
|
TYPE |
LINEPRINTER, POSTSCRIPT, HPLASERJET |
LINEPRINTER |
SQR creates output that is specific to each printer. Line printer files generally contain ASCII characters and can be viewed by a text editor. PostScript files contain ASCII characters, but you need to know PostScript to understand what will appear on the printer. HP LaserJet files are binary files and cannot be edited or viewed. |
|
ORIENTATION |
PORTRAIT, LANDSCAPE |
PORTRAIT |
Portrait pages are printed vertically. Landscape pages are printed horizontally. Printing in landscape mode on HP LaserJet printers requires landscape fonts. |
|
LEFT-MARGIN |
inches |
0.5 |
This argument does not apply to line printers. This is the amount of blank space to leave at the left side of the page. |
|
TOP-MARGIN |
inches |
0.5 |
This argument does not apply to line printers. This is the amount of blank space to leave at the top of the page. |
|
LINE-SIZE |
points |
12 |
This argument does not apply to line printers. This is the size of each SQR line on the page. There are 72 points per inch. If LINE-SIZE is not specified, it follows the value for POINT-SIZE, if specified. The default value of 12 points yields 6 lines per inch. |
|
CHAR-SIZE |
points |
7.2 |
This argument does not apply to line printers. This is the size of each SQR horizontal character column on the page (for example, the distance between the locations [1,12] and [1,13]). If CHAR-SIZE is not specified and the point size is less than 8.6, CHAR-SIZE is set to 4.32, which yields 16.6 characters per inch. The default value of 7.2 yields 10 characters per inch. |
|
LINES-INCH |
lines |
6 |
This argument does not apply to line printers. This is an alternate way of indicating the, in lines per inch rather than in points (as in LINE-SIZE). |
|
CHARS-INCH |
characters |
10 |
This argument does not apply to line printers. This is an alternate way of indicating the width of each SQR character column, in characters per inch rather than in points (as in CHAR-SIZE). |
|
POINT-SIZE |
points |
12 |
This argument does not apply to line printers. This is the beginning size of the selected font. |
|
FONT-TYPE |
PROPORTIONAL, FIXED |
Depends on the font |
This argument applies only to HP LaserJet printers and must be specified only for font types that are not listed as being available for HP LaserJet printers in SQR in the previous DECLARE-PRINTER section. |
|
SYMBOL-SET |
HP defined sets |
0U |
This argument applies only to HP LaserJet printers. The default value, 0U, is for the ASCII symbol set. Additional symbol sets exist. See HP LaserJet Technical Reference Manual. |
|
STARTUP-FILE |
filename |
POSTSCRI.STR |
This argument applies only to PostScript printers. Use it to specify an alternate startup file. Unless otherwise specified, the default startup file is located in the directory that is specified by the environment variable SQRDIR. |
|
FONT |
font_number |
3 |
This is the font number of the typeface to use. For HP LaserJet printers, this is the typeface value as defined by Hewlett-Packard. See HP LaserJet Technical Reference Manual. For PostScript printers, SQR supplies a list of fonts and arbitrary font number assignments in the postscri.str file. 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. See the fonts that are listed as being available for HP LaserJet printers in SQR in the previous DECLARE-PRINTER section. See also the table that lists the fonts that are available in the SQR postscri.str file, also in the DECLARE-PRINTER section. |
|
BEFORE-BOLD |
any string |
None |
The BEFORE-BOLD and AFTER- BOLD arguments are for line printers only. They specify the character string to turn bold on and off. If the string contains blank characters, enclose it in single quotation marks. To specify nonprintable characters, such as ESC, enclose the decimal value within 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 the PRINT command. |
|
AFTER-BOLD |
any string |
None |
See BEFORE-BOLD. |
The font that you choose—its orientation, typeface, and point size—must be an internal font (available in a font cartridge) or downloaded to the printer.
For fonts that are not listed as being available for HP LaserJet printers in SQR in the “DECLARE-PRINTER” section in the “SQR Command Reference” topic, you must indicate the font style by using the FONT-TYPE argument; otherwise, the printer cannot select the correct typeface.