Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

In general, a an r_keeper document for printing in r_keeper consists of 2 components:

  • A set of OLAP

...

  • cubes (datasets)

...

  • A document layout.

A set of cubes (datasets) determines which datasets will be used in a document, i.e. cubes determines which sets of variables that can will be used used in the check layout, i.e. check template. The layout itself allows you to determine the appearance . You may edit the layout to change the design of the future document.

The Documents & and Layouts menu contains predefined preset layouts. Preset check layouts cannot be edited, but their copies can be edited.
The layout that is used for printing is called the presentation of the document view. The set of document views used in the work is called the Print Printing Scheme. Print Printing schemes can be created and edited and created.

Layout editor

Let's consider editing a layout using an example of a regular checkreceipt.
To open the layout editor:

  1. In the manager station, go to Settings> Print> Options > Printing > Documents and Layouts.
    In our example, we will edit the check receipt layout, but you may edit any other can be edited in the systemlayout.
  2. Select the section Settlement with a customerGo to the Client payment section. Right-click on the check Receipt layout and select New layout (as copy) Printing Layout.
    Image Added
  3. Name the new layout and change the status to Active. Save your the changes.
  4. In the General Basic section, click on the Layout line, then on three dotsdots image2021-12-24_13-8-34.pngImage Added
    Image Added
  5. The layout editor will open.
    Let's take a closer look at what the check layout consists of:
    1. A sheet Sheet is the a page on which all the receipt elements of the check are located. Different colors of elements are available Elements are shown in different colours only in the editor - they are not visible on the checkeditor, the receipt is printed in black and white.
    2. A bend Band is a section with a specific data set called a dataset. Inside the band, you can operate only with data from the dataset.
    3. A Memo is an active element to which you can add where various data can be added. You can add a simple text or a variable from a dataset. Variables are added areenclosed in square brackets. Memo is invested in bandsA memo is placed inside a band.
      The sizes of bends and memos can be changed by dragging and dropping their borders. Also, you can move the band by holding it down with the left mouse button and dragging it to the desired location.
      We will consider describe the properties of each element in more detail below.

      There are two tabs on the right side of the layout editor:
      • Helper - Assistantdisplays available datasets
      • Properties - Displays — displays the properties of the selected layout element.
        Image Added
  6. Now you can go directly to editing the layout:
Expand
titleLayout Editing

...

Scenario
  1. Let's try to display the table name

...

  1. in a separate line

...

  1. of the

...

  1. receipt. To create a band, right-click on a free area and select Create band
    Image Added
  2. When adding a band to a sheet, you can create an object of 5 types. What each of them

...

  1. serves for is clear from their names. The main band type,

...

  1. where data is displayed directly, is virtual.
    Select Virtual

...

  1. Band and click Ok.
    Image Added
    By holding down the left mouse button on the band's edge

...

  1. , you can

...

  1. move its borders.
  2. Now, add two memos.
    Right-click on the bend and select Create

...

  1. memo. Change its size as you wish. Repeat the same steps for the second

...

  1. memo.
    Image Added Image Added
  2. Now

...

  1. specify what data should be displayed in the memo.
    Switch to the

...

  1. Content editor by double-clicking the left mouse button on the memo window. Then enter the text you want, for example: Table number. Click Ok.
    Image Added
    The written phrase is a constant, it will be printed on every receipt, regardless of the table name.
  2. Add the variable to the second memo. Double-

...

  1. click on the memo window

...

  1. to open the editor. Select

...

  1. the image2021-12-27_10-39-37.pngImage Added button on the top bar. A window will open with a list of available attributes.
    Go to

...

  1. Orders > Table > Main and click once on the Name field, then the

...

  1. Ok button.
    Image Added
    A variable with the table name will appear in the window. Click

...

  1. Ok again to exit the memo editor.
    Image Added
    We have created a variable, and now the name of the table for which the

...

  1. receipt is being made will be printed

...

  1. in these lines.
    Image Added
  2. Click Ok in the lower right corner to close the layout editor.
  3. Editing the layout is complete. Now

...

  1. you need to apply the layout, i.e. to tell the system what layout to print.

...

  1. Find the instruction in the article on editing and using a

...

  1. layout.

Anchor
Properties
Properties
Element

...

Properties

The layout editor is equipped with a built-in script editor, which has a syntax similar to Pascal with some limitations. Scripts can be applied to a memo (the lower part of the memo editor), sheet, bendband, depending on where the script is placed - (it affects the code triggering time the code is triggered depends - the ): the sheet is executed first, then the bendband, and then the memo in of this bendband.

Properties Common

...

for

...

