Loading...
 

Printing in ClassiX

Printing in ClassiX

This documentation is intended to familiarise the ClassiX user with the interaction between Word and ClassiX printing. Thus, it is first explained which Word documents are involved in printing and how, before the structure of a print form is described. In this context, Word's access to information from the database is explained using selected examples.
Knowing which changes in the Word documents cause which changes in the printout of a form should be the general goal of this documentation.

1. working with Word
1.1 OleBox
1.2 Style sheet
2. classification of the Word documents
2.1 Master data documents
2.2 Cover letter and footer documents
2.3 Text blocks
2.4 Document modules
3. forms overview
3.1 Forms
3.1.1 Tree representation
3.1.2 Exporting and importing forms
3.2 Document blocks
3.2.1 Conditional document modules
3.2.2 Exporting and Importing Document Modules
4. dynamic data fields
5. common problems and questions
6. tips and tricks

1. working with Word

1.1 OleBox

The OleBox creates the interface between ClassiX and the Word and Excel documents. By double-clicking on a displayed OLE object #01, the corresponding application is started and the OLE object can be edited in it.
Similar to an MLString widget #02, the MLOleBox is also multilingual. The language can be changed with the PgUp/PgDown keys. For orientation, the current language is shown in the upper right corner of the widget by the country code (changeable in locales.txt).

Tip:
An OleBox accepts the dropping of OLE objects. This means that you can also drag and drop an MS Word file that you are editing outside the ClassiX database into an OleBox.

After editing a Word document, there are several ways to save the Word document and return to ClassiX. The "more correct" ways are via the menu (File -> Close) or via the close cross.

The Word documents behind an OleBox can also contain document variables, which are described in a later section. If the information behind these fields is updated, you can also update the view of the OleBox. This is done with the Refresh button.

1.2 Style sheet

In order to realise a uniform appearance of the Word documents, ClassiX takes advantage of the format template.

A style sheet is a set of formatting attributes that can be applied to the text in the document to quickly change its appearance. When you assign a style, you apply a group of formatting features in one step.

When you start Microsoft Word, the new blank document is based on the Normal template, and the text you enter uses the Standard style sheet. When you start typing, Word uses the font, font size, line spacing, text alignment, and other formats that are currently defined for the Standard style template.

Since the style sheet, which has a different characteristic on each computer, is stored locally, the Word documents created at different workstations also differ. In addition to the effect of creating a variety of different formats, the following problem arises.

Word texts are also inserted into other documents during printing. This is done using the copy function of Word. However, since only the contents and significant format changes are copied, the appearance of the Word text may change in print.

Example:

When copying a Word text, only the content and the additional formats are transferred. Thus, the font size and the addition "Bold" is also transferred to the document2, but the font of the copied section is now "Times New Roman".

To avoid this problem, when a new Word document is created from within ClassiX, a separate style sheet is assigned that is the same for all. This template ("classix.dot") is located in the /ClassiX/system directory. If, for example, all new Word documents are to be created in font size 12, this must simply be defined in classix.dot.

2. classification of the Word documents

2.1 Master data documents

Master data documents are used in ClassiX to describe the object they are held by. This type of Word document is used, for example, to describe sales items or conditions in more detail. Master data documents are reproduced 1 to 1 in the printout, as they usually contain only plain text.

2.2 Cover letter and footer documents

These Word documents are used, for example, in quotations and purchase orders and, in addition to pure text, also contain fields #03, which are filled with information by ClassiX. Thus, it is not necessary for the processor of an offer to constantly put his name under each offer. Instead, he can define a field which reads out this information for him from the database and prints it out in the form.

2.3 Text blocks

Text modules are mainly used when creating an activity document, such as a letter. However, they are different from the documents used for printing complicated forms. Whereas a form is made up of several modules, an activity document is basically made up of only one Word document.
Text modules are the template for an activity document. When you create a document, only one copy of the text module is created at a time, which is then used for further processing. Text modules therefore contain almost exclusively fields, since the text is then inserted into the copy by the user.

2.4 Document modules

Document modules are used to build a complex form. However, they only consist of fields or text that is the same for all printouts. Unlike the copies of the text modules, the user then has no more influence on the Word documents.
While in the text modules only text information is inserted into the document, whole Word documents are also read in the document modules. These are mainly master data documents.

3. forms overview

3.1 Form

