User Tools

Site Tools


Getting started with PrintList Pro

Creating your first PrintList Pro Area

It’s easy to create your first PrintList Pro list area.

  1. Create a new form, or open an existing one that you want to add a list to.
  2. Choose Plugin Area from the Plugin / Subform / Web Area button in the object bar:
  3. Your cursor will turn into a crosshair. Draw a box on the form in the size that you want your list to be. This will create a rectangular box named Plugin Area.
  4. In the Property List window, choose PrntListPro from the Type popup menu. (If the “ PrntListPro ” option is not available, please refer to the installation instructions).
  5. Enter a name for your new area in the Variable Name field in the Property List window.
  6. Your area will now show the PrintList Pro version and copyright information.

The variable name will be used as a parameter for the PrintList Pro commands.

Be careful to never have two PrintList Pro objects with the same variable name on a 4D form.

Working with PrintList Pro Commands

Each command you write must adhere to a specific syntax in order for it to be correctly understood by PrintList Pro. Some commands return a result: these are functions. You can use the commands and functions to configure every operation performed by PrintList Pro, and to get various information.

Each PrintList Pro command has a syntax, or rules, that describe how to use the command in your 4D database. For each command, the name of the command is followed by the command’s parameters, and result in case of functions.

A PrintList Pro command syntax looks like this:

PL_SetHdrStyle (areaRef:L; columnNumber:L; fontName:T; size:L; styleNum:L)

The parameters are enclosed in parenthesis, and separated by semicolons.

Command parameters

Each parameter is followed by a colon and a letter indicating the type of data required for that parameter:

:L - longint
:O - blob
:P - picture
:R - real
:T - text
:Y - array
:Z - pointer

Each is preceded by one of three arrow signs, which indicate whether it is a value that you pass to the command or one that the command returns to you, or a value that is passed, then modified and returned by the command in the same parameter:

→ parameter – A value that you pass to the command

← parameter – A value that is returned by the command

Note: when calling a plugin command, all omitted parameters are initialized to the NULL of the respective types (0, 0.0, "", !00:00:00!, …).

When to use the PrintList Pro Commands

The PrintList Pro commands must only be executed in the On Printing Detail phase of a form method or object method during the execution of the PRINT SELECTION or PRINT RECORD command.

The PRINT SELECTION command will execute a On Printing Detail phase for each record in the current selection (and requires at least one record in the current selection to be executed at all). PrintList Pro will print the array(s) in any PrintList Pro object once for every record in the current selection.

