Everybody knows the default Dynamics NAV report layouts with the default text constants. Many NAV end users want to have customized labels on their reports and now with Document Creator this is possible. This NAV add-on has translation functionality which end users can use to create their own translations for each language. A great feature for companies with customers from multiple countries. Setup the text ‘Quantity’ for language code ENU and ‘Aantal’ for language code NLD, and you will get translated reports automatically without the need for development. The key thing behind this is that translations are all data, not code.
A big advantage for customers who work with Document Creator translations is that they can alter their own reports by changing the translations directly in Dynamics NAV. No need for help from your NAV partner!
The translations screen
In this screen you can edit your translations. In the upper section you see the translation tags and in the bottom section you have the translations per language code.
When you create a new translation in the dataset, this label will automatically be added to the table in Dynamics NAV at the moment you print your report for the first time (showing a preview on the screen should be enough). To manage the translation work that has to be done there is a to-do function implemented. When you have printed the report for the first time, the “To-do” checkbox will be checked. The default translation will be filled automatically with a hashtag so that you can clearly see where there is some work to do.
Features to manage your translations
On the setup card there is an option “Translation Update Usage”. With this you have the following options; None, Last Used, Last User & Last ReportId. The default is None, but when switching to one of the others, when printing a report it will automatically write back information to the translations table. This helps you to quickly find out which labels are used on which report.
Another option is “Translation Show Tags”. It can be used to quickly see the tags that are used for translation. In the next screen dump you see the order confirmation report printed with this setting enabled. All the labels are printed between ‘< >’ signs. This way you can easily find out which label you need to translate to personalize the report.
Default language code
Many companies use both the empty language code ” and a language code like ENU, for the same English language. When filling in language code ENU on the customer card, a report might not be able find a translation for this text. To get rid of this problem, fill in ENU as the “Default Translation Language Code” in the Document Creator Setup and Dynamics NAV will automatically add this translation to the translation table when creating new labels.
Global or report specific translations
It is possible to use one translation tag in multiple reports, but it’s also possible to create a translation for a specific report ID. You can also go from global to report specific by using the copy action. Just specify a report ID, and you get a new set of values which can be used for that specific report.
How-to – Development
To implement and make use of the translation functionality you have to add some code in your dataset. The standard Document Creator installation comes with a package of report layouts and datasets. For your reference the reports 72100-72150 are optimized layouts where the translations are already implemented.
In just 4 steps you can add the translations to any report.
Add 2 global variables to your report:
Add a local function Trl()
This local function and can be copied to every report where you want to use translations.
Next we have to set the language. The language can be different for every Sales Header so we add this line of code in the OnAfterGetRecord:Add as many fields as you want. The datasource fields are encapsulated by the translate function: Trl(‘<Tag>’).
That’s it! In the first run all the tags will be added in the Translation table. After that you can modify the labels as desired.
Using the Document Creator translations functionality provides partners and customers a lot of advantages. As a partner you don’t need to worry about the text on the reports, your customers can now edit texts themselves.