ONYX - 9.0 - Usage
ONYX Designer Dynamic Part
Sommaire
Dynamic Part (Map Tab)
Definition
The Map part of a project corresponds to the dynamic part of designs that are made according to the datastreams processed by the template. The main elements which can be placed in this part are data files printable information.
To design this part, select the "Map F" tab (and "Map B" for the duplex of the document). In this view, elements of the "Draw" part are displayed as watermarks so that positioning the data to be printed is easier.
" Spooled File"
To retrieve and identify data to be printed, designing a Designer project is done using an example file. This example file is an image of the production spooled file to format.
Designer supports two types of data files in native mode: paginated text files and XML files in Mapping format. Input file types are configured in the project properties.
Designer processes files with .PAG or .TXT extensions. Text files usually have a ".PAG" extension because they need to be paginated. Text files can be paginated by running the "MAPPAGIFS" command in Onyx Server where an argument specifying the number of lines per page ("Overflow") will be given.
XML files need to respect a particular syntax so that the application can properly process them. (see 6.3 XML Mode: syntax and specifications).
To open and display an example file in DESIGNER, the spooled file view needs to be activated in the Display Menu:
In the "Home" tab, click on and select the file you want to load in the application.
The spooled file view then displays the data from the spooled file to format.
To help you design your project, you can preview the result without having to print the document. To do so, click on the Preview button in the Home menu.
XML: syntax and specifications
In XML mode, the design principles are the same and are put in application using an example file loaded in the application.
As stated in 4.2. Creating a project, to load a .xml document, it is important not to forget to go to the project Properties and check that in Parameters > Mode = XML.
The Spooled file view is then called the XML view and displays the content of the file in a tree view.
Data structure
XML files that are processed by Designer in native mode have to respect a specific pattern and syntax, such as:
<page name="..."> … </page> tags mark out the pages of the document. In the last example, there is only one page.
- <field name="...">value1</field> tags correspond to unit-based information (the equivalent of ‘zones’/'fields' in Designer).
- <group name="..."> … </group> tags refer to a particular number of lines which contain zones, such as a ‘group’ in Designer.
- <line name="…"> … <line> tags correspond to the lines inside of these groups.
If we were to use this structure with a paper invoice:
- <page name="..."> … </page> corresponds to the pages of the invoice.
- <group name="..."> … </group> marks out the body of the invoice (from the first line to the last).
- <line name="…"> … <line> describes every line in the body of the invoice.
- <field name="...">value1</field> can correspond to two things:
- If this tag is on the outside of a group, it corresponds to unit-based information in the invoice. In which case, value1 corresponds to the invoice number in the header, for instance, or to the client number, the type of invoice, etc.
- If this tag is inside a group, value1 corresponds to the value of the zone in the line. For instance, the product code, its name, price, etc.
XML pattern specifications
The specifications needed for Designer to process the file are the following:
The XML header needs to specify the file encoding.
Example : <?xml version="1.0" encoding="UTF-16" standalone="yes" ?>
The root tag of XML data needs to be called doc.
All tags mentioned hereafter need to have at least one attribute named name. Information will be identified, retrieved and formatted by the application via the use of this attribute.
The tags and attributes names are case-sensitive and need to be written in lowercase letters.
For the application to access it, data must be placed in pages in between the <page name="…"> and </page> tags. One document can contain several pages.
Inside a page, data is organised per unit-based fields (balise <field name="…">) or per information groups (balise <group name="…">).
Information groups are composed of lines (balise <line name="…">).
The lines contain unit-based informations (balise <field name="…">).
Here is an example of an XML file:
XML data can be placed on the outside of a page as information linked to the overall document and not to the page in particular. However this data will not be accessible to Designer and thus cannot be processed to design the document. Nonetheless, this data can be used in the M-Processing Server engine.
XML view in Designer
An XML example file is loaded in DESIGNER in the same way that is use to load a text file. In the XML view, data is displayed as a list of elements.
Page break on an XML field value
In the Proprieties of a group, the page break generation can now trigger on the change in XML field value.
Par example:
<group name="groupe">
<line name="ligne">
<field name="id">1</field>
<field name="data"> data </field>
</line>
<line name="ligne">
<field name="id">1</field>
<field name="data"> data </field>
</line>
<line name="ligne">
<field name="id">2</field>
<field name="data"> data </field>
</line>
<line name="ligne">
<field name="id">2</field>
<field name="data"> data </field>
</line>
…
</group>
In this example, if the field used to generate a page break is the field "id" then the page break will be generated after the execution of the second line.
There are several options in the interface for the Page break parameter:
- None: the group does not generate any page break.
- Limit: the group triggers a page break on a positioning limit.
- XML Field: the group triggers a page break on a XML field value change.
- Limit and XML Field: the group triggers a page break on a positioning limit and on a XML field value change.
When generating automatic page breaks, managing the recovery of headers is possible with the options "Header" and "Last header":
- Header: to choose the name of the line of the XML file which acts as header.
- Last header: if checked, only the last header is kept. The box is checked by default.
When generating a page break, the last header (or all of the above headings, if the option is unchecked) is used at the start of the new page.
In the XML, if two header lines follow each other, they are considered as one single header.
If a page break is triggered just after a header line, it is not printed and is carried over to the next page.
Edit a variable list of items as a table
To display a list of items in an XML group as a table, the script tool must be used.
The rowtotable feature rearranges the lines of a group so as to obtain a horizontal distribution of the elements.
Syntax:rowtotable(name of the group, maximal number of columns in the table);
The rowtotable feature has two settings:
- Name of the group: contains the name of the group to be reorganized in a table, surrounded by double quotes.
- Maximal number of columns in the table: Maximal number of columns in the table.
Note: All the lines of a group should have the same name.
For example:
<group name="invoice">
<line name="item">
<field name="name">item 1</field>
</line>
<line name="item">
<field name="name">item 2</field>
</line>
<line name="item">
<field name="name">item 3</field>
</line>
<line name="item">
<field name="name">item 4</field>
</line>
<line name="item">
<field name="name">item 5</field>
</line>
<line name="item">
<field name="name">item 6</field>
</line>
<line name="item">
<field name="name">item 7</field>
</line>
<line name="item">
<field name="name">item 8</field>
</line>
</group>
To rearrange this group as a three-column table, use the following script:
rowtotable("invoice",3);
This script will effectively change the group which then becomes:
<group name="invoice">
<line name="item">
<field name="name_1">item 1</field>
<field name="name_2">item 2</field>
<field name="name_3">item 3</field>
</line>
<line name="item">
<field name="name_1">item 4</field>
<field name="name_2">item 5</field>
<field name="name_3">item 6</field>
</line>
<line name="item">
<field name="name_1">item 7</field>
<field name="name_2">item 8</field>
</line>
</group>
Dynamic elements
This part of the documentation presents the basic elements that can be added in the dynamic part of a project in order to get started with the main features of the application.
Zone
Definition
A zone is the main element, which allows you to retrieve information in the input data in order to position and format them in the final graphical document.
In text mode, the information is identified by the following three elements of data:
- a row number,
- a column number,
- a length.
In XML mode, it is identified by the name of the XML field (field tag).
A zone can only read one row at a time.
It is represented in the following two ways in the designing space:
- The zone is empty, no data is associated with it: an icon appears in its upper right corner.
- The zone is associated with an element of data, it appears without an icon.
A zone is identified by its name, defined in the properties window (see a.2 Creating a zone for more details).
Creating a zone
There are two methods you can use to create a zone:
Select the corresponding icon and its type in the Data tab and hold the button of your mouse down where you want the element to be placed. This method creates an empty zone. To link the zone to an element of data from the source file, select the data in the spooled file view (see the second method below) then, drag and drop it in the zone which was created previously, by holding down the Ctrl key.
Select the data to be recovered in the Spooled file view then, drag and drop it where you want, in the designing space to create a zone automatically linked to the data you selected.
Once the zone has been created, select it and display the 'Properties view to fill in the following information:
Name :
Name (of the zone): this information is used as internal information in Designer, it identifies the different objets in the project. When creating an empty zone, this field is also empty and equals to the value of the data as the zone is created from the Spooled file view.
Text printed before/after: to add text before and/or after the retrieved information.
Position :
Position of the information in the data spooled file: column, length, beginning line.
This is also used to extract a certain quantity of information in XML mode.
Position in the document:
to change the position of the zone on the page.
Data Type:
defines how the Designer application processes the information retrieved (see a.3 Types of zones).
Font:
To set all formatting options: font, size, colour, framing, orientation, etc.
Types of zones
The Designer application offers various processing options according to the type of data to process:
- Text: prints plain text.
- Normal: copies the values located in the positions defined by the zone whether they are letters, numbers or blanks.
- Optimized: copies the characters located in these positions except for blanks at the beginning and end of these positions. The framing to the left or to the right is always observed. There is no shift due to blanks in the spool.
- Substitution: used to replace a value of the spool by another one stored in a file called replacevalue.txt. By default, this file is in its blank state in the Designer installation folder. To carry out the substitutions, place it in the lgobitmap folder. The folder needs to contain the values to be replace followed by replacement values and separated by a tab. This sub-type is explained in further detail in 8.3. Replacing characters.
- Translate: substitutes a value for its translation in another language. A zone type Tools / Set Lang is used beforehand to define the file with the translated values. The program searches for the corresponding input in the translation file for each Texte / Translate zone which is defined in the template. The file must be placed in the lgobitmap folder and its name must start with "Translate_".
- Compressed: zone displaying the recovered text into the dedicated space. The text occupies the width of the zone and adjusts the font size between a maximum and a minimum so that the text covers all the dedicated space.. If the minimum font size does not display the entire text, it is truncated and followed by "…".
- Truncated: zone displaying the recovered text into the space allowed by the zone width. If the text cannot be fully displayed, it is truncated followed by "...".
- Barcode: encodes and prints barcodes. The list of available barcodes can be seen in 8.1 Barcodes
- Tools: inserts a page number, images, … but also display the total number of pages, pages in the current batch, …
- Page Number: numbers each edited page. The page number is not necessarily the same as that in the original spooled file. If M-Processing Server is set to exclude certain pages, the number of edited pages will not necessarily be the same as the number of pages in the original spooled file.
- Batch Number: displays the batch number.
- Page Number (Batch): displays the page number in the batch.
- Total Number of Pages: displays the number of pages in the document.
- Total Number of Batches: displays the number of batches in the document.
- Total Number of Pages (Batch): displays the number of pages in the current batch.
- Specific replacement: replaces a value in the spooled file processed by another value which was retrieved in a file. For example, the customer number displayed in the spooled file can be replaced with the customer's name which is retrieved in a database file.
- Image: prints out a different image depending on the value of the spooled file.
- Export: this type of zone allows you to retrieve information from the spooled file and export it to a physical file.
- Repl. File: retrieves text in a file. The name of the zone must correspond to the name of the file. The file must be in the lgobitmap folder and be called data_NAMEOFTHEZONE.txt (where NAMEOFTHEZONE is the real name of the zone). The row and length settings of the zone indicate the row and length of the text to be retrieved.
- Input Text: creates interactive input fields to design SOAP forms in PDF or HTML format. As the user opens the form generated in Adobe Reader or a web browser, he can fill in input fields and send data to an M-Processing Server URL in a Web entry point by clicking on the SUBMIT button, which is actually a Tools / Input Text zone called SUBMIT (system name).
- HyperLink: adds a URL link.
- Set Lang: to specify the file which contains the translations. The latter must be in the lgobitmap folder and its name must start with Translate_. This zone is not printed in the final document, it cannot be seen for preview nor mapping. The name of this zone is not really important, however it must be declared before any other Designer zone that requires translation. Then, the program searches for the corresponding input in the translation file for each Texte / Translate zone defined in the template.
- XPS Message: Inserts an XPS file in the current page. This zone is a link to an XPS file which is on the M-Processing Server. This file must only contain one page and must also be placed in the lgobitmap folder (directly or in a sub-folder). It is not case sensitive. If changes are made to the XPS file, it will impact the projects that use it.
- XPS File: unlike XPS Messages, the files inserted with XPS File zones:
- can contain several pages.
- are whole pages.
- create additional pages in the output file.
- Metadata: indexes the document for archiving (non printed data). The length of the metadata is unlimited.
- Index: index zone by default, used in XPS manipulations and in M-Storage Manager as criterion.
- MapFrom: index reserved to send emails. The value range for this area will be used to set the email sender..
- MapSend: index reserved to send emails. The value range for this area will be used to define the address of the recipient.
- MapCopy: index reserved to send emails. The value range for this area will be used to set the copy recipient.
- MapBCopy: index reserved to send emails. The value range for this area will be used to define the recipient in hidden copy.
- MapNote: index reserved to send emails. The value range for this area will be used to define the body of the email.
- MapSubject: index reserved to send emails. The value range for this area will be used to define the mail subject.
- MapOrg: index reserved to send faxes. The value range for this area will be used to identify the sender.
- MapTo: index reserved to send faxes. The value shown by this area will be used to define the recipient.
- MapUser: index reserved to send faxes. The value range for this area will be used to identify the owner.
- MapFormat: index reserved to send faxes. The value range for this area will be used to define the document format (.BMP, .JPG, .EXE, .PAG, .PDF, .TIF, .TIF_FAX, .TXT, .XLS).
- Memory: insert and store information (not printed) which will later be recovered and used in the template. (see 8.1.b. Combined data)
- Text: save alphanumeric information and delete the spaces after the text.
- Text with spaces: save alphanumeric information and keep the spaces after the text.
- Integer: save integer-type digital information.
- Float: save floating-type digital information.
- SQL: save alphanumeric information found in a database using an SQL query.
- Protect SQL: save alphanumeric information found in a database using a protected SQL query.
- Math. calculation: use memory zones to perform a calculation.
- Memory Replacement: retrieve information saved in the memory zone.
- Memory Translate: save alphanumeric information resulting from the automatic translation of the information retrieved in the spooled file.
- Graph: used to generate a graph using multiple elements of data
- Graph data.
- X-axis data.
- Y-axis data.
- Graph title.
- X-axis title.
- Y-axis title.
- Legend data.
- Minimum value of the Y-axis.
- Maximum value of the Y-axis.
- No. of intervals of the Y-axis.
- Rounding to the nearest n of the Y-axis.
- Origin of the Y-axis.
The construction of a graph is detailed in section 8.6. Drawing a graph.
Designer can automatically convert old graphs types in complex graphics. This feature facilitates the conversion of old projects in XPS projects.
- Conversion: converts numerical data according to conversion rules (Euro to Dollar for example) defined in Onyx Server > Managing Designer Formats > Managing Rates (01=E1 ; 02=E2 ; …)
- XPS PrintTicket:
- Copy: number of copies to print.
- Input Bin: input bin number (printer paper feed).
- Output Bin: output bin number.
- Media Type: Type of paper (A4, A5, etc...).
- Force Front Side: determines the mode Single / Duplex when printing.
- Commands: adds data in the print stream, in printer language. As for the project properties, Document and Page (see 4.2. Creating a project), a "Commands" zone defines the printer language data for the following languages: PCL5, APFDS, PDF, ZPL, DPL, TEC, IGP, IPL and EPL. A zone can contain data for several different languages. When converting the XPS to the output language, the corresponding data to the output language will be used.
Language: select language.
Activate: enable zone for the selected language.
Pre- and Post-Printing: Data written before and after the retrieved data from the spooled file.
Writing hexadecimal data in the "pre-" and "post-printing" can be done using the following syntax: \x followed by the hexadecimal value of two characters.
Groups
Definition
A group can be used to retrieve several rows of a spooled file. It is defined by a beginning row and an end row. It is shown in red in the designing space:
A group can be fixed (fixed beginning and end rows) or variable (variable beginning and end rows).
Creating a fixed group
The creation of a fixed group, is similar to the creation of a zone.
- Create an empty group from the Ribbon menu, select the data of the source file, drag and drop it in the group you created beforehand while holding down the Ctrl key.
- Select data in the Spooled File view, use the drag and drop method to place it in the designing space to create a group automatically which is linked to the zone you selected in the spooled file.
Once the group is created, its informations must be specified in the Properties view:
Name:
- Name (of the group): this information is used as internal information in Designer, it identifies the different objets in the project. When creating an empty zone, this field is also empty and equals to the value of the first selected line of data as the zone is created from the Spooled file view.
- Position in the document:
- Used to change the position of the group on the page.
- Position:
- Identifies the beginning and end rows in the block of information to recover.
- Offset: print position of the first row in relation to the group
- Option:
- Exclusive conditions: For one row of the group, a true condition will be performed exclusively without testing the following rows
- Table: allows zones of a group to behave like the cells of a table. Zones of the same line find themselves automatically linked. Resizing or moving a zone impacts the size and the position of the adjacent zones. In addition, the group's lines (or conditions) are visually represented in the design window. The zones are vertically distributed according to their line. This option is detailed in 8.5.b. Drawing a dynamic table.
- Variable:
- Used to change the type of group: from fixed (the beginning and end rows are static) to variable (the beginning and end rows are variable and defined by conditions).
If the user requests a preview, no information will be printed. Indeed, a group only defines the limits between which the data is to be retrieved from the spooled file.
Given that the limits of the data selection zone are defined using the Beginning line and End Line fields of the group, the data must then be retrieved by creating one or more Zones inside the group.
In short:
- The selection zone of the data block is configured by creating a Group:
The data is retrieved inside this block of data by creating a Zone:
- All the rows of our block of data are retrieved using the preview function (Ctrl+w). Several Zones can be created from the data block, they can then be placed in the group and their formatting can be conditioned (see 6.4.c. Conditions).
Creating a variable group
A variable group uses the same principles as a fixed group i.e. it can be used to retrieve several rows of information in the spooled file. A variable group is used when the beginning or end row of the group is not always at the same place in the spooled file or if you do not want the information to always be printed at the same place on the page.
A variable group uses a start condition and an end condition. The group begins to run when a condition is validated and it stops when another condition is validated or when it has executed a certain number of rows. A variable group can be performed once or more times in the page.
The position of the values printed by a variable group can be variable.
For example, you can define the settings so that the values printed by a group are positioned after the values printed by another group. We refer to this as relative positioning.
You can also define the settings so that the invoice total is always printed one centimeter after the last row of the detail (whether there are 5 or 20 rows). The position of the invoice total will therefore change according to the number of rows of products in the invoice, for instance.
A group may vary in:
- size: the beginning and end rows are dynamically set by the conditions,
- print position: variable groups can be linked one after the other so that the following group is printed straight after the current group has been printed.
These two types of variable can exist separately or jointly.
To create a variable group, simply click the icon and draw the group in the designing space.
The Properties view is displayed so that the group information can be entered:
- Name:
- Name (of the group): this information is used as internal information in Designer, it identifies the different objets in the project. When creating an empty zone, this field is also empty.
- Position in the document:
- Used to change the position of the group on the page.
- Position:
- Offset: print position of the first row in relation to the group.
- Option:
- Exclusive conditions: for a row of the group, a true condition will be performed exclusively without testing the following rows.
- Repeat: if the start condition appears several times, the group will run several times provided that the end condition has been validated in the meantime.
- MapOffice: used to check the design of a MapOffice group (see the Connect documentation on designing Office documents).
- Table: allows zones of a group to behave like the cells of a table. Zones of the same line find themselves automatically linked. Resizing or moving a zone impacts the size and the position of the adjacent zones. In addition, the group's lines (or conditions) are visually represented in the design window. The zones are vertically distributed according to their line.
- Variable:
- Used to change the type of group: from fixed (the beginning and end rows are static) to variable (the beginning and end rows are variable and defined by conditions).
- Spacing: spacing before the printing of the group.
- Type of stop condition: used to condition the end of the execution of the variable group.
- Previous group: Indicates after which fixed group the variable group is run.
Conditions
Execution conditions
Execution conditions are used to run, or not run, the object conditioned in accordance with a value in the spooled file.
A condition can apply to a page, a component, a group, a zone, a line or a rectangle.
If the condition is valid, the object is executed. Otherwise, no further action is taken. In order to complete two different actions depending on the presence of a spooled file value or not, you must create two objects.
Example: If you want to write in black for an Invoice value and in red for a Credit Note value in a spooled file row, you need to create two zones. One with a black font when the value is Facture, and one with a red font when the value is Credit Note because you cannot apply two conditions to the same particular zone: "black font if Invoice and red font if Credit Note" is not possible.
The conditions are managed differently if the object is fixed or if it belongs to a group. Indeed, in a group, the condition is named and linked to the group. Therefore, we can associate multiple objects to a single condition without having to re-enter the latter each time.
Start condition
The start condition defines the first row for the execution of the variable group. The group begins to run on the row where the start condition is true.
Onyx Server tests the validity of the condition from the first row of the spooled file (row 1). As soon as the condition is verified, the group begins to run. It stops when the end condition is also verified.
The start condition is also used to define if the group is to be printed at a fixed position on the page or in a relative positioning in relation to another group. It is also possible to set it so that the group is printed one centimeter after the end of another group.
If the start condition for the group is not verified on any of the rows of the spooled file, the group is not executed.
If the start condition is verified on several rows of the spool, the group runs only once: from the first row where the condition is verified.
End condition
The end row of a variable group can be defined in two ways:
- number of execution rows,
- end condition.
By knowing the number of rows for which the variable group must run, it is possible to set the input number after you have checked the Number of lines box.
The stop condition is not a comparison test in relation to a value present in the spool but the row number after which the group stops.
La condition de fin détermine la dernière ligne d'exécution du groupe variable. Le groupe arrête de s'exécuter sur la ligne où la condition de fin est vraie. De plus, cette ligne peut être exclue (non exécutée) ou incluse (exécutée).
Condition Exclusive
Dans un groupe, il est possible de gérer plusieurs conditions. Par défaut, il y en a une seule qui est la condition Aucune et qui s'applique pour toutes les nouvelles zones créées.
Exemple :
Dans un groupe contenant des lignes de produit, il peut y avoir des lignes de sous-totaux. Il est possible d’utiliser plusieurs zones pour imprimer ces différents types de ligne (pour mettre les sous-totaux en gras par exemple) grâce à une condition.
Ici, il y a donc, à la base, deux conditions : une condition Sous-total à laquelle est rattachée au moins une zone qui imprime en gras et la condition Aucune à laquelle est rattachée la zone qui écrit en standard pour les lignes de produit.
Si le groupe fonctionne en conditions exclusives, une seule condition est appliquée par ligne, même si plusieurs sont vraies (seule la première créée est appliquée). Les lignes de produit sont imprimées en standard par la zone sous la condition Aucune et les lignes de sous-totaux sont imprimées en gras par la zone sous la condition "Sous-total".
Si le groupe fonctionne en conditions non exclusives, toutes les conditions vérifiées sont appliquées par ligne. Dans ce cas, les lignes de sous-totaux sont imprimées deux fois, une fois en gras par la zone sous la condition Sous-total et une fois en standard par la zone sous la condition Aucune. En effet, la condition Aucune est toujours vraie.
Le fonctionnement en conditions non exclusives est très peu utilisé. Il oblige à ajouter dans les filtres d'une condition les conditions inverses des autres conditions. Dans ce type de fonctionnement, la condition Aucune n'est pas utilisée. Il sert uniquement à répéter l'impression d'une information, ou à imprimer sur deux lignes des informations figurant sur une même ligne de spool.
La condition Aucune ne peut pas être supprimée. Si vous ne souhaitez pas l'utiliser, il faut n'y rattacher aucun objet.
Type de comparaison
Lors du paramétrage des conditions, vous pouvez tester :
L'existence dans la ligne : il y a dans une ligne ou dans toute la page.
L'absence dans la ligne : il n'y a pas dans une ligne ou dans toute la page.
La supériorité stricte (numérique) : >.
L'égalité ou la supériorité (numérique) : =>.
L'infériorité stricte (numérique) : <.
L'égalité ou l'infériorité (numérique) : =<.
Le numéro de la page.
Le numéro de la ligne.
Ces tests permettront à Designer de valider ou pas une condition.