If you wish to use PRINT SELECTION to print an array only once, ensure that there is only one record in the current selection of the table used for printing (the one that holds the layout, which doesn't have to be related to the data that is actually printed).

If you wish to use PRINT RECORD, ensure that there a current record in the table used for printing (the one that holds the layout, which doesn't have to be related to the data that is actually printed).

Upgrading from Previous Versions of PrintList Pro

To upgrade to PrintList Pro version 6, simply install it as described in the Installation section of this manual, replacing your older version.

New in version 6

Version 6 includes 64-bit compatibility, MySQL direct access, use of all AreaList Pro relevant properties, new properties and new commands.

See the PrintList Pro v6 New features section.

New in version 5

Compatibility Notes

New features

  • PrintList Pro version 5 and 6 support Unicode for printing.
  • Styled text is supported.
  • PrintList Pro version 4.x commands are still here: your previous code should work fine, give or take the few changes and minor deprecated features below.
  • The PL_Register command returns 0 for OK and an integer between 1 and 12 if not OK.
  • The 4D project method Compiler_PLP is no longer needed.

In addition, PrintList Pro uses native drawing. Not all fonts contain italic (or bold) variations and those technologies do not synthesize styles. For example Geneva on most Macs has only the Regular typeface, Arial has Regular, Bold, Italic and Bold Italic typefaces.

Note: if bold or italic styles are set, but not installed for the font, PrintList Pro will print regular (plain) characters.

Removed features

  • Picture escapes in text.
  • Outline and shadow styles.
  • Escape characters (“^1234” in cell data or headers) , including the first parameter to PL_SetMiscOptions
  • Patterns. They are interpreted by PrintList Pro version 5 as transparency ratios:
    • “black”: 100 %
    • “darkgray”: 75 %
    • “gray”: 50 %
    • “lightgray”: 25 %
    • “white” or “none” or "" or anything else: 0 % = no drawing
  • PL_SetCellIcon only supports pictures from the 4D Picture Library or on PrintList Pro's own library . ‘cicn’ and ‘PICT’ resources are no longer supported.

Removed commands

  • PL_GetAdvProps (did nothing in PrintList Pro 4.7, anyway)
  • PL_SetArrays (must use PL_SetArraysNam)
  • PL_SetHeaderIcon (use PL_SetCellIcon with cellRow = 0)
  • PL_SetSubSelect
  • PL_SaveData (was documented as obsolete – use the new PL_Save in XML)
  • PL_RestoreData (was documented as obsolete – use the new PL_Load in XML)

New Configuration commands

PL_AddColumn (areaRef:L; dataPointer:Z; insertAt;L) → result:L

  • add column at position insertAt; zero means append to the end
  • when in Records mode, dataPointer should be a pointer to a field
  • when in Arrays mode, dataPointer should be a pointer to an array (must not be a local array!)

Note: this command supports the component architecture (using arrays from the host database in a component and vice versa).

PL_Load (areaRef:L; XML:T) → result:L

  • initialize an area from XML

PL_Save(areaRef:L; XML:T) → result:L

  • save the area settings into XML

New RGB commands

PL_SetBrkColRGBOpt (areaRef:L; breakLevel:L; columnNum:L; showColDivider:L; lineWidth:F; dividerRed:L; dividerGreen:L; dividerBlue:L)

PL_SetBkHColRGBOpt (areaRef:L; breakLevel:L; columnNum:L; showColDivider:L; lineWidth:F; dividerRed:L; dividerGreen:L; dividerBlue:L)

PL_SetBrkRowRGBDiv (areaRef:L; lineWidth:F; dividerRed:L; dividerGreen:L; dividerBlue:L)

New Break Processing commands: Computed Breaks

PL_ProcessArrays (callbackMethodName:T; breakArrays:Y; dataArrays:Y; useDetail:L) → error:L

PL_GetBreakValue (handle:L; column:L; calculation:L) → value:F

See Using Computed Breaks for details about these powerful new commands, which can be used as array utilities without need to print anything or set up a plug-in area.

Additions to existing commands

  • PL_SetColOpts has a new longint parameter at the end (ignored on Mac): 0 = use GDI plus for drawing (default), anything else: use GDI for drawing
  • PL_SetColOpts (areaRef:L; hideLastColumns:L; hideDetailArea:L; drawingEngine:L)
  • PL_SetFormat has three new parameters at the end:
    • longint: 0 = plain text (default), anything else = attributed (multi-style) text
    • real: line spacing to use, 0 is substituted by 1 (default)
    • longint: vertical alignment 0 - default, 1 - top, 2 - center, 3 - bottom

Note: the multi-style property is applied to all formatting in that column… breaks have to account for that!

  • PL_SetFormat(areaRef:L; columnNumber:L; format:T; columnJust:L; headerJust:L;usePictureHeight:L; attributed:L; lineSpacing:F)

Two 0.25 point lines will be printed.

New break features

In break calculations, “\Var” will compute variance and “\Dev” will compute standard deviation.

Printing an AreaList Pro area

To print AreaList Pro areas, just call AL_Save and PL_Load: they use the same XML UTF-8 format.

Then set row/cell options and you are done. Or add break processing options.

Using this feature will allow you to indirectly apply AreaList Pro v9 numerous formatting options (using the v9 property-based API) to a PrintList Pro area using an AreaList Pro area as the source.

Note that this feature is only available for persistent AreaList Pro properties. Refer to the AreaList Pro v9 manual for property persistence.

getting_started_with_printlist_pro.txt · Last modified: 2020/04/02 18:11 by plp_admin