All Elements

  • Visible
    Show To show object or not. The script is executed regardless of whether the object is visible or not.
  • Name
    The name of the object. This name is used to access the object in scripts.
  • Tag
    Has This property has no predefined purpose. Used at the discretion of layout developers in scripts.
  • Script
    Script The script text. It is written in a pascalPascal-like language, the syntax is that of Pascal. No It has no access to arrays and pointers. The script can contain local variables, for which they are declared at the beginning of the script using the var construction. The script has access to all layout objects - pages, bands, memoand memos. The script can change the properties of layout objects. The data source fields are accessed by means of the [DateSet.FieldName] construction. Each script is executed twice: the first time at the stage of the layout preliminary calculation of the layout, the second at the stage of generation. You can find out at what stage we you are now using the Report.Stage variable, which takes the following values: stPrecalc (preliminary calculation), stShowing (generation).

...

The report layout consists of one or more sheets. Sheets are processed and printed sequentially, independently of each other, the order of output is from left to right. Each sheet contains its own set of service bands: Report title, Header and , Footer, and Report summary.

Sheet

...

Properties

...

  • Fixed Height

...


...

  • A fixed paper height. Specifies

...

  • the maximum number of lines on the printed page.

...

  • After reaching this number of lines, a new page will be started. In the case of a slip-on printer,

...

  • a message

...

  • about inserting a new sheet of paper will appear. In the case of a roller printer, the paper will be cut.
  • Variables

...

  • A list of variables common

...

  • for all layout sheets

...

  • . This editor describes the global variables of the layout. Global variables can be accessed from any layout script, in contrast to local variables, which are available only within the script where they are declared.
  • Parameters
    A list of parameters common

...

  • for all layout sheets.

...

  • Datasets initially contain data for all stations, waiters, cashiers, etc.

...

  • Parameters are used in order to build a report only for a specific employee

...

  • . Before printing the report

...

  • at the cash station, the user

...

  • is asked to set values ​​for parameters, and the report is built taking into account these restrictions. Report parameters work like filters for datasets. When developing a layout, a list of its parameters is set. Each parameter is described by the following properties:

Field name - the name of the field by which the filter will be placedset. All datasets will be filtered by this field. If there is no field with this name in the dataset, then the dataset is not filtered.

Collection - a directory reference from which values ​​for the parameter will be selected.

Value is a fixed value for the parameter. The values ​​are selected from the lookup given reference specified by the Collection. The parameters with the specified value are not changed when the report is printed.

  • Union Tables
    A list of associations common

...

  • for all layout sheets

...

  • . It is possible to create a table that is the union of two other tables. The resulting table

...

  • has the same set of fields

...

  • as the first table

...

  • , and consists of rows from both the first and second tables. In one layout, you can define several unions, each of which is described by the following properties:

Name - the name that of the resulting table will receive.

Table 1 is the name of the first table.

Table 2 is the name of the second table.

  • New Page
    If true, then after the printing of all

...

  • the page bends is completed, the paper cut command will be inserted (for roller printers

...

  • only; for slip printers, this command is ignored).
  • Two Passes
    If true, then when building the layout, the scripts are executed

...

  • twice: the first time with Report.Stage = stPrecalc, the second with Report.Stage = stShowing. Two passes are needed for the script to make such report changes

...

  • that will require

...

  • the report regeneration. For example,

...

  • when you change the grouping or sorting of the

...

  • band from

...

  • this band script.

...

Band

...

As mentioned earlier, there is a dataset for each bendabove, each band has its own dataset. After creating a band, using a double click, you can bind the required data set dataset to it, with which you can later work within this band.
Image Added
Bends Bands are placed on sheets or nested in other bendsbands. Bends Bands are divided into bends bands with data sources and bends bands without data sources (service bands). Service bands include the following types:

Report Title

...

Displayed once at the very beginning of the report
Report Summary

...

Displayed once at the very end of the report
Page Header

...

Displayed at the beginning of every printed page
Page Footer

...

Displayed at the end of every printed page

The order of bands processing and printing bands: on each printed page, a Header is displayed at the top of the page, and a Footer at the bottom of the page. Once, on the first page, the Report Title is printed after the Header. The On the final page, before the Footer, prints the Total for the reportthe Report summary is printed. The rest of the bands are displayed in top-down order, i.e. the topmost band will be printed first, then the second by locationone, etc. If there are several sheets in the layout, then each of the sheets them is processed and printed as a separate layout and can contain the Title, Report Total and , Headers, and Footers.