A form is described by the document modules as well as by the margin settings and the document type, etc. The form can be differentiated by type. Forms can differ in type and be assigned to areas:


The document modules from which the form is constructed are specified in the forms. The sequence of the modules usually determines the structure of the form. However, there are exceptions. For example, there is a fixed predefined sequence in the offer, which cannot be changed by the arrangement of the modules. Likewise, the headers and footers as well as the carryovers are understandably repeated on each page, regardless of their position in the list of modules.

3.1.1 Tree representation

To analyze the structure of a form, the tree display is the main tool. It has the great advantage that the submodules of the document modules are also displayed, whereas only the first level is displayed in the module group.
The symbols used in the tree indicate the type of document modules. The ID, the name and the type in brackets are also displayed.
Baumdarstellung Des Formulars

3.1.2 Exporting and importing forms

The export and import of forms has the following useful advantages. For example, you can save/archive forms outside the database or change them in a test system and transfer them to the running system via export/import.
The descriptive files (*.fcp and *.for) for the forms are usually located in the directory drive letter:\Classix\Project name\AppsWH\Data\Forms\Project name\.
The document modules used are usually located in the directory drive letter:\Classix\Project name\AppsWH\Data\Forms\Project name\Docs

Forms can be easily exported via the selection window. To do this, select the forms to be exported and choose "Edit -> Data exchange -> Export". Then click on one of the buttons with the folder symbol under directories and select the folder in which the form(s) are to be saved via the FileDialog window.

