Understanding the Receipt XML Structure
Hi, my name is Kumar and in this video I will demonstrate XML structure of iVend POS Receipt.
Any user with basic XML and programming knowledge can customize the iVend POS receipts.
Let us see how it is done.
In Management Console, under Administration, go to Retail Configuration and in Retail Configuration select the menu Print Profile. Print Profile Search screen appears. Choose the available Print Profile and click Edit button to edit the record. You can edit the XML format of any of these POS receipts by clicking on Document icon in the Data column.
Now, before moving ahead let us see the transaction receipt. So, let us go to Point of Sale. On Point of Sale, let us do a transaction, and you can see this is the standard output of the transaction receipt.
The receipt can be customized by modifying the XML structure of the receipt. The sample XML documents for transaction receipt is available in your iVend Server, so let us go to that location.
In iVend Server, go to iVend Installation folder, go to Management Console, and then select Receipt Format and here is the TransactionRreceipt.XML. Open this in any XML editor. This is the document structure.
Here, first element is Document. This is parent tag for the receipt. Next element is Image. Attributes of this element are File Name which refers to the logo needs to be printed on the report. Logo Image file needs to be mandatory in C drive and in monochrome BMP format.
Then, next attribute is Width. This refers to the width of the image. The value should be height plus width of the image in pixel.
Next attribute is Alignment. It refers to the horizontal alignment of the image. Valid values are Left, Center, Right.
Next element is Row and Element. Row element has the attribute Print Blank Row which refers to the bullion value which defined whether the row needs to be printed at runtime. If no data is retrieved for the property defined in the element Object 0 attribute, and element, Element attributes are ColSpan which refers to the column spanning of the report. In iVend Report, by design the report is divided into 4 columns. If you need to print anything in full row, then defined ColSpan equals to 4 for the element.
Then, Aligned which refers to the horizontal alignment of the row and valid values are Left, Center, and Right.
Then, Double Height attribute refers to the bullion value which defines the double height of the row. By design, single row is taken height equals to font size 8.
Then, Font Style attribute refers to the font style and valid values are italic or bold.
Object 0 refers to the object property for which the value needs to be printed. Mathematical calculation can be done between the object properties.
Then, Object 1 refers to the object property for which the value needs to be printed. Mathematical calculation can be done between the object properties. Please note, Object series can be any long such as object 0, object 1 and so on.
Then, String attribute refers to the value printing of the properties defined in the object 0 till object N attributes. This attribute takes values as defined in the argument pattern. Any Unicode character including blank space is allowed to be printed before or after the argument printing. Alternatively, this attribute can be used to print the label values without referring to the object values.
Format Attribute refers to the general screen format allowed in the C sharp language. For example, date time format.
Next element is Separator. Separator element has attribute Object. Object attribute refers to the Unicode character which draws the separator line to differentiate the multiple rows.
Next element is Enumerator. Enumerator element has object attribute. Object attribute refers to the object property on which looping needs to be executed. Please note, there will be at least one row element and multiple Element, element based on the element ColSpan value.
Next element is Header. Header element has no attributes, and it is more of giving separation in the code to identify different sections in the report.
Next is 'if,' 'else' condition. To give programming condition to print the data. Attributes of 'if' element are Object. Object attribute refers to the object property on which condition is executed. Operator attribute refers to the conditional operator and valid values are Not Equal, Equal, Greater Than, Greater Than or Equal, Less Than, Less Than or Equal.
Then, Value attribute has fixed String value to compare with and if you want dynamic value from database, then use Compare Object attribute which refers to the object property to compare with. Please note, 'then' element is mandatory as mentioned here. However, 'else' element is optional.
Now, moving to next element which is Blank Line. Blank line does not have any attribute and used to give blank row in the receipt.
Then, we have Barcode element. Attributes of Barcode element are Symbol which refers to the Barcode format. Valid values are EAN, UPC, code 128, ITF-14, Code 39.
Height attribute refers to the height of the barcode.
Width attribute refers to the width of the barcode.
Alignment attribute refers to the horizontal alignment of the barcode. Valid values are Left, Center, and Right.
Text position attribute refers to the vertical position of the text and valid values are Top and Bottom.
Then, Barcode position attribute refers to the vertical position of the barcode and valid values are Top and Bottom.
Then, next element is Paper Cut. Paper Cut element does not have any attribute and used to give paper cut feature in the receipt if supported by the hardware.
You may have other element as well. For that, let us open another XML report.
Let us take this one. Here, we have Variable element. Attribute of the Variable element is Variable Name which refers to the name of the variable to be used in the receipt.
Next is Variable Set Value element. This element is used to set the value of the variable declared by the Variable element. Attribute of the Variable Set Value are Variable Name which refers to the name of the Variable which is defined earlier in the script.
String attribute refers to the constant value to the variable.
Object 0 attribute refers to the object property whose value will be set in the variable.
Please note, Variable Set Value element cannot be defined inside the row element. So, with the understanding of these elements and attributes, user can customize the iVend POS receipts.
With this, we end our session.
Thank you for watching this video.