All bands, except for service bands, can contain up to 3 sections: Body, Header, and Footer. None of the sections are requiredobligatory, but at least one of the sections must be present. The order of the band printing a band: first, the content of the header Header is printed, then the body Body is printed, with the body printed as many times as how much there are lines in the data source, after which the Footer content of the footer is printed.

A bend band can modify the content of its data source by sorting, filtering, and rearranging it. This is done by using the Filter, Group, and Sort properties. The order of properties processing properties: first, a filter is applied to the data source - a band filter and a filter obtained from based on the report parameters - then — and after that the resulting data source is grouped and then sorted.

Band

...

Properties

...

  • DataSet Name

...


  • The data source

...

  • linked with the band
  • Filter
    The script text

...

  • , used to apply the filter to the data source. It is written in a pascal-like language. The script is applied to every line of the data source. The essence of the script is to set the Filter variable to true for those rows of the data source that should remain in the final dataset. Example: Filter: = ([Exclude Income] = 1). Only those rows will remain in the data source where the Excl.Income field was 1.
  • Sort Order
    The set of fields by which the sorting of the data source

...

  • linked with the band is performed
  • Grouping
    Grouping specifies the set of fields by which the original data source is grouped. Summation is performed

...

  • for the rest of the fields, i.e. aggregates are counted.

Example: let's say we have a Payment data source:

Currency Group

...

CurrencyOrderGuestsSumNat. Sum
CashRubles1/22300300
CashEuro1/33

...

20700
Credit cardsMaster card1/45

...

100

...

100
CashRubles1/52500500
CashRubles1/22200200

If we group it by the Currency Group field, we getthe result will be as follows:

CashRubles, Euro1/2

...

,1/3

...

,1/5

...

,1/2910201700
Credit cardsMaster card1/45

...

100

...

100

If we group by the Currency Group, Currency fields, we getthe result will be as follows:

CashRubles1/2

...

,1/5

...

,1/2610001000
CashEuro1/33

...

20700
Credit cardsMaster card1/45

...

100

...

100

As you can see from the example, the totals were calculated for the numeric fields, the row fields were connectedjoined. In this example, we have calculated national amounts by currency groups and by currencies. Note that the total for the number Number of guests was calculated incorrectly , because the source data contains several records for one order. For the rest of the fields, the total is meaningless.

You can also calculate the total using aggregate (sum) fields. There are three types of aggregate fields:

  1. SUM(Field)

...

  1. Analogue of SUM(Field) in SQL. Allows

...

  1. calculating the total for the Field field. The total is calculated from the original dataset, which was before the grouping

...

  1. but using all filters. In our example, the [SUM (Nat sum)] aggregate will be calculated as 1700, the [SUM (Sum)] aggregate will be calculated as 1020.

...

  1. COUNT(Field)

...

  1. Analogue of COUNT(DISTINCT Field) in SQL. Allows

...

  1. counting the number of unique values ​​for

...

  1. the6 field. For example, [

...

  1. COUNT(Currency)] will return 3 because there are three currencies in the Payment data source.
  2. SUM(Field1, Field2)

...

  1. has no analogue in SQL. Combines grouping

...

  1. and counting totals. It works in the following way: the source dataset is grouped by the fields Field1, Field2, after which the total is calculated by Field2. For example, you need to calculate the

...

  1. number of guests for all orders, then [SUM (Order, Guests)] will return the correctly calculated total = 12, while a simple summation of the Guests column will give 14.

The same aggregates can be calculated with a given condition:

  1. SUMIF(Field; Condition)

...

  1. Analogue of SUMIF in Excel. Allows

...

  1. calculating the total for the Field field for those lines where the Condition condition is met. A condition is an expression of the

...

  1. FieldName =

...

  1. Value form. Instead of the

...

  1. = (equal) operator, you can use any comparison operator: >, <, <=,> =, <>. In our example, the [

...

  1. SUMIF(

...

  1. Nat.Sum; Currency Group = Cash)] aggregate is calculated as 1600, the [

...

  1. SUMIF(

...

  1. Sum; Currency Group = Cash)] aggregate is calculated as 920.

...

  1. COUNTIF(Field; Condition)

...

  1. the same as

...

  1. COUNT(Field1), but only for those

...

  1. dataset lines for which the Condition, which looks like FieldName = Value, is

...

  1. met. For example, [

...

  1. COUNTIF(Currency; Currency Group = Cash)] will return 2 because

...

  1. the Payment data source uses two cash currencies.

...

  1. SUMIF(Field1, Field2; Condition)

...

  1. the same as SUM(Field1, Field2), but only for those dataset

...

  1. lines for which the Condition having the form FieldName = Value is met. For example, you need to calculate the

