SAP Anywhere provides you with default print templates. You can edit the templates and then upload them back to the system. If you do not set one as default, then the system will let you choose a template from those that currently exist when printing. Please make sure the template is XLSX format.

If you need to customize the template to suit your business needs, for example to add/remove information or change the layout, you will first need to familiarize yourself with the template’s three basic elements:

Field label

The words and terms to be printed, such as “Number”, “Customer Name”, and “Shipping Date”.

Field value

The strings using the “${…}” format, such as “${docNum}” and “${line.unitPrice}”. Insert a field name into the format, and it becomes a field value, as shown in Figure 1.

pic1 en

For images, the field value type is required: <jx:image source="${…​}"/>, such as <jx:image source="${picVar}"/>, where "picVar" is the field name of the image, which is normally a URL.

For barcodes, the field value type is required: <jx:barcode type="UPC-A" source="${…​}"/>, such as `<jx:barcode type="UPC-A" source="${product.barcodenumber}"/>, in which "UPC-A" is the supported barcode type, “product.barcodenumber” is the field name of the barcode, normally a number. Supported barcode types include Code 128, EAN-128, UPC-A, UPC-E, EAN-13, EAN-8, Code 39, ITF-14, and QR Code (ISO/IEC 18004:2006(E)).

For date and time fields, they will be displayed according to the timezone set in Company Profile.

If there are custom fields in the header section of the document, these fields can be added to the template. Add the field name into a specified field value using this format: ${udf["…​"]}, in which the "…​" is the custom field name, such as ${udf["udfName"]}. If the field is listed in the template’s data table, the field value is ${line.udf["udfName"]}. If the field is listed in an associated object, such as to add a custom field in customer to sales order template, the field value is ${customer.udf["udfName"]}. You can put the fields for global business objects in any template, which are listed here. If it is a custom field, such as a field in Company Profile, the field value should be "${company.udf["udfname"]}".

In the template, a field label usually appears above or on the left of the field value. However, you may also find field values that do not have corresponding labels. These details can be entirely determined by you. You can use functions provided by Microsoft Excel to customize the style, such as adding a thousands separator, adjusting the font type, font size, date format, or set the header and footer to make them shown in every printed page.

For print templates with data tables, do not delete the header or footer of the data table, as shown in Figure 2. Do not merge cells from different rows or columns in the data area; otherwise the printing performance will be impacted.
pic2 en
Formula

You may need some basic calculations in a template. In case of unintended errors, we recommend you to use the formulas and below:

  • +: Add, used in cells with numeric values

  • -: Minus, used in cells with numeric values

  • *: Multiply, used in cells with numeric values

  • /: Divide, used in cells with numeric values, such as $[E5+B4*5-C3/B1], in which E5, B4, C3, B1 all refer to the cells in the template.

  • SUM: Summary of a range of values, such as $[SUM(D41)], where D41 refers to value of each line in the table; an example of the other syntax is $[SUM(G47:G49)], which adds value between G47 and G49, and $[SUM(G47,G49)], which adds value of G47 and G49.

  • AVERAGE: Average of numeric values, such as $[AVERAGE(D41)], where D41 refers to value of each line in the table; an example of the other syntax is $[AVERAGE(G47:G49)], which is the average value between G47 and G49, and $[SUM(G47,G49)], which is the average value of G47 and G49.

  • COUNT: Count of the cells with numeric values, such as $[COUNT(D41)], where D41 refers to value of each line in the table; an example of the other syntax is $[COUNT(G47:G49)], which is the number of the cells between G47 and G49, and $[COUNT(G47,G49)] is the number of cells referring to G47 and G49.

If you use above formulas, please directly use $[] in the cell. Do not input an equal sign (=) before the value. The template does not support multiple work sheets, such as $[SUM(Sheet2!B10) - 'Sheet 1'!D15].