Introduction and prerequisites
Excel and word templates can be provided for the document generation.
The maintenance screen for the templates is called: wExportDefinition (desktop exportDefinitionListW)
Excel
To create a working Excel-File:
- Go to the grid of the object you want to print into an excel-file
- Export the grid in an excel-file - now you have the named ranges in the excel-file
- Create pivot tables and pivot charts in own tabs based on the excel (use the example shown below for ideas)
- Upload the excel file into a template
It is sufficient to create a template and upload the excel-file with the following settings:
Example Template
TBD
Word
You can use the example below. For that some texts and labels must be defined.
- Create a word-template (use the example below)
- You have to adjust the bookmarks and field-names
- It must be defined which BusinessEntity should be printable - must be discussed with Developer
- Within the types-desktop you can define bookmark-names
- Import labels AK_Standard_form_labels.xml in Template-desktop (exportDefinitionListW)
- Upload the word-file to a new template like this:
- Add the text to the template
Example Template
Export to Word in grids
Similar to "Export to Excel" functionality in every grid you can use this also for Word:
Unlike Excel, you need a dedicated template for word. Please use
- overall bookmark: dsData
- bookmark for records: [EntityName]
- fields: datafields of the entity
Example
Word-Example for contact from AKIOMA.OFFER:
How-to: Export to Excel or Word
A grid can be exported to a word template.
This can be accessed from the grid's context menu > Word-Export.
Clicking on this opens up the Word-Export dialog. Right now, this is a copy of the Excel-Export dialog. The only required input for exporting the grid is the Word-Template field.
In order for this to work, we must first have a template defined and compiled.
If we wish to export a list of records from a grid, then we must define the template in the following format:
The simplest way to do it is to define a top-level bookmark (which is not included in any other bookmark) and a sublevel bookmark (included in the top-level one).
With the addition of dynamic dataset, the top-level bookmark can simply be named 'dsData'.
The sub-level bookmark must have the name of the temp-table being returned by the fetch request for the grid. If you already have a working grid you can check the fetch request from the dev tools:
Your bookmarks could look something like this:
If you select the first record and click on “Go to” you see, that the whole table is highlighted.
If you select the second record and click on “Go to”, you will see, that only the row with the content is highlighted.
For more info about templates & docxFactory please see the complete documentation and also this: Alternative Bookmark Name for Node Type in Word Export
Back to Documentation
Back to Home Page