Creating Labels

Overview

Label generation in WinMan consists of two parts.

Firstly, is the query to generate the data that the label requires. This could be the lot numbers of the products being put away or the develiery address of the shipment being processed.

Secondly, is the label template that defines how the data should be presented on the label itself. This uses the ZPL labelling language, alongside the Scriban scripting language, to dynamically change the template at render time with the actual data to be printed.

Creating a Label

  1. Open the Label module
  2. Select “New Label” from the actions
  3. Give the label a name and any description required
  4. (optional) Select a default printer and the default number of copies
  5. Enter the action name. This is the name that is displayed on the action within WinMan to print the label.
  6. Select the “Query” tab and enter the query you required to generate the data for your label.
    A parameter of @Ids is supplied with a comma seperated list of the keys of the ietms to be printed.
    A parameter of @Source is also provided with the source of the keys. This can be useful when you want to use the same label from multiple sources, an address label for example.

    An example query for printing a location label is shown below.
SELECT 

loc.id,
loc.code,
loc.name,
loc.description

FROM dbo.[location] loc
WHERE loc.id IN (SELECT value FROM STRING_SPLIT(@Ids, ','))
  1. Select the “Template” tab and enter your ZPL code to be used.
  2. Wrap the ZPL code with a Scriban loop statement so that the label is processed once for each row of the query data.
  3. Replace any elements of the template that need to be rendered from the dynamic query data using Scriban placeholders.
    Use the {{Copies}} placeholder if you need to dynamically control the number of copies to be printed.

    An example template is shown below
{{ for LabelData in RecordData }}
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ
^XA
^MMT
^PW812
^LL1218
^LS0
^FT75,265^A0N,124,76^FH\^FD{{LabelData.name}}^FS
^BY3,3,162^FT76,604^BCN,,Y,N
^FD>:{{LabelData.code}}^FS
^PQ{{Copies}}
^XZ
{{ end }}
Updated on July 18, 2023
Was this article helpful?

Related Articles