Generate documents
With Intrexx, document templates can be created from view pages in applications for the following word processing programs:
-
LibreOffice (Recommended)
Please note that you must install the entire LibreOffice package if you use LibreOffice as a word processing program.
-
iText
is included in the Intrexx installation. iText can be used to create simple documents without images and tables. This word processing program is not recommended for more complex documents.
If a document is created in a browser or other end device, the word processing program being used must be open.
Any elements used with the "Grid" element in a responsive layout are not supported during document generation.
VTL include elements are supported as long as they are located on the same page that generates the documents and are not integrated into a free-layout table.
The "Content Editor" and "Content View" application elements cannot be used to generate documents.
Documents can only be generated from data from the same data group or a direct child data group. Install the text editor To get the full functionality of document generation, a suitable word processing system for processing *.odt files (e.g. Open Office / Libre Office) should be installed.
HTML variables used in VM files or text boxes must not be located in the header or footer of the document. Use HTML variables only in the body of the document.
Enter text editor as external program
To use the full functionality of the document engine, a suitable word processing program for editing *.odt files (e.g. Libre Office) should be installed.
During installation, Intrexx recognizes whether LibreOffice is already installed so that the settings described here are made automatically.
If this is not the case, enter the program path via the main menu "Extras / Options / General / External programs" (e.g. C:\Program Files\LibreOffice\program\soffice.exe).
Document engine -– Settings in the portal properties
The portal-wide default settings for the document engine can be found in the portal properties, which you can access via the "Portal" main menu. Select the item "Documents / Document engine" there.
Document engine
Here you can select which word processing program should be used.
Keep document format
This option will keep the current format of the document.
Create PDF
This option creates a PDF of the current document.
The chosen document format will later be selectable as the server standard in the "Create document" button action.
Depending on the document engine selected, different settings can be made at the bottom of the dialog.
LibreOffice options
Manage LibreOffice instance automatically
Home folder
Enter the root directory of LibreOffice here (e.g. C:\Program Files\LibreOffice).
Please note that the installation directory of LibreOffice must be entered here from the perspective of the Intrexx portal server.
Here is the default installation directory for LibreOffice in the different operating systems:
-
Windows
c:\Program Files\LibreOffice
-
Mac
/Applications/LibreOffice.app
-
Linux
/opt/libreoffice
Host / Port
Enter the host and a free port > 1024 which Intrexx will use to communicate with the service. Usually, port 8100 is suitable.
Test
Click on this button to test the connection.
iText options
Preserve HTML tags
HTML tags are not available in iText. Tags such as bold or italic font will not be implemented. With the setting "Preserve HTML tags", the HTML tags will be applied to the text when a document is generated. If the setting is not activated, the text will be added to the document without HTML tags. iText's suitability for more complex documents is therefore limited.
Templates – Settings in portal properties
Here you can configure the default settings for the layout of the templates for the document engine.
Template type
Select the template format here.
Default settings
You can set the formats for fonts and colors in text and tables for document and PDF generation here.
Table headers
The layout of table headings can be changed here.
The generation will attempt to position the elements in accordance with the view page's layout but this cannot be guaranteed. The data from the view page will be placed dynamically in the new document in place of the placeholders. Tables are constructed using Velocity markup here. If your document has a page break, you can decide whether the heading should be repeated.
Colors in charts may be different in the generated document than the colors specified in the chart properties. Charts may not be displayed in the generated document if you use Microsoft Word. In this case, please open the document in LibreOffice or create a PDF instead of the .odt file.
Configure document engine in applications
Create a new application based on the Basic application template.
In the new application select the application node and create a new view page using the context menu "New/view page". Now switch to the "All Entries" page.
Copy the view table.
Switch back to the view page and insert the view table there. Then open the view page properties.
View page properties – Documents
The following settings for the document engine can be found in the properties of view pages:
Use for document generation
Document generation is activated with this setting.
Create new template / Edit template placeholder configuration
Click here to create a new template or to edit the placeholder assignment for an existing template.
Edit current template
Opens the word processing program whose path you have entered in Options to edit an existing template.
Delete template
The template is deleted.
Document template
Enter a name for the template here.
Template type
Here you can select the desired type depending on the settings defined in the Portal properties.
Please note: The use of Microsoft Office for editing ODT files is not recommended. No technical support can be provided if errors occur.
Models
If a template has not been created yet, the "Models" drop-down list will be empty. As soon as you create a report template, it can be selected from here. All templates can be found in the portal directory "internal/reports/document-templates".
Click "Next".
Aliases configuration
Here you will find the placeholder where the data from the corresponding application element will later be inserted in the document.
Available controls
In this column, the controls can be selected that should be inserted as placeholders into the template.
Template context
You can see the placeholders that will be used later in the template in this column.
If you configure a page that contains a table, for example, an iterator can be determined to increase the readability of the document. Here Intrexx first automatically inserts the name of the table record element of the table. This can be overwritten with an iterator of your choice. The iterator is automatically used for every element contained in the table, such as the title, instead of the name of the table record element.
Changes to the iterator are only saved if the change is confirmed with the Enter key.
When creating the template, all controls on the view page are selected automatically. If further controls are placed on the view page later, these can also be added to the template and the placeholder assignment adjusted accordingly.
The following list shows the controls that can be output in documents:
-
Static text
-
View field
-
Dynamic view
-
Text field view
-
View checkbox
-
Line
-
Listbox
-
View multiple selection
-
View sortable list
-
View table
-
Free layout table
-
Image
-
Diagram (all except horizontal area diagrams and "Other" type diagrams)
-
File selection view
-
Static text for programming
-
VTL Include
-
Calculation
In our example, the table contained on the view page is already selected for the template context. Click "Next".
Use the "Edit template" setting to open the template in the word processing program after clicking on "Finish".
The template has now been finalized. Click "OK" to save all the settings and close the dialog.
Configure a button
Users need a button with the "Create document" action so that they can use the document creation function in the browser.
Create a button on the view page containing the table. The properties dialog for the button opens automatically.
Switch to the "Actions" tab and select the "Create document" action type.
Select the template used to create the documents here.
The following output formats are possible:
-
Server default
Uses the format configured in the portal properties.
-
Use template
Outputs in the ODT format.
-
PDF
Generates the document as a PDF.
Click on "OK". For the view page to be accessible in the browser, it must now be added to the application menu.
Double-click on the application node to add the view page to the "Selected pages" list on the "Application menu" tab in the properties dialog.
Click "OK" and save the application.
Open the application in the browser and enter sample data via the "All entries" page. Then switch to the view page and click on the button.
The new document is then opened in a separate browser tab and the data is displayed in the table.
Edit template
If you want to change a template, open the properties dialog of the view page again.
Click on "Edit template". The template is then opened in the word processing program.
Here you will find all the placeholders and elements that are configured in the placeholder assignment. You can now customize and save the template as desired. Confirm changes by clicking on "OK" in the properties dialog of the view page and save the application. The modified template is then available in the browser.
Buttons on the view page will not be included in the template.
Document action in processes
With the process element "Document action", a document can be generated when a data record is added or changed; this document can then be saved directly to a data record.