\\ **>> Go to: [[en:podrecznik:modus:rozpoczecie_pracy|START THE WORK WITH MODUS SYSTEM]]**\\ **>> Go to: [[en:podrecznik:start|GUIDEBOOK FOR THE USER]]**\\ ====== Printout templates ====== Modus system has a tool for the printout edition, therefore the outlook of documents is not imposed. In an easy way you can create templates of documents, reports, and labels. You can decide what data should be included in every document or report and customize it for your needs. By using the template editor you can create new templates of documents. Templates are divided into systemic, (those that cannot be edited or deleted) and user's templates (that are fully editable). ===== Creation of a new printout template ===== The printout template is created on the basis of the existing one. By clicking on the icon „print a document” a preview window of this document will open. By unrolling the template button Należy rozwijając przycisk szablon (the arrow on the right side of the Template icon) choose „Save the template as” and fill in the name of this template (the code) and confirm. ++++ Screen 1 | {{:podrecznik:globalne:szablony_wydrukow:nowy_szablon.png|}} ++++ Now, the new template can be edited. Again, unroll the template button and choose from the list „Edit the template”. The window of the printout template editor will open. By closing the FastReport you will see the preview of changes, which were inserted. In order to save it you have to unroll the Template button and choose „Save the template”. The program will ask you whether to save the template each time you close the printout or change the template for another. The window of the printout editor ++++ Screen 2 | {{:podrecznik:globalne:szablony_wydrukow:okno_edytora_wydruku.png|}} ++++ - Workspace; - The main menu bar; - Toolbars; - Objects toolbar; - Cards; - Objects tree; - Object characteristics window; - Data tree - you can drag the element and drop them to the workspace; - Ruler; - Status bar. **Page options** The change of the template settings are available via the „File | Page settings...” in the menu, or by the double click on the empty space. ++++ Screen 3 | {{:podrecznik:globalne:szablony_wydrukow:opcje_strony.png|}} ++++ In the settings window, you can choose the size, arrange margins and the paper source. ==== Objects ==== All the information, that is in the printout template are known as objects in the program. === Objects are divided into: === **Object of the data type – a variable from the data tree** {{:podrecznik:globalne:szablony_wydrukow:obiekt_dane.png|}} The object can be dragged from the data tree. **Object of the text type – inserted text** {{:podrecznik:globalne:szablony_wydrukow:obiekt_tekst.png|}} After choosing the object button from the toolbar and indicating the place on the template, you can insert text. **Object of the picture type – picture** ++++ Screen 4 | {{:podrecznik:globalne:szablony_wydrukow:obiekt_obraz.png|}} ++++ Picture of the small size (about 20 KB) can be placed in a specific place by selecting the object from the toolbar and indicating the place. Additionally you have to load the file and confirm it by clicking OK. The picture can be enlarged, made smaller, or stretched by using black points in the corners of the picture. In order to add a bigger picture, you have to proceed in the same way, apart from loading the file. Only confirm the empty object. In the inspector object -> Details in the FileLink field insert the path of the file localization on this computer. In other computer workstations, the image added in this way will not be visible, unless the image will be inserted in the same localization. **Object of the bar code type – bar code** ==== Object tools==== Insertion of the ribbon - allows for the creation of the website's project on the area that has to be defined according to its type. - "Text" the object displays one or few rows of the text in a rectangular shape; - "Photo" the object displays the graphic file in the "bmp", "JPEG", "ICO" WMF " or "EMF" format; - "Line" the object displays horizontal or vertical line; rectangular, curved rectangular, ellipsis, triangle, and diamond); - "Bar code" object displays data as the bar code. ==== Data tree ==== ''Resource code'' ++++ Screen 5 | {{:podrecznik:globalne:szablony_wydrukow:drzewo_dane.png|}} ++++ From the data tree from the tab „Data” you can drag and drop a specific object into the template. By clicking on the object, a down arrow will be visible like during the opening of the list). By using the arrow you can quickly change the object into the other one. ++++ Screen 6 | {{:podrecznik:globalne:szablony_wydrukow:zmiana_zmiennej.png|}} ++++ By double clicking, the edition window will open, where you can add text, if it has to be displayed before a variable. E.g. text name ++++ Screen 7 | {{:podrecznik:globalne:szablony_wydrukow:dane_tekst.png|}} ++++ Bands (ribbons) \\ particular objects from the data tree are placed on the bands. In order to add a band: - On the toolbar of the object choose Insert band - Choose the appropriate type of band - on the template a new band will appear. ++++ Screen 8 | {{:podrecznik:globalne:szablony_wydrukow:wstegi.png|}} ++++ ==== Bands ==== Objects from the particular branches of tree have to placed on the bands that relate to the same brand (e.g. objects from the document specification branch should be placed on the band document_specification) ++++ Screen: Adding of a new band | {{:podrecznik:globalne:szablony_wydrukow:dodanie_wstęgi.png|}} ++++ ++++ Screen: Defining of the branch correlated with the band | {{:podrecznik:globalne:szablony_wydrukow:wybór_gałęzi.png|}} ++++ ++++ Screen: Placing an object on the appropriate band | {{:podrecznik:globalne:szablony_wydrukow:dodanie_obiektu_na_właściwą_wstęgę.png|}} ++++ ===== Przykłady:===== ==== Logo on the printout ==== To add or change logo on the printouts, you have to: In the global configuration in the tab System/Printing was inserted there is a possibility to insert a company logo to the base that will be available on all the printouts of documents that can be edited. A preview of the inserted logo is also available, but only for the pictures in the bmp. format (in this version). In order to place the logo on the printout, in the printouts editor, put the object of the ‘Picture’ type on the template. When a dialog box ‘Picture’ will appear - close it without loading the picture. Next, set properties of a new object according to the following tips: - DataSet: _firm - DataField: LOGO The size of the picture will be adjusted to the size of an object on the template with a sense of proportion. In order to show the picture on a scale of 1:1 you have to set the AutoSize properties into the value ‘true’. ==== Change of decimal places==== In the Modus system **values** on the documents are rounded to two decimal places. On the printout template you can change the number of printed decimal places. For this purpose: - Go to the edition of the template, - Indicate the element (value), that should be displayed with the other number of decimal places and press **Enter**. - Go to the tab **Format**. - In the field **Format string** change settings from **%2.2n** on **%2.Xn**, where **X** means the number of decimal places that should be printed out (e.g. **%2.4n**) - Press **OK**. ++++ Screen 1 | {{:podrecznik:sprzedaz:liczna_miejsc_po_przecinku_1.png|}} ++++ ++++ Screen 2 | {{:podrecznik:sprzedaz:liczna_miejsc_po_przecinku_2.png|}} ++++ ++++ Screen 3 | {{:podrecznik:sprzedaz:liczna_miejsc_po_przecinku_3.png|}} ++++ Formatting can be defined also by using the tab **Text** it may happen that, despite the fact that in the field **Format string** there is **%2.2n**, then the round number is different than two decimal places. In this case - Go to the edition of the printout of a template, - Select the element, that should be displayed with a different number of decimal places and press on **Enter**, - Remain in the tab **Text**, - In the field, change the settings from **''[document_specification."quantity" #n%2,4n]''** into **''[document_specification."quantity" #n%2,Xn]''**,\\ where **X** means the number of decimal places that should be printed out (np **[document_specification."quantity" #n%2,0n]**) - Press **OK**. ==== Edition of the assortment's label ==== On the assortment's label, a bar code of the assortment is encoded by default, but it can be changed: - for the standard template of label choose 'Save the template as...' and give a new name, - on the label select the bar code, - on the left side of the screen, in the tab 'Properties' field content 'DataField', change from 'bar_code' into 'code'. - close the editor of printouts FastReport, - select 'Save a template', - it is important to set a new template as a default one (List of templates/Edit function after selecting the new template) ==== Mathematical operations ==== In the Modus system it is possible to conduct mathematical operations of the report's elements. In order to do e.g. multiplication: - add a Text element to the report, - In the tab Text enter the names of elements that should undergo the operation, paying attention on the brackets oand the symbol of the mathematical operation e.g. in order to multiply a unit weight by the quantity, enter\\ **[<**document_specification."product_unit_weight_netto"**>*<**batches_specification."quantity"**>]** ++++ Screen | {{:podrecznik:globalne:szablony_wydrukow:operacje_matematyczne.png|}} ++++ ==== Adding up of the values ==== On the template of the printout, you can add up the value of specific columns. In order to the add the sum of the particular column: - there isn't a band on the template. if there isn't a footer band, add it. - if you want to sum up values of the column, that is not on the template by default, add a new object on the appropriate band, e.g. [dokument_specyfikacja."product_package_quantity"] - w polu stopki pod wybrana kolumną umieścić [SUM(,specification)] - in a field of the footer, enter a possible description of the sum. ==== Sorting ==== Modus system allows you for specifying a column according to which data that are on the printout should be sorted. Specifying a direction of sorting is also possible. To change sorting: - print out a chosen document, - click on the arrow that is next to the icon **Templates**, - choose **Edit a template's definition** - click on **Clean up** to delete current sorting of settings, - unroll the column list accessible for sorting, - choose a direction of sorting by clicking on one of the arrows that are next to the chosen element, - click on **Confirm**. ++++ Screen: Printout before the change of sorting | {{:podrecznik:globalne:szablony_wydrukow:sortowanie1.png|}} ++++ ++++ Screen: Change of sorting | {{:podrecznik:globalne:szablony_wydrukow:sortowanie2.png|}} ++++ ++++ Screen: Printout after the change of sorting | {{:podrecznik:globalne:szablony_wydrukow:sortowanie3.png|}} ++++ ==== Using the function IIF ==== Modus system Modus allows you for using different types of functions. One of them is the function IIF. An example of use: On the order document to the supplier, a date of the order realization was defined. Additionally, for some ordered assortments different dates of realization were defined. With regard to the possibility of defining two dates of realization, on the template there are also two dates of realization: * ''[dokument_specyfikacja."planowany_termin_dostawy"]'' - a date of realization of a specific item from the order, * ''[dokument."planowany_termin_dostawy"]'' - general date of the order realization, ++++ Screen: Printout with two columns | {{:podrecznik:globalne:szablony_wydrukow:terminy_realizacji_zamówienia.png|Wydruk z dwoma kolumnami }} ++++ By using the IIF function, you do not have to place both of the columns on the printout's template. You can place the column by using the function: kolumny z następującą funkcją: * ''[IIF(==0, ,\\ )]'' If the individual date of delivery completion was specified for the document's item, it will be displayed, otherwise a date of the order completion will be displayed. ++++ Screen: Printout with using the function IIF | {{:podrecznik:globalne:szablony_wydrukow:terminy_realizacji_zamówienia_iif.png|Wydruk z zastosowanie funkcji IIF }} ++++ ==== Sorting on the template with z aggregation (external delivery)==== In case of printouts that include the aggregated items, sorting should be defined for two branches. Sorting on the second branch is conducted as part of the data tree batches_specification. For the right functioning of the template, aggregation should take place within the elements of the tree batches_specification. (each GroupHeader should be set to batches_specification). In order to configure a printout of the template: - print a chosen document, - click on the arrow that is next to the icon Templates, - choose Edit a template, - check if the ribbons responsible for the aggregation are set to batches_specification and which fields they cover, e.g. assortment_code (GroupHeader: batches_specification."assortment_code") [Screen: 1] - close the FastReport, - click on the arrow that is next to the icon Templates, - choose Edit a definition of template, - fill in the fields related to sorting data from branches: batches_specification\\ You should insert the fields after which the sorting should take place. The fields should be the same as the ones defined for the aggregation (point 4) and they should be entered in the same order [Screen: 2]. To fill in the fields: * unroll the list of columns available for sorting [Screen:3], * choose a direction of sorting by clicking on one of the arrows that is next to the specific element. ++++ Screen 1: Configuration of the GroupHeader header | {{:podrecznik:globalne:szablony_wydrukow:definicja_naglowka_groupheader1.png|Ekran 1: GroupHeader }} ++++ ++++ Screen 2: Configuration of sorting the template with aggregation | {{:podrecznik:globalne:szablony_wydrukow:specyfikacja_zagregowana.png|Ekran 2: Konfiguracja sortowania na szablonie z agregacją }} ++++ ++++ Screen 3: Choice of columns for sorting | {{:podrecznik:globalne:szablony_wydrukow:kolumny_do_sortowania.png|Ekran 3: Wybór kolumn do sortowania }} ++++ ==== Change of the gross weight into net weight (for the CMR document)==== Items on the CMR document are grouped, hence in order to change the gross weight into net weight it is not enough to exchange the element on the printout of template. To edit the template of the CMR document and change the gross weight into the net weight - go to the edition of the CMR document's template, - edit the template according to the example [Screen 1], - go to the tab Code, - edit the code of template according to the example [Screen 2], - close the editor of printouts FastReport, - press 'Save the template'. ++++ Screen 1: Edition of the CMR document's template| {{:podrecznik:globalne:szablony_wydrukow:edycja_szablonu_cmr.png|Ekran 1: Edycja szablonu wydruku dokumentu CMR}} ++++ ++++ Screen 2: Edition of the template's code | {{:podrecznik:globalne:edycja_kodu_cmr.png|Ekran 2: Edycja kodu szablonu }} ++++ ===== Choice of the default template ===== To select one of the templates as default: - print out a chosen document, - click on the arrow that is next to the icon List of templates, - choose a template that you want to select as default, - click on Edit, - choose the option Use this template as default, - click on confirm. **>> Return to: [[en:podrecznik:start|USER GUIDE]]**