Then you choose whether the Word files should be exported to a subfolder called Docs or to the same directory. (Below the two buttons with the folder symbol is a button with an arrow pointing to the left. If you press this button, no Word files are exported to Docs, but are saved in the previously selected directory.

Under Export you can select which languages should be exported. You can also see again which documents are exported and if necessary you can deselect a wrong document or select the right ones.

After a click on "Data exchange" you will find a 'YXZ.for' and 'YXZ.fcp' in the folder as well as numerous Word documents if you wanted to have no Docs folder, otherwise the Word files are in the Docs folder of the same directory.

Formular Datenaustausch

In the 'YXZ.for' you will find the details of the document. That is, the name of the form and the modules from which it is constructed.





In the 'YXZ.fcp', the specifications for the document modules are then specified accordingly.




The remaining files are the Word documents that belong to the building blocks. If a file name consists of two numerical values, it is a simple module. In this case, the first value describes the ID and the second value the language. Otherwise, it is a conditional block. While the first value still describes the ID, the second value stands for the condition and only the third value for the language.

The difference between simple and conditional document modules is explained in the following section.

Importing is similar to exporting:
In the list window of the forms, the data exchange window for the import is opened via "Edit -> Data exchange -> Import".
In the group Directories, a file dialog can be opened by clicking on one of the buttons with folder symbol, with which you can select the *.for or *.fcp to be imported. If there is no Docs folder, but the Word files are located together with *.for and *.fcp, you can remove "Docs" from the path for the Word files by clicking the button (with arrow to the left) below the buttons with folder symbol.
In the "Import" group you can select what should happen to existing forms and modules.
The import can be started with the button "Data exchange".

Formular Datenaustausch Import

3.2 Document blocks

The document modules are the enveloping objects for the Word documents that are used when a form is printed. In addition to the Word documents, they hold information such as ID, name, type, and the type of module. In addition, you can insert submodules that are to be included in the print module in the order in which they are listed in the submodule list.

The type has a decisive influence on the pressure of the module. For example, modules can only be placed at the appropriate position in the form with header, footer, list carryforward at the top and list carryforward at the bottom.

It is important that the document header represents the header starting on the second page, but more about this in the section on conditional blocks.

To control the output of a document module, the checkboxes 'New page before module' and 'New page after module' are also used.

Bausteintypen

Auswahl Bedingte Bausteine Document modules are specified by their type. In addition to the type 'No content', which is only used as a container for further submodules, there is also the 'Simple' and the 'Conditional document'.
While 'Simple Documents' contain only one Word document with the different languages, it is worth taking a closer look at the 'Conditional Building Blocks'.

3.2.1 Conditional document modules

A 'Conditional Document Module' is obtained by selecting the type of module from the drop-down menu accordingly. Here you can use the option that the content of the Simple Document should be included in the condition. In any case we get the following picture. Bedingter Baustein Mit Einem Dokument
Selecting a position in the resulting table will open a new window that will take you to the Word object. You can also specify the name and the condition of this position. To create or delete new positions, right-click in the conditions window. When creating, you even have the possibility to select a predefined condition. All regular expressions that return TRUE or FALSE are allowed as conditions and you can use all used variables and objects. Bedigter Baustein Kontextmenü

The following example may serve to deepen your understanding. Document headers in ClassiX are usually made up of
Conditional building blocks built. There is a Word document, which is used for the first page and one for the following pages depending on the client logged on.

Beispiel Bedingtes Dokument

The access expression print.counter is generally used to access the current page number.
Accordingly, the condition print.counter=1 returns TRUE if the first page is currently being printed. How the next conditions are structured is explained in one of the next sections. But you can see that you can also logically link two conditions. So the next condition returns a TRUE only if both the part

var(cyberEnterprise).uniqueID=“002“

as well as the part

print.counter>1

is fulfilled.

It is important to note that only one Word document can be returned at a time.
If two conditions are met, only the Word document of the upper position is returned. Therefore, it can be advantageous to be able to move the positions using the arrows to the right of the table.

3.2.2 Exporting and Importing Document Modules

The export of document modules is similar to the export of documents. To export, select the modules in the corresponding selection window and click on "Edit -> Data exchange -> Export". The file dialog opens and you can choose the location and the name of the file. By default, component.fcp is suggested here.

4. dynamic data fields

The connection of the module to the ClassiX system is created by inserting document variables. This is done via the menu Insert/Quick modules/Field (Word 2013). A window opens in which the desired field can be selected. The document variable can be found under the category Document Automation as the field name DocVariable. By pressing the button 'OK' a new document variable is created. The entry { DOCVARIABLE \*MERGEFORMAT} is inserted in the document. The tick in the checkbox can usually be removed. If it is left in, it ensures that the content of the DocVariable is output uniformly. In Word there are two modes for displaying DocVariables. You can switch between the detailed {DOCVARIABLE ID \*MERGEFORMAT} and the abbreviated mode << ID >> with the key combination Alt+F9.

If you are in verbose mode, you can also create the double curly brackets with Ctrl+F9 and then write DOCVARIABLE into them.

You should never write the curly braces as curly brackets {}, because Word does not recognize this.

From now on there are different ways to access information from the ClassiX database. When printing, at least one object is always transferred to Word. This means that you can access all the information of this object and the objects that are linked to the source object via an access printout.

Example:
When printing an order, the order number should be output.
{ DOCVARIABLE uniqueID }
Now the project name should also be printed.
{ DOCVARIABLE costObjectivePointer.shortName }

This method can be used to output not only simple text or numerical values, but also Word texts, such as those used for condition and sales article descriptions. Word objects are always accessed via an access expression that ends in mlWordDoc. Just like multilingual texts that are accessed via mlDescription, the language valid for the document is always returned and inserted at the position of the field.

Example:
Printing a sales item description from a quotation.
{ DOCVARIABLE salesItem.mlWordDoc }
Printing the multilingual article text in an order item
{ DOCVARIABLE itemPointer.mlDescription }

A second possibility is to access variables used in ClassiX. For example, there are variables that always describe the same thing. cyberEnterprise always holds the object of the logged-in client, user always represents the logged-in user and printObject is always the object that is currently being printed. In addition, there are variables that are only sometimes used. For example, when printing a purchase order, the variable tmpCondition can be used to read information from the condition that is currently being printed.

Examples:
The client is automatically indicated in the letter of offer.

With kind regards
{ DOCVARIABLE var(cyberEnterprise).partner.name }
You could also print the initials of the logged on user.
{ DOCVARIABLE var(user).uniqueID }

However, these two methods have their limits if you want to output the values of a collection #04 or if you have complicated access expressions that cannot be displayed in Word. ClassiX offers the possibility to access macros defined in the modules directly. The object to be printed is transferred to the macro via the field name call (macro name) and the code behind it is executed. It is important that the macro is also defined in one of the modules involved in printing. A value must always be returned, usually this should be a string.

Examples:
When printing an offer, the article number should be printed. If the article is a variant part, the number should be replaced by the text "ATTENTION!

{ DOCVARIABLE call(PrintItemNumber)}








}
;

In conjunction with the methods presented so far to access information, there is also the possibility of using the ClassiX basic methods that the object to be printed brings with it.

Examples:
When printing a quotation item, data from the quotation header is to be accessed.

{ DOCVARIABLE TopTransaction().uniqueID }

