1. General rules
1.1. Objects
1.1.1. All printable\showable documents are divided into 2 groups: for cash station and for manager station.
1.1.2. Manager station documents are in Options->OLAP reports->Cubes and reports (Reports tab) and Report groups references.
1.1.3. Cash station documents are in Options->Printing->Documents and layouts and Printing schemes and Service schemes references.
* There are several cubes that contain information for cash reports
* One or several of such cubes are connected with group of printing documents, after that you are able to drag variables from cubes on makets.
* Printing maket consists of one or several sheets. On these sheets you place band and add memos and other bands on it. Cube fields are added as variables on memos.
* Memo – visual component on band (see below), that contain simple text or variable (variable = field from cube).
* Band – a kind of container that can store one or several memos and one or several bands.
* DataSet is combination of fields from 1 cube (cube has particular system name, which is also a name of dataset).
Note: if you want to use your own (non-predefined) cube, make sure, that its system name is not empty and purpose=’for cash reports’
* Properties of sheets, bands and memos are changed via Assistant (see below).
* Sizes of bands and memos are changed by dragging their borders (using a mouse).
* For every element on maket you can write a script.
1.2. Scripts
Scripts are written in simple Pascal.
* Syntax is all from Pascal
* Arrays and pointers can not be used.
* Script can contain local variables (should be defined in beginning of script with the help of VAR construction).
* You can access any objects of maket in your script (pages, bands, memos, fields of cube)
* Script can change properties of objects on maket.
* Use [DataSet.FieldName] construction for access to cube fields (see below).
* Every script is executed 2 times: on primary maket calculation and on second phase of maket generation. You can use variable Report.Stage to check phase.
(stPrecalc – 1st phase, stShowing – 2nd phase).
1.3. Assignment
1.3.1. As follows from RK7 logic, you should put layouts to Printing and Service schemes and assign Printing purposes there (Main, backup, XML printing).
1.3.2. Follow manual on how to do that.
1.4. Cash reports
1.4.1. Documents of different type may be document-for-cash-report.
1.4.2. Only those documents that have [Basic]->"Report" property enabled will be considered by the system as Cash reports.
.
1.4.3. Such a documents are there in groups "Preset reports" and "User reports", "Fiscal reports" and "User document".
1.4.4. Only those documents that have [Basic]->"System" property disabled will be seen from cash station GUI corresponding forms (keep in mind 1.3.1.).
2. Layout Designer
2.1. Open editor and Form structure
2.1.1. Layout designer is to be opened from manager station (it is its part).
2.1.2. Go to Options -> Printing -> Documents and layouts reference.
2.1.3. Hence you cannot edit preset objects, create or copy you own layout (manager staton receipt copy is shown below).
2.1.4. Give new object name and save. Open editor by pressing "Layout" property in [Basic] section.
2.1.5. There are following forms inside:
* Maket itself (with particular width and height)
* Assistant section (right panel) – it contains list of datasets or variables, that can be dragged on maket
* Properties section (right panel) – contains properties of chosen element.
2.1.6. You can drag any bands on layout. Memos are always added on bands. Also you can add one bands inside other.
2.2. Bands
2.2.1. General placement rules
2.2.1.1. Bands are added on maket pages or inserted inside other bands.
2.2.1.2. Bands can be divided to:
* Bands with chosen dataset (means, that particular cube or "system dataset" is assigned for some "Virtual" band)
* Bands without datasets (“service” bands - all types, except "virtual").
2.2.1.3. Band types are:
# | Name | Comment |
1 | Report Title | is printed 1 time in the beginning of whole maket |
2 | Report Summary | is printed 1 time in the end of whole maket |
3 | Page Header | is printed in the beginning of page |
4 | Page Footer | is printed in the end of page |
5 | Virtual | in the body (middle) of page |
2.2.1.4. Band executing and printing sequence:
* Page Header (on top of every page)
* Page Footer (on bottom of every page)
* Report Title (1 time, on first page of maket, after Page Header)
* Report Summary (1 time, on last page of maket, before Page Footer)
All other bands (Virtual) are printed like they go on maket (up - down), so upper band is printed first.
2.2.1.5. All bands can contain 3 sections: header, body and footer (usage of all sections is not obligatory, but at least 1 section should be presented on maket.
Band printing goes like this:
* header
* body (printed N times, if there are N strings in band body)
* footer
You can edit some properties for band parts:
* Appearance --- Double height / width (for header / body / footer)
For now there is no option to choose particular font. So the only way to make text larger is to use ‘double height’ and ‘double width’ property (put corresponding ticks).
* Appearance --- Colored
For check printers, that support printing in invented colors.
If tick is put, then band is printed in invented colors.
* Appearance --- Visible
Remove a tick to make band invisible. If script is assigned to this band, script is performed anyway.
* Appearance --- Hide empty lines
To print empty strings of band or not.
2.2.2. Assigning dataset for a band
Virtual band is empty band, when no datasets (=cubes) are assigned for it. You can assign dataset for a virtual band by making double click on it or editing property DataSet Name.
2.2.3. Additional band properties
* Behavior --- Show empty
By default if dataset (which is assigned for band) doesn’t contain any records, band is not printed (even if band has header and footer). Put this tick, if you want to print such band parts obligatory.
* Misc --- Script
This script is performed before printing for every record in dataset.
* Misc --- Before Start
This script is performed before band execution.
* Misc --- After finish
This script is performed after band execution.
2.2.4. Grouping, sorting, filtering for bands
2.2.4.1. General
2.2.4.1.1. Band content can be changed by grouping, sorting and filtering.
2.2.4.1.2. Sequence of operations with content is like this:
1) band content is filtered (by filter of this band plus filter of whole layout);
2) received data is grouped;
3) grouped data is sorted.
2.2.4.2. Filtering
2.2.4.2.1. Data -> Filter gives you an ability to apply filter for the whole band.
2.2.4.2.2. Filter can be simple (1 condition) or complicated (script inside BEGIN-END).
2.2.4.2.3. Simple script is like: CubeName.CubeField=Value , see an example below.
Filter := (Discounts.IsCharge = 0) |
2.2.4.3. Grouping
2.2.4.3.1. Data -> Grouping gives you an ability to select how to group information on a band.
2.2.4.3.2. In the left part: all the fields, that can be grouped.
2.2.4.3.3. In the right part: all the fields, for which information is grouped (for example, you could see grouping all the fields of the band (Account, Amount, AuthCode, etc) by Currency below).
2.2.4.3.4. If you need dishes in some report be grouped by "Price", you have to add "Name" also (example of grouping dependence).
2.2.4.4. Sorting
2.2.4.4.1. Data -> Sort order gives you an ability to sort data on a band by corresponding fields (they are chosen from the left part of the window).
2.2.4.4.2. In the example above we sorted all the fields of the band by Discount/Markup and CardNumber.
2.3. Memos
2.3.1. General placement rules
2.3.1.1. Memo can contain just simple text or one/several variables (in this case variable =cube field, or other dataset field).
* Name of variable is written in square brackets: [Sum]
It is used, when memo is added on band and you take fields from the same dataset (=cube), which is assigned for this band.
* One more variant is available: [DataSetName.FieldName], for example:
[Discounts.Amount]
It is used, when band (on which memo is placed) is assigned with particular dataset (=cube) and you need to drag information from any other dataset.
In this case you can use tick ‘All datasets’.
Note:
For some operations with variables (SUM, COUNTIF – see below Operations with variables) you should use only variables from one dataset (=cube).
Escape-commands are added on memos inside symbols < and >.
For example: <EndRoll>
2.3.2. Scripts for memos
Besides adding variables you can write more complicated scripts for memos.
For example:
var
temp_variable: double;
begin
temp_variable := [Cube1.Amount] - [Cube2.Amount];
memo34.Text := ‘Any text: ’+ FloatToStr(temp_variable);
end;
where
* temp_variable – just temporary variable (local, not global) inside script for memo. It is accessed only inside this script (can not be called from any other script).
* memo34 – name of memo
* Cube1, Cube 2 – cubes for cash reports (added for printing maket) with system names ‘Cube1’ and ‘Cube2’
* Amount – name of field in corresponding cube.
2.3.3. Operations with variables
You can use some pre-defined operations
SUM – sum
COUNT – count quantity
SUMIF – sum with condition (written as SUMIF(what_to_sum; condition))
COUNTIF – count quantity with condition
Example: [SUM(BasicSum)]
If needed to sum for several fields: [SUM(Visit, GuestCount)]
If needed to sum with conditions: [SUMIF(Visit, GuestCount; CheckState=6)]
Note: usually such operations are put on footer of band (see below, Common information).
2.3.4. Memo properties --- Misc --- Name
Name of memo.
Can be changed and used in script, for example:
Memo7.Text := ‘Total to pay: ’ + FloatToStr([Amount]);
2.3.5. Memo properties --- Appearance --- Format
Ability to set format for this memo:
Note: if you want to set your own format, you can use # symbol to show, that it should be placed with any digit. For example: ###.####. Decimal symbol is like in Windows regional settings.
3. In-document properties
3.1. Appearance
Visible
Tick should be always put (stands for “global” property of the whole document).
3.2. Layout
Fixed Height
Fixed height of paper – how many strings should fit printing paper.
If this N of strings is reached, new page will be started
* for slip printers: message to put new list will be shown.
* for roll printers: paper will be cut.
Height
Height of document (for example, ‘70’ means 70 lines)
3.3. Data
Variables
Ability to add own variables that will be considered as global variables (for the whole maket).Global variables can be called from any script of any object of maket.
3.4. Misc
Name
Name of whole document.
Script
Script that is performed for the whole document (in simple Pascal).
Tag
Doesn’t have pre-defined value. Is used by programmers in scripts.
4. Graphic layouts
4.1. These layouts are created in the built-in FastReport (v.4.9) editor.
4.2. You have to create "new graphic layout" inside necessary documet type (dataset) first.
4.3. Edit created layout in fast report built-in editor as follows (p.5), having assigned available data with "Report->Data" menu.
4.4. Assign this layout to printing scheme(s) and printing purpose(s) as usually.
4.5. There is only one graphic printer in RK7: "Windows printer", and others are not suitable for graphic layouts!
5. Fast report
5.1. This built-in editor is used for creating\editing document layouts (both for cash and manager station).
5.2. Open editor by entering graphic layout or report "Basic" section "Layout" property.
5.3. In case of manager station report there are "Create template" and "Params" intermediate steps, where you have to choose "SQL query" as report source.
5.4. In FastReport you are able to design your layout.
5.5. You are able to use scripts in FastReport layouts as follows from manual.
5.6. Learn FastReport facilities on external information sources.