Izrazi
Displaying Expressions with the Help of the "Text" Object
In the "Text" object you can display static plain text but expressions as well. Expressions have a similar role as in Excel.
Properties of expressions:
- The value of the expressions is determined only when the report is executed. Expressions are written in square brackets - between [expression].
- In expressions you can use data from tables and queries, variables and functions.
- Expressions can be located within the object mixed in with normal text. We can write in small or capital letters.
- Field names in datasets are written in the form: <dataset_name. "field_name">. Symbols < and > are optional if there is nothing else in the expression.
Examples of text in the "Text" object and output on the report are listed in the table below:
Text Type |
Text in the Object |
Example of Output on the Report |
Plain text |
1+2*(3+4) |
1+2*(3+4) |
Expression with calculation operations |
[1+2*(3+4)] |
15 |
Expression with function |
[Sin(Pi/6)] |
0,5 |
Plain text |
Hello! Today is DATE. |
Hello! Today is DATE. |
Plain text and expression with system variable |
Hello! Today is [DATE]. |
Hello! Today is 6.7.2017. |
Expression with Field Name |
[qReportIzpis."acName"] |
ItemName |
Expression with Field Name |
[<qReportIzpis."acName">] |
ItemName |
Plain text and expression with FieldName |
Total amount [<qReportIzpis."acCurrency">]: |
Total amount EUR: |
Text and expression with FieldName and Calculation operation |
[100 * <qReportIzpis."anValue">]% |
18% |
Expression with Field Name and Function |
[SUM(<qReportIzpis."NabavaNeto">
- <qReportIzpis."anSalePrice">)] |
15,25 |
More complex example can be found on the report '22C - Detailed Receiving Slip - Valuation Price and Sale Prices' that is in the program menu 'Goods | Transfer | Document (e.g. 200 - Transfer Wholesale - Retail)':
[100 * (((<tbIzpisPrometPozIzdPL."anPrice"> * ((1 -
<tbIzpisPrometPozIzdPL."anRebate">/100))) -
<tbIzpisPrometPozIzdPL."anStockPrice">) /
<tbIzpisPrometPozIzdPL."anStockPrice">]