Report.Language([Integer]) Method
Version: Available or changed with runtime version 1.0.
Gets or sets the current language setting for the report.
Syntax
[CurrentLanguage := ] Report.Language([Language: Integer])
Note
This method can be invoked using property access syntax.
Parameters
Report
Type: Report
An instance of the Report data type.
[Optional] Language
Type: Integer
The new language setting for the report.
Return Value
[Optional] CurrentLanguage
Type: Integer
The current language setting for the report.
Example
If you have reports that you want to print in the language of the recipient rather than in your own working language, you can add a single line of code in the report to handle this. This functionality is already enabled for most reports in the standard Business CentralBusiness Central database. The document is printed in the language that is specified in the Language Code field on the Customer Card page.
For reports that need the multiple document languages functionality, you must insert the following AL code as the first line in the OnAfterGetRecord()
trigger on the data item referencing the Customer table (notice that that feature isn't limited to the Customer table, other data sources provides similar functionality):
CurrReport.Language := LanguageMgmt.GetLanguageIdOrDefault("Language Code");
For each of these reports, you must create a new variable, LanguageMgmt
, with the data type Codeunit
pointing to the Language
codeunit. When you have compiled the object, it'll no longer print in the user's working application language if another language has been specified on the Customer Card page.
var
LanguageMgmt: Codeunit Language;
See Also
Report Data Type
Get Started with AL
Developing Extensions
Report Localization
Report.FormatRegion
Feedback
Submit and view feedback for