Last updated: 11.09.2020

Syntax - text reports

Syntax: <item name="tag"/>

Example: retrieves the order number on the order

<item name="DEL_Id"/>

Lists

There may be many instances of some items in an order, such as packages and shipments. In order to be able to display information about such objects in the report, the tag has to be combined with a list tag so that all the instances of the item are counted. The result is a list with one or more entries.

The list in the report can be structured in various ways. A heading can be entered for the whole list, or a description can be written that repeats on each line. It is also possible to combine several tags belonging to the same list, thus creating a list with, for example, the package ID and the weight of each package in an order.

The entries in the list do not have to be numbers, but can also be text, for example PAC_Text, which returns the free text field for parcels on an order.

Syntax:

Optional text

<query command="list tag">

Text of your choice: <item name="tag"/>

</query>

Example 1

List of package IDs and a description for each line

<query command="Packages">
Kollinummer: <item name="PAC_PackageId"/>    
</query>

Returns a list in the following format

Package ID: 134567

Package ID: 987645

Package ID: 345678

Example 2

List of package IDs and a heading for the whole list

Kollin
<query command="Packages">
- <item name="PAC_PackageId"/>    
</query>

Returns a list in the following format

Packages

- 134567

- 987645

- 345678

  • If you don't want an extra line break between the list and the heading, type the heading on the same line as <query command="list tag"> (see example 3).

  • There must be something in plain text at the beginning or end of line 3 to make the entries in the list appear on separate lines in the notification (the hyphen in the example above and “kg” in the example with numbers below). Otherwise, they are lined up one after the other without spaces (“item1item2item3” and so on).

Example 3

List of package IDs, weight and goods text

Kollin <query command="Packages">
<item name="PAC_PackageId"/>: <item name="PAC_Weight"/> kg (<item name="PAC_Text"/>)
</query>

Returns a list in the following format

Packages

123456: 1.200000 kg (Folder with documents)

356789: 3.400000 kg (Fragile)

986554: 5.600000 kg (Accessories)

  • If you want to have an extra line break between the list and the header, write the header on a separate line (see example 2).

  • If one of the packages does not have any goods text, an empty bracket is displayed.

Figures

Numbers are stored with six decimal places in the Opter database. If you want to round to fewer than six decimal places, type a format tag and the number of decimal places to display according to the pattern 0.00 in the tag that returns the number. The number of zeros entered after the decimal point defines the number of decimal places.

To exclude unnecessary zeros at the end of numbers (2.7 instead of 2.70), but print the decimal if it is not a zero (2.73), enter # signs for the number of decimal places that are to be shown.

Syntax: <item name="numeric value tag" format="0.######"/>

Example 1

Always displays two decimal places whether they have a value or not

Vikt <query command="Packages">
<item name="PAC_Weight" format="0.00"/> kg
</query>

Returns a list in the following format

Weight

2.00 kg

2.70 kg

12.74 kg

Example 2

Displays up to three decimal places if they have a value

Vikt <query command="Packages">
<item name="PAC_Weight" format="0.###"/> kg
</query>

Returns a list in the following format

Weight

2 kg

2.7 kg

12.738 kg

Example 3

Always displays two-digit integers and two decimal places

Vikt <query command="Packages">
<item name="PAC_Weight" format="00.00"/> kg
</query>

Returns a list in the following format

Weight

02.00 kg

02.70 kg

12.74 kg

See also