In this example, you can use the fact that the object of the quotation item has the TopTransaction method, which returns the object of the quotation header and which you can use to access the ID.

When calling methods where parameters are written with quotation marks, these must be replaced by inverted commas.

Examples:
When printing one of the storage bins using a dimension ( CX_STOCK_SPACE ).

{ DOCVARIABLE stockSpaceItemAccount.Dimension('CX_STOCK_SPACE').uniqueID }

InstantView procedures can also be called from the document, module or provider. These must be called as usual with a "call()" in the access path.

Examples:
Here the name of the user is converted into an XML format .

{ DOCVARIABLE var(user).Speech(0,0,8).call(webService::XMLEncode) }

In connection with the document variables, you can also use additional field functions of Word. One of the most important of these is the IF condition. This branching option is always structured according to the following scheme.

{ IF condition "statement for true" "statement for false" }

It is also possible to access information in these fields via the DocVariables. It is important to use double quotation marks in the conditions. But not only IF conditions but also formula expressions, etc. can be used.

Example:
The technical administrator is to be printed in an offer. If this person is not specified, the business administrator is to be printed.

{ IF "{ DOCVARIABLE technical.personInCharge.name }" = " " "{ DOCVARIABLE personInCharge.name }" "{ DOCVARIABLE technical.personInCharge.name }" }

Another possible use of IF conditions is that they can be used to avoid unnecessary blank lines. The following example shows this.

Example:
{ IF "{ DOCVARIABLE technical.personInCharge.name }" = " " "" "¶
{ DOCVARIABLE technical.personInCharge.name }" }{ IF "{
DOCVARIABLE personInCharge.name } " = " " "" "¶
{ DOCVARIABLE personInCharge.name }" }

Here, the technical administrator is printed in the first condition. The line is only wrapped if he or she really exists. The same applies to the business administrator. If he or she does not exist, we are still in the line in which the technical SB was printed. Otherwise, it is printed in the next line.

By default, only the DOCVARIABLEs are evaluated directly in ClassiX and the other fields are processed by the word processing programme used, such as Microsoft Word. However, not all word processing programmes support all fields, which is why the environment variable CX_WORD_XML_MERGE_MODE(235443) can be used to control whether the IF, COMPARE, =AND and =OR fields should also be evaluated by ClassiX before printing in addition to the DOCVARIABLE field. This means that these fields can also be used in the documents if the word processing programme does not support these fields, or only supports them to a very limited extent. LibreOffice, for example, does not support the formatting of IF fields in the result. However, since the direct evaluation of the IF fields in ClassiX is somewhat more limited than the evaluation of Microsoft Word (see CX_WORD_XML::Merge), it is recommended to change the merge mode only if the premature evaluation of the fields is required.

5. common problems and questions

IF conditions are not interpreted correctly by Word

Here it can help to put the condition blocks, which are to be compared with each other, in quotation marks. Sometimes this is even mandatory. If a condition expression is to be compared with NOTHING, a space must be inserted between the quotation marks.
{ IF "EXPRESSION" = " " .... }
Word terminates with error message when printing

with the old printing method, cells of a table cannot be connected vertically.

Changes not possible

There may be a syntax error in the document variables. To find the incorrect document, you can use the title of the print window.

There are too many Word documents in the corresponding TEMP folder, which were created by Word itself. You should simply delete them to fix this.
Text blocks look different in the printout than in ClassiX.

You should check whether the document module and any Word documents involved have the same format templates (see Section 1.2)

6 . tips and tricks

  • Tables without margins help with the positioning of texts, list headers and lists. To edit the contents of these tables, the margins can be displayed as auxiliary lines. (Word 2013: In the menu bar the menu item "Table tools" is available for a table and is marked in colour. If you select the "Layout" sub-item you can activate the "Show grid lines" function on the left-hand side)
  • With logos, care should be taken to ensure that they have the formatting "With text in line". Logos should also be in a table without margins. However, the context menu item for changing the formatting is only offered if the logo is outside the table.
    Grafik Format Mit Tetx In Zeile


1 OLE ("Object Linking and Embedding") has become known as a Microsoft-developed standard for compound documents based on the COM specification. COM is the abbreviation for "Component Object Model".

2 fields within one window

3 fields are used as placeholders for changing data in a document or to create mail merge and labels in mail merge documents

4 Collection of objects in ClassiX that are attached to an access expression