...

  1. number of guests for all orders with cash payment, then [

...

  1. SUMIF(Order, Guests; Currency Group = Cash)] will return 7.
  • Category
    Any field of the data source can act as a category. The category is processed as follows: first, unique values ​​are determined for the specified field, then a band is printed for each received value. Each time a band is printed, a filter of the type Category = Value is

...

  • applied to the data source. For example, if you specify Currency Group as the category, then the Payment data source will be printed as follows:

    Currency

    Order

    Guests

    Sum

    Nat. Sum

    Credit cards

    Master card

    1/4

    5

...

  • 100

...

  • 100

    Cash

    Rubles

    1/2

    2

    300

    300

    Euro

    1/3

    3

...

  • 20

    700

    Rubles

    1/5

    2

    500

    500

    Rubles

    1/2

    2

    200

    200


  • Calculated Fields
    Using this property, you can add calculated fields to the band dataset. You need to add calculated fields in order to group or sort by fields that are not present in the dataset

...

  • but can be calculated based on its fields. Each calculated field is described by the following properties:

An expression is Expressionan expression itself. At the moment, attributes can be used as expressions, for example, Employee.Code or MenuElement.Weight.

Field Name - the system name of the added field. Set in English, you need to use needed for using this field in scripts.

Title - a custom name for of the added field.

  • Header

...

  • A band header.

...

  • Is printed first. It is characterized by the following properties:

...

  • Colored

...

  • Printing the

...

  • header and footer contents with color highlighting. Works if the printer supports inversion printing

    Double Height

...

  • Double print height of header and footer content

...

  • Double Width

    Double

...

  • print width of the header and footer content

...

  • Show Empty Lines

    The flag determines whether to print

...

  • empty lines or not

...

  • Size

    Header/footer height in lines. If 0, no section is printed


  • Body

...

  • A band body, displayed after printing the Header. The content of the band body is printed as many times as

...

  • how many records

...

  • the

...

  • dataset contains. Band body properties are the same as header properties.
  • Footer

...

  • A band footer, displayed after the Header and Body of the band. The properties of the footer are the same as those of the header.
  • Behavior

...

  • Show Empty
    A flag indicating whether to display a band if there are no records in the data source

...

  • linked with the band. By default, such bands are not displayed, even if they have a Header or Footer set.
  • Before Start
    A script that is executed before starting band processing.
  • After Finish
    A script that is executed after the end of band processing.
  • Script
    A script that is executed for each line of the data source, just before printing it.
  • XML Section
    Used to export a printed document to XML. When exporting, the lines generated by this band will go to the section with the specified name. By default, the section name is the same as the data source name.

Memo

With In the help of a memo, individual separate fields of the data source or any text are can be displayed. Data source field names (variables) are enclosed in square brackets.
After the dataset is tied to the band, a memo can be placed inside this band. Variables from the dataset are inserted inside these memo, so the required dataset will be printed in the report.
image2021-5-8_10-56-19.pngImage Added

It is important to understand that variables from a dataset can only be used within your its own band.

Memo

...

Properties

  • Alignment
    Specifies whether the text is aligned left,

...

  • right, or

...

  • centered.
  • Content
    Contains the text to be printed. To print fields from a data source, the field names must be enclosed in square brackets: [FieldName]. To print a field from another data source that is not

...

  • linked to the band in which the memo is

...

  • placed, you need to use the [DataSourceName.FieldName] construction. To print escape sequences, you need to use the <EscapeCommand> construct. The list of escape commands will be given below. The number of fields that can be displayed using one memo is not limited.
  • Format
    Specifies the variable format

...

  • (number, date, time, other).
  • Hide zeros
  • Alternative language
  • Word wrap
    Enable auto-wrap.
  • XML Attributes
    XML class
    XML tag

Filter

...

Setting Example

Let's assume that you need to set up filtering of the Dish in the bill by category. It should look something like this:

Code Block
[Classification]

...



                                  [Category1]

...


                                             
                                                             Dish1
                                                             Dish2
                                                             Dish3

       Total for category: [priceamount]

                                   [Категория2]

                                                            Dish4
                                                            Dish5
                                                            Dish6

        Total for category: [priceamount]

Total for classification

Solution:

  1. Add a calculated field with the required classification to the dish

...

  1. band (f.ex., the Category field)
  2. Set

...

  1. Category = Category for the band
  2. Group

...

  1. the band by the Category field
  2. Add another

...

  1. band of dishes to the

...

  1. band
  2. Add the same calculated field to the nested band and set the same grouping
  3. The field for displaying the dish name must be added to the nested band, the field for the category name to the external one.