<page width="837">
<column>
<text x="20" y="20">Hello World</text>
</column>
</page>
The root node of each template must be page, there must be a subordinate control under the page, and there can only be one subordinate control
The pixel of general small ticket printing is 1mm = 8px, it is recommended to leave a gap when setting the paper size
- Page -- Not translated
- Column -- Not translated
- Row -- Not translated
- RowFor -- Not translated
- Stack -- Not translated
- Table -- Not translated
- Barcode
- Line -- Not translated
- Qrcode -- Not translated
- Text -- Not translated
- Image -- Not translated
- If -- Not translated
Function:
now() // Get the current time
fd(number) // Format number
sum(list, filedName) // Total count value, list is the source data, filedName is the total field name, example sum(details,'qty')
toString(value) // Call toString() to convert to a string
Global Variable
data: Data Source
Row Variable
data: Data Source
$parent$: Parent Data Source
$rowIndex$ Row Index 0 1 2 ...
The calculated field uses the eval-property node
Demo
<eval-property attch="data.data" propertyName="totalAmount">
<!-- expression -->
sum(data.details, 'amount')
</eval-property>
Attribute explanation:
attch: Means attached to a certain path
propertyName: Calculated attribute name
$$ : Extract the field data of the array completely
Demo:
// DataSource
{
details: [
{
name: 'test1'
},
{
name: 'test2'
},
{
name: 'test3'
},
{
name: 'test4'
}
]
}
data.details.name -> 'test1'
data.details.$$name -> ['test1', 'test2', 'test3', 'test4']