Create a report in the language of the user
Microsoft Dynamics 365 Business Central is multilingual-enabled, which means that you can display the user interface (UI) in different languages.
The language of the user is considered as the language that is selected in Business Central.
Business Central is supported in a number of markets and is available in the languages that those markets require. This feature is a result of support for multiple languages at runtime in combination with support for legal requirements in the supported markets, meaning that Business Central can present itself in different languages. You can change the language that is used to display texts. The change is immediate after you've been automatically signed out and then you sign in again. The setting applies only to you and not to everyone else in your company.
For example, if you're using the Canadian version of Business Central, you can see the UI in English and in French, but it's still the Canadian version of Business Central in all other aspects. In other words, it isn't the same as Business Central in the United Kingdom.
To change the language of the user interface, go to the My Settings page.
When a user changes the language, any report also needs to be generated in that language. For example, if the report contains field names and table names, then these names need to be generated in the language of the user. If the report contains other elements that need to be multilingual, then the developer needs to ensure that these elements are in the dataset of the report in a translatable manner.
To set whether to include the caption of a field in the dataset of a report, you can set the IncludeCaption property.
If you want to use the Caption value of a field as a label on a report layout, then you must include the caption in the dataset. When you add table fields to the dataset, you can set the IncludeCaption property to true to specify that the caption for the field is also added to the dataset. If you do not include the caption in the dataset, then in a multilingual application, you can't use the multilingual captions as labels in the report.
The following example shows a report that fetches records from the Customer table and then adds the field captions in the dataset by using the IncludeCaption property:
report 50106 CustomerListReport
{
UsageCategory = ReportsAndAnalysis;
ApplicationArea = All;
AdditionalSearchTerms = 'Customer List Report';
RDLCLayout = 'CustomerListReport.rdl';
DefaultLayout = RDLC;
dataset
{
dataitem(Customer; Customer)
{
column(CustomerNo; "No.")
{
IncludeCaption = true;
}
column(CustomerName; Name)
{
IncludeCaption = true;
}
column(City; City)
{
IncludeCaption = true;
}
column(BalanceLCY; "Balance (LCY)")
{
IncludeCaption = true;
}
}
}
}
When you generate the RDLC Layout for the report, you should see the following screen.
Notice that the field values are available in the DataSets section of the layout, but the field captions are available in the Parameters section of the layout. In most cases, you'll use the captions on the table header, as illustrated in the following example.
If you need to add text to the report that is not related to a field or table in the database (meaning, it won't have a caption), then you can add a Labels section after the report dataset.
labels
{
LabelName = 'Label Text', Comment = 'Foo', MaxLength = 999, Locked = true;
}
A label denotes a string constant that can be optionally translated into multiple languages.
The following parameters are optional, and the order isn't enforced:
Comment - This parameter is used for general comments about the label, specifically about the placeholders in that label.
Locked - When this parameter is set to true, the label shouldn't be translated. The default value is false.
MaxLength - This parameter determines how much of the label is used. If a maximum length is not specified, then the string can be any length.
The Label data type is used in .XLF files for translations. When you generate the WordLayout for the report, the following screen appears.
You should now see the report labels under the Labels drop-down menu.