CDS354

Print 2 column PCL Box

Last Revised: 04/12/15

This called routine can be used with PCL 5 compatible devices such as most laser or ink-jet printers, to print a PCL box with two columns and one or more rows.  The left column is typically used for the field title and is shaded.  The right column is typically used for the field data.

CDS354 requires the printer to have an internal, scalable, Univers typeface.  This has traditionally been available on most laser printers and copiers.  However Hewlett Packard has removed this internal typeface on many printers that support PCL 6, such as the LaserJet 2015 and the Color Laser All-in-One 2840.  Print the printer's PCL font list to insure compatibility.

CDS354 is called once for each row in the box, then one more time indicating that there will be no more rows.

Data Row

CALL "CDS354", COL1$, COL2$, LRC$

Note: You may call with less than the complete ENTER list to assume default values.

See Also:
CDS254 - Print PCL Text, Line, Box and Overlay
CDS454 - Print PCL Grid
CDS554 - Advanced PCL Grid

CDS354
Data Row
COL1$ Pass to CDS354 the data to appear in the left column of the box.  Use line feed characters ($0A$) to separate the text into multiple lines within the same cell.  This data will print in 9 point bold Universe proportional font, top aligned in the cell.
COL2$ Pass to CDS354 the data to appear in the right column of the box.  Like COL1$, you may use line feed characters when the cell contains multiple rows of data.  This data will print in in 10 point Universe proportional font, left and top aligned in the cell.
LRC$ This optional parameter determines the horizontal alignment, color, and font weight, of the text within the cell.  If not passed, then a default value of LL00 is used.
LRC$(1,1)Left Column Alignment (L=Left, C=Center, R=Right)
LRC$(2,1)Right Column Alignment
LRC$(3,1)Left Column Color (0=Black, 1=Red, 2=Green, 3=Yellow, 4=Blue, 5=Magenta, 6=Cyan, 7=White)
LRC$(4,1)Right Column Color
LRC$(5,1)Set to "B" to print Right Column text in bold weight

The text will be automatically reduced in size to fit in the cell should the column width be too small at the default font size. 

End of Data

Use CDS041 to obtain template for S345$ early in the program:
CALL "CDS041","CDS354",S354$,"YY"

Clear template's previous values, then populate and call:
S354.COL=10,S354.ROW=100
CALL "CDS354::DONE",Y6$,S354$

End of Data Call
Y6$ Printer control variable set by CDS084 and used by CDS354 to determine printer channel, etc.
S354.COL Dot column for upper left or upper right corner of box.  A positive value indicates the position of the upper left corner.  A negative value indicates the position of the upper right corner.  This is useful when you want the box flush with the right side of the page.  There are 300 dot columns per inch.  With standard 8.5" wide paper in portrait orientation, the dot columns range from 0 to 2399 with a 1/4 inch margin on either side.
S354.ROW Dot row for upper left corner of box.  There are 300 dot rows per inch.  With standard 11" long paper in portrait orientation, the dot rows range from 0 to 3299 with a 1/4 inch margin on top and bottom.  
BOXCOLS Optional.  Width of overall box in dot columns.
Positive ValueBox will be specified size
ZeroCDS354 will determine the box width based on the position of the box and the dots required for the data.
Negative ValueBox will not exceed size specified, but width will shrink to actual size required when size required is less than value passed.
MARGIN Optional parameter used to control the top & bottom margin in dots in the cell.  The default value is 10, which makes a row with one line of text 50 + 10 = 60 dots high, with two lines of text 50 + 50 + 10 = 110 dots high.  The smallest value is 1 which means a row would be 51 dots high.  You may pass MARGIN values of 1 to 255.  Note the default margin was changed on April 25, 2012 from 25 to 10 in order to duplicate the row height used in CDS454.  Check the date of CDS354 to determine your default margin.
LCOLWIDTH Optional parameter indicating the width of the left column in dots.
Positive ValueThe left column will be the number of dots specified.
ZeroCDS354 will determine the width of the left column based on a ratio of the longest data to appear in each column.
Negative ValueCDS354 will set the column width so that the longest text in the column fits without font size reduction.  All remaining space in the box will be in the right column.
RCOLWIDTH Optional parameter indicating the width of the right column in dots.
Positive ValueThe right column will be the number of dots specified.
ZeroCDS354 will determine the width of the right column based on a ratio of the longest data to appear in each column.
LCOLSHADE Optional parameter indicating the shading for the left column.
Positive ValueLeft column will be shaded using value indicated.  Typically not set greater than 1.
ZeroLeft column will be shaded to default value, which is 1.
Negative ValueLeft column will not be shaded.
RCOLSHADE Optional parameter indicating the shading for the right column.
Positive ValueRight column will be shaded using value indicated.  Typically not set greater than 1.
ZeroRight column will be shaded to default value, which is no shading.
Negative ValueRight column will not be shaded.
COLEND Set by CDS354 to the rightmost dot column used by the box.  Useful when it is necessary to know where data can be printed to the right of the box.
ROWEND Set by CDS354 to the dot row for the bottom of the box.  This can be used by the calling application for printing other data below this box.

CDS354 uses a temporary global variable SMS_CDS354 to store the text to be printed, and is cleared upon the final call.

Simple Example
0110 CALL "CDS084",Y$,Y5$,U0,S084$,Y6,Y6$
0120 CALL "CDS041","CDS354",S354$
0130 CALL "CDS354","Name","Jones Oxygen"
0140 CALL "CDS354","Address","1815 West Market St"+$0A$+"Akron, OH  44333"
0150 CALL "CDS354","Phone","440-985-1445"
0160 CALL "CDS354","Total","1,234.56","RR"
0170 S354.ROW=300
0180 CALL "CDS354::DONE",Y6$,S354$
0190 CALL "CDS094",Y6$,"E"
Output of example illustrating cells with multiple lines of text and color