Leveraging EPP Counter Elements

Some customers may have a need to print a series or batch of labels with mostly consistent data and would like to include a count that represents the order in which the labels are printed. While some may implement a loop in their external application or scripts to submit individual print requests, there is a much easier way to achieve this.

EPP Data Dictionaries have a Counter section which allows users to create an item that can increment or decrement from a constant starting point OR a Variable defined number.

These counts will only be applied across a single print request based on defined label quantities OR when implemented in part of a multi-label / batch print request.

Product Release/Version

All EPP 10 build versions support Counter printing, though there were corrections made to some Counter scenarios introduced in EPP 10.1.0.2. Sample printouts in this guide were produced with EPP 10.2.0.0.

Data Dictionary Counters

A counter field is used to automatically increment or decrement a value of a barcode or text field on the label template.

These are the primary attributes when defining an EPP Counter.

Name
Define a unique name for the field. Spaces are not permitted.

Comment
Optional. Enter a description.

Start Value
Select the starting value for the counter or enter the starting number; the counter starts at this number each time you print labels.

Length
Enter the maximum length of the counter. At print time, the full length of the counter field is used, and data that does not fill the entire length is left-padded with zeros. For example, a length of 5 for the 12th iteration of the label would result in a printed counter field of “00012”.

Increment by
Enter the amount of the increment. The counter increases or decreases by this increment each time a label is printed. If you enter a positive increment, the numbers increase from the starting number. If you enter a negative increment, the numbers decrease from the starting number. For example, if the starting number is 001 and the increment increases by 5, the first label will be 001, the second will be 006, and the third will be 011.

New Record
When selected, the counter is only applied to new records.

Copies
When selected, the counter is applied to new records as well as copies.

Reset
When selected, the counter is reset after each record is printed.

Counter Printing Sample 1

To help illustrate how the different counter modes will work, I have created a very simple label template that utilizes New, Copies, and Reset counter items.

Simplified Label Template Design and Data Dictionary Items

This basic label template is using 6 of the defined Counters from a test data dictionary. Both the ‘Counting.ldd’ data dictionary and ‘counterLabel.lbl’ label template are attached to the bottom of this guide.

XML Batch Print Example

This XMLprint request includes 3 ‘label’ sections inside a ‘labels’ batch print request. The _QUANTITY overrides for each ‘label’ section will override the ‘labels’ _QUANTITY assignment, when defined.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE labels SYSTEM "dsi-label.dtd">
<labels _FORMAT="counterLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="3">
    <label _FORMAT="counterLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="3">
        <variable name="label">Label #1</variable>
        <variable name="counterInput">5</variable>
    </label>
    <label _FORMAT="counterLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="5">
        <variable name="label">Label #2</variable>
        <variable name="counterInput">5</variable>
    </label>
    <label _FORMAT="counterLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="7">
        <variable name="label">Label #3</variable>
        <variable name="counterInput">5</variable>
    </label>
</labels>

More about XML print request formatting can be found in this post, XML Print Request Formatting

Printed Results

Below is a quick example of the counter configuration types being printed.

The PDF sample is attached to this article.

Counter Printing Sample 2

You can also use counters in a data dictionary Concatenated formula, to show an X of Y count. You can configure the Counter item for X to start at 1 or any constant number you like OR leverage a Variable assignment to define where you want the count to start.

Simplified Label Template Design and Data Dictionary Items

This is another basic label example where we are using a concatenated item to demonstrate X of Y counting. This sample label also includes a 5 digit length Counter passed to a Code128 barcode and text field.

The ‘CountOfTest.lbl’ label template example is also attached to this article.

XML Print Example

This print request starts the count at 7, with a quantity of 14 labels to be printed. We have also defined the last label count as 20, for the Y portion of our concatenation formula.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE labels SYSTEM "dsi-label.dtd">
<labels _FORMAT="CountOfTest.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="14">
    <label _FORMAT="CountOfTest.lbl" _PRINTERNAME="defaultSite#FauxPrinter">
        <variable name="label">Count Of</variable>
        <variable name="counterInput">7</variable>
        <variable name="lastCount">20</variable>
    </label>
</labels>

Printed Results

Below sample shows the results of the print request.

The PDF sample is attached to this article.

Attached Samples

Counting.ldd (533 Bytes)

Test.printing.counterLabel.01.pdf (24.9 KB)

Test.printing.CountOfTest.01.pdf (20.6 KB)

CountOfTest.lbl (825 Bytes)

counterLabel.lbl (1.8 KB)