Development > Script dictionary > ZPL reports 

This function is used to describe reports to be printed on ZPL printers. A ZPL printer is a special printer that can receive data flows formatted using the ZPL language. Their main purpose is to print labels.
A ZPL report:

  • is linked to a standard Crystal Reports report (via a ZPL checkbox and a connection link),
  • shares the same parameters (that can be used in the selection criteria)
  • uses a data model and selection criteria to define those data that feed the print flow,
  • is based on a file template that defines the format,
  • uses calculated expressions that can be listed in the record and are submitted to specific conditions.

A Crystal Reports report will be printed quite normally if the print destination is Preview, Printer, Message, File, or Archiving. On the other hand, if the output type is ZPL printer, the ZPL report will be generated in lieu of the Crystal Reports report for direct transmission to this printer's port.

Prerequisites

SEEREFERTTO Refer to documentation Implementation

Screen management

Entry screen

Fields

The following fields are present on this tab :

Block number 1

Is used to identify a setup of ZPL print. This code is attached to a report.

  • Description (field INTIT)

[object Object]

  • Active (field ENAFLG)

Select this check box to activate the current record.

Disabled records keep their content and setup but cannot be used (by recalling their code) on other records (documents, settings ...), or for mass processes.

The authorizations to a given function can prohibit the creation of an active record. In this case, the check box is disabled by default. It can only be modified by an authorized user or through a signature Workflow.

Block number 2

  • Template file (field PATNAM)

Is used to indicate a template (or "pattern" according to the terminology used) to generate the finale file that will be printed. This field is not mandatory for a manual creation of a file by using the ARZ_REPORT action.

When a template is defined, it is stored in the base and versioned. It is then possible to use a given version number.

A template contains one or several sections with ZPL code inside. In order to create a template, the user must create this file in the PAT directory of the current application by giving it a name that will be the name recalled in the file and an extension pat. It should be noted that a zoom is used to inquire the pattern files but cannot be used to filter them (the user should use a dedicated editor to do so).

To create a new report, the template file must exist if it has been entered and the creation of the record will lead to the reading of the file and the storage of its characteristics in the base in the form of a number 1 version.

It is then possible to supply a modified template by placing a new version of the file in this directory, by storing this new version via right click New version on this template code. It the creation date of the new file is the same as the version of the previous file, the message "No new version" will be displayed, otherwise the system stores in the base the new version, increases the new version and suggests by default this new version for the report (but it is possible to return by selecting a previous version).

A pattern file can be one of the following types:

  • mask: in this case, a mask containing variables will be predefined and loaded in the print server memory. A group of data will then be sent and merged with the mask to make the labels. The mask description can be viewed in the "Mask" tab.
  • structured: in this case, the group of data is designed with a header, some lines and a description footer. Every dimension can be viewed in the corresponding tab.
  • Version (field VER)

This field is used to define the version of the pattern used during the print. Indeed, each version of the pattern is stored and can be used.

During the print, the version used by default is the last version; however if a setup named "version" has been added in the list of the report setups, the value entered will be taken into account.

  • Mask issue (field ENVMSK)

This tick box prevents the user from sending the mask to the printer.
The print saves the masks and the mask sending is an operation that can take a long time, above all in the cases of graphs.

Data

The data template is used to generate a link that will be used to read the data to generate the file.
This link is generated in a WMZPL* processing after a setup creation or modification. The [Validation] button is used to force the generation of the processing.

Table number 2

  • Criteria (field CONDIT)

This field is used to define criteria that will apply to the request (linked via a logical "and" if several lines are entered), these criteria are directly passed to the base via the Link instruction clauses if the formula does not contain specific functions (such as Func), otherwise, it will be used as a filter during the reading.

Among the interesting functions, the user should note the function func ARZIMP.PARAM("name"), that is used to get the setups passed to the report. This specific function is optimized in the request by being converted to a constant.

It should be noted that the user can also add selection criteria in the data template.

Grid Expression

  • Number (field NUM)

This number is used to use the expression in a tag (n=number):
- X3E_n  managed in the "parsing" type patterns
- ^FNn  managed in the "mask" type patterns

This tag will be replaced by the valued value of the expression in the file.
A single number can be found several times. This is the defined condition on each line that is used to take into account the right number.

  • Condition (field CND)

Each calculated field is identified by a number. This condition is used to manage several lines that concern the same number: in this case, the expression retained for a given number will be the first expression where the condition is complete.

  • Expression (field EXPLIG)

This expression is valued in the read loop defined by the data template, when generating the file sent to the print.

Close

 

Specific Buttons

It generates the processing that will be executed to enable the generation of the flow for transmission to the printer.

Error messages

In addition to the generic error messages, the following messages can appear during the entry :

No new version

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

Tables used

SEEREFERTTO Refer to documentation Implementation