ZPL reports

Use this function to describe reports to be printed on ZPL printers.

Presentation

What is a ZPL Printer?

ZPL printers are label printers that use the Zebra Programming Language (ZPL), a command-based language developed by Zebra Technologies. ZPL controls the formatting, layout, and printing of labels at high speed.

These printers are optimized for performance and are ideal for high-volume environments such as:

  • Warehouses

  • Manufacturing facilities

  • Logistics centers

  • Retail operations

Unlike standard printers, ZPL printers process commands directly in their firmware, reducing graphic processing on the computer side and significantly speeding up print times.

ZPL language overview

ZPL uses text-based commands to describe label layout, including:

  • Format commands: Define label size, print speed, darkness, and so on.

  • Field data commands: Insert text, bar codes, or images.

  • Control commands: Start and end of labels, quantity to print, and so on.

This approach minimizes data transfer and maximizes printing speed.

ZPL reports in Sage X3

In Sage X3, ZPL reports are designed to work with ZPL printers. ZPL reports:

  • Are linked via a checkbox and connection link

  • Can share parameters with ZPL printers or Crystal Reports

  • Use a data model and selection criteria to define the data feeding the print flow

  • Are based on a file template (.PAT) that defines the label format

  • Include calculated expressions that can be listed in the record and are subject to conditions

Output behavior

  • If the output destination is Preview, Printer, Message, File, or Archiving, the Crystal Reports report is printed normally.

  • If the output type is ZPL printer, the ZPL report is generated and transmitted directly to the printer’s port.

Performance improvements

Since release 2025.R2/V12.0.38, local variables are used to evaluate the conditions required for generating the report prior to executing the Link instruction. This change significantly improves the performance and accelerates the overall process execution.

ZPL file structure

A ZPL file typically includes:

  • A header:

    Copy
    ^XA
    ^DFR
    ^XZ
  • A body:

    Copy
    ^XA
    ^CF0,160
    ^FO220,50^FDSAGE^FS
    ^CFA,30
    ^FO50,300^FDThis line is hardcoded^FS
    ^FO50,340^FVX3E_1^FS
    ^FO50,380^FVX3E_2^FS
    ^FO50,420^FVX3E_3^FS
    ^XZ
  • A footer:

    Copy
    ^XA
    ^IDFR
    ^XZ

You can create these files using a plain text editor and save them with a .PAT extension. You then need to place them in the server directory: <folder>/PAT/*.PAT.

For more information, refer to the Zebra printing how to guide.

Prerequisites

Refer to the implementation documentation.

Screen management

The screen is defined in 3 sections:

Entry screen

Specific buttons

Error messages

Other than the generic messages, the following error message can appear when entering data:

No new version

An attempt was made to save a new version of the print template, but the supplied file is older than the previous one.

Tables used

Refer to the implementation documentation.