CDS454
Print PCL Grid |
Last Revised: 10/27/10 |
This routine can be used to print boxes in a grid similar to a spreadsheet on PCL compatible printers.
CDS454 can print a grid of PCL cells (boxes) that:
- span multiple rows
- span multiple columns
- are shaded or unshaded
- are empty (no text printed in box)
- have text left justified, right justified, or centered
- contain Notepad text
See Also:
CDS254 - Print PCL Text, Line, Box, Overlay
CDS354 - Print 2 column PCL Box
CDS554 - Advanced PCL Grid
Calling Format:
CDS454 is called once with the SETUP option, then one or more times without it for each cell (box) to be printed.
CALL "CDS454::SETUP", ERR=XXXX, ATCOL, ATROW, COLS$, ROWS$, { LINEWIDTH }
CALL "CDS454", ERR=XXXX, Y6$, COLNO, ROWNO, { LCR$, TXT$, SHADE, BOXCOLS, BOXROWS,
FONTSIZE, VERTADJ, FONTNO, COLOR$, NP$ }
In order to print the cell borders, you must call CDS454 for each cell in the grid, even if there is no text contained within the cell.
SETUP Call | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ERR=
|
Take error branch if:
|
||||||||||||||||
ATCOL
|
Column position of upper left box in dots. There are 300 dots per inch. Zero is approximately 1/4" in from left of paper. | ||||||||||||||||
ATROW
|
Row position of upper left box in dots. Zero is approximately 1/4" from top of paper. | ||||||||||||||||
COLS$
|
A comma separated list indicating the width of each column. For example
"300,600,75" would indicate 3 columns with widths of 300, 600, and 75 dots.
A zero column width is supported as long as CDS454 is not called with
data in that column. The maximum width of a column is 65,535 dots
and the maximum number of columns is 255. Note that CDS454 adds 30
dots to each column for margin, so COLS$
should be based on the width of the text only (excluding the margin and
line width). You can use
CDS262 to compute the width in dots for any text. Example:
"1167,1167" would allow for 2 equal columns with a
total width of 2400 dots (8 inches), with 30 dot margin (15 dots left,
and 15 dots right), and 2 dot line width, i.e.,
2+15+1167+15+2+15+1167+15+2=2400 dots. |
||||||||||||||||
ROWS$
|
A comma separated list indicating the height of each row. The
maximum height of a row is 65,535 dots and the maximum number of rows is 255.
Example: "48,58,58,58" would be appropriate for 1 standard
heading row followed by 3 detail rows, each containing one row of text
in the cell. If the last detail row contains two lines of text,
then "48,58,58,106" would be appropriate.
ROWS$ should exclude LINEWIDTH dots.The
overall row height in dots including the line height of the cell border
line printed above the text, will be the
|
||||||||||||||||
LINEWIDTH
|
Optional parameter that can be passed when you require a line width other than the 2 dots default.
The maximum LINEWIDTH supported is 255. |
||||||||||||||||
Cell Call (no ::SETUP) | |||||||||||||||||
ERR=
|
Take error branch if:
|
||||||||||||||||
Y6$
|
Standard Printer Control String as returned from CDS084 | ||||||||||||||||
COLNO
|
The column number of the cell within the grid. The first column is 1, the second column is 2. The maximum number of columns is 255. | ||||||||||||||||
ROWNO
|
The row number of the cell within the grid. The first row is 1, the second row is 2. The maximum number of rows is 255. | ||||||||||||||||
LCR$
|
Optional indicator indicating alignment of cell contents
|
||||||||||||||||
TXT$
|
The text to be printed inside of box. Can be null. Font will shrink to fit box size when necessary.
TXT$ can also contain line feed characters ($0A$) in order
to print multiple lines of text inside the same cell/box. |
||||||||||||||||
SHADE
|
Optional indicator for shading
|
||||||||||||||||
BOXCOLS
|
Optional indicator used to indicate that a cell is to be joined with cells to the right of
COLNO . BOXCOLS of 2 indicates two cells are joined. |
||||||||||||||||
BOXROWS
|
Optional indicator used to indicate that a cell is to be joined with cells below
ROWNO . BOXROWS of 2 indicates two cells are joined. You may use both
BOXCOLS and BOXROWS to create boxes that span both multiple rows and multiple columns. |
||||||||||||||||
FONTSIZE
|
Optional parameter to override the default point size of 10 for
un-shaded cells, and 9 for shaded cells. When FONTNO
is passed as 4099 for Courier Font, then FONTSIZE
represents the characters per inch (pitch) and not the point size. |
||||||||||||||||
VERTADJ
|
Optional parameter to override the default vertical position of the text position within the cell. The default values are 39 dots for un-shaded cells, and 33 for shaded cells. | ||||||||||||||||
FONTNO
|
Optional parameter used to override the default font number of 4148. Typically passed as 4099 when it is necessary to print in a fixed width font such as Courier. Refer to CDS254 documentation or your printer's internal font list for a list of valid font numbers. | ||||||||||||||||
COLOR$
|
Optional parameter used to change the text color of the cell.
COLOR$ can be a literal color such as 'red', 'green', or
'blue', a hexadecimal RGB color such as FFAA22, or a decimal RGB color
as in 128,64,32. Note that after this cell prints in the color
specified, the default color is changed to black. Refer to
CDS254 for additional information about
printing in color. |
||||||||||||||||
NP$
|
Optional parameter used to specify Notepad file name and Text ID
separated by a comma, i.e., NotepadFileName,TextID. You can also
specify a starting line and ending line line within the notepad text
when it is necessary to print only a portion of the notepad, i.e.,
NotepadFileName,TextID,StartingLine,EndingLine. The notepad
text will print below TXT$ if present. There is no
logic in CDS454 to insure that the notepad text will fit on the page.
Use CDS554 when you require logic to insure the notepad fits on the
page. |
Examples |
1000 GROUP1:
|
Click for Example Output |