CDS554
Automated PCL Grid |
Last Revised: 09/27/23 |
This called routine can be used to print to a PCL compatible printer, the detail section of a sales order, invoice, statement, purchase order, transfer order, or any other document. Using this routine will significantly reduce the code required to produce very clear and readable documents.
CDS554 will:
- automatically suppress columns that are all blank in each non-heading row,
- automatically determine the width of each column, expanding or reducing width based on document contents,
- shrink the point size of the text to fit within the column,
- automatically determine the height of each row, based on the number of lines of text printed in the row,
- automatically split the document over multiple pages if required.
CDS554 can:
- optionally print document name, document reference heading, document reference number, and overlay for logo, etc.
- have text span multiple columns,
- print using proportional or fixed-width characters,
- print using regular or bold weight font,
- align text to be left justified, centered, or right justified,
- keep rows together to prevent the total section from being split over multiple pages,
- print notepad text.
See also CDS254, CDS354, CDS454.
CDS554 is called 4 different ways.
Call Type | Call Frequency | Calling Arguments |
---|---|---|
Initialization | one time | CALL "CDS554::SETUP", S554$, COLS$
|
Cell Line | once for each line of text in cell | CALL "CDS554", S554$, COL {, TXT$, CELLOPTS$ }
|
Row | once at the end of each row | CALL "CDS554::ENDROW", S554$ {, ROWOPTS$ }
|
once at the end of all rows | CALL "CDS554::PRINT", S554$, Y6$
|
Call CDS554 for each non-spanned cell, even if there is no text to be printed in order to print the cell grid lines.
If you are using CDS554 to print multiple sections within the same document, then after calling CDS554::PRINT, you must call CDS554::SETUP again to start the next section, even if the columns are the same as the previous section.
CDS554 Arguments | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Call Type | Argument | Passed To/From | Description | ||||||||||||||||||||||||||
Initialization | S554$
|
From | Used to store parameters and data until printed. Note: Do not CALL "CDS041" to obtain the template for CDS554 before calling CDS554 the first time. The template is built by CDS554 dynamically during the initialization CALL. | ||||||||||||||||||||||||||
COLS$
|
To | Used to indicate the number of columns and horizontal alignment of each column. i.e., if COL$="LLCR" the grid will contain 4 columns, columns 1 and 2 left justified, column 3 centered, and column 4 right justified.
|
|||||||||||||||||||||||||||
Cell Line | S554$
|
To | Used to store parameters and data until printed | ||||||||||||||||||||||||||
COL
|
To | Column number where text will be printed, first column is 1. | |||||||||||||||||||||||||||
TXT$
|
To | Line of text to be printed. TXT$ can contain line feed characters ($0A$ ) to include multiple lines of text in the same cell. You can also CALL CDS554 with the same COL multiple times in order to print each TXT$ on separate lines within the same cell. See example below.
Trailing $0A$ are removed from TXT$ . TXT$ can contain any character except $01$ . |
|||||||||||||||||||||||||||
CELLOPTS$
|
To | Optional parameter that can contain in any order:
|
|||||||||||||||||||||||||||
Row | S554$
|
To | Used to store parameters and data until printed | ||||||||||||||||||||||||||
ROWOPTS$
|
To | Optional row options parameter that can contain in any order:
|
|||||||||||||||||||||||||||
S554$
|
To |
|
|||||||||||||||||||||||||||
S554$
|
From |
|
|||||||||||||||||||||||||||
S554$
|
N/A | The following fields are reserved for use by CDS554 and should not be altered by the application.
|
|||||||||||||||||||||||||||
Y6$
|
To | Printer Control data from printer selection routine CDS084. |
Example - Copy and paste to console mode to execute example |
2700 TEST:
|
Click here to view output |