Table of Contents

Culture option

The Culture option allows you to force the language in which the report data will be rendered. This includes:

  • hardcoded labels (such as titles, table headers, etc.)
  • numbers formatting (e.g. 1,234.00 in "en-GB" vs. 1 234.00 in "fr-FR")
  • native variables (e.g. {PageNofM})
  • localizable strings within the business data

Preliminary remark

At the time of writing, this option does not replace the need for configuring the reference culture of your template.

And if the language provided is not the reference culture, it should be one of the localization cultures.

How to use?

The full culture code will be used for localizing native variables (e.g. {PageNofM}) and formatting strings (e.g. numeric to monetary).

Only the first part of the code will be used (e.g. "en" from "en-GB") when selecting a string from a LocalizableString dictionary retrieved from the business cluster.

The full culture code or the 2-letters language code will be used (in that order) to localize text labels in the report (see Adding languages and translating.

Example:

var options = new ExecuteReportOptions("MyReport")
    .WithCulture("en-GB");

await this.ExecuteReportWithOptionsAsync(options);

Legacy version

2-letters language codes are also supported.

When required, the 2-letters language code will be expanded to the a full culture code. For instance:

  • "en" will be expanded to "en-US"
  • "es" will be expanded to "es-ES"
  • "fr" will be expanded to "fr-FR"
  • etc.

For instance, to generate a French report, one can use:

var options = new ExecuteReportOptions("MyReport")
    .WithCulture("fr");

await this.ExecuteReportWithOptionsAsync(options);