Working with Expressions
The value, visual appearance and positioning of many fields of the KaiReceipts reports are determined by the data within the receipt or settings as specified in the Settings dialogue.
Using Expressions to Display Data
For settings which modify the text within a field, the setting name is entered into the control's Expression as per below:
[CurrentSettings].[Settings Name]
For example, to insert a field which displays data from KaiReceipts, click the Label control from the toolbar
![]()
and draw a label to the required position on the report.
Next click the Tasks button at the top right-hand corner of the new field to display the label's tasks.
.png)
.png)
In the Expression field click the drop-down list and choose a field from the list. You can choose a field relating to the receipt itself or one of the KaiReceipts settings by expanding the CurrentSettings property.
.png)
Select an option from the list. The selected field is displayed, surrounded by [ ].
You can also combine hard-coded text and data using the following format in the Expression field:
'hard coded text' + [FieldName]
For example:
'Receipt Number: ' + [ReceiptNo]
Using Expressions to Change a Field's Appearance
The appearance and positioning of many fields in the standard report are governed by the settings with the KaiReceipts Settings dialogue. Just as you can use expressions to display data, you can also use those same expressions to modify properties of a report control.
For example, most fields within the standard report are displayed using the default font as specified in the Settings dialogue. To ensure the field inserted above is displayed in the correct font complete the following steps:
1.Select the field in the report then in the Properties panel, click the Appearance button
.
To the far right of each field there is a small image which will be in one of the following states:
The default setting is applied.
The setting has been modified from its default value.
An expression has been applied which will determine the value of the property.
2.Scroll down until you see the Font property.
3.Click the image to the right of Font and select Name Expression. This tells the report designer you are going to assign an expression which controls the font name.
The Expression Editor is displayed..png)
4.Select Fields from the left hand list, then from the resulting list select Current Settings | DefaultFont. Double-click on DefaultFont to insert it into the Expression Editor..png)
5.Click OK to close the Expression Editor.
The font name is now linked to the DefaultFont setting. If you modify the default font setting within KaiReceipts, the appearance of the field within your report will update accordingly.
6.If you also want to specify the default font size, click the
button next to Font, and this time select Size Expression.
7.From the Fields list within the Expression Editor select CurrentSettings | DefaultFontSize.
8.Click OK.
Copyright © 2020 Sirokai Solutions