Translating Dynamics 365 (CRM) SSRS Reports


I'm kicking off my blog with a post about translation/internationalisation of reports in Microsoft Dynamics 365 (CRM). This post illustrates a method that can be used to simplify the development and maintenance of reports which must be available in multiple languages.
The Dynamics 365 (CRM) SDK documentation is not particularly helpful on this point. It recommends:

For these types of solution components, the recommended tactic is to create separate components for each language.

As I'm sure you can imagine, replicating the same report in a second language is a bit of a pain. Particularly because applying translations to a copy of a report requires you to either:

  • Edit the report in the report development environment (BIDS/SQL Server Data Tools).
  • Edit the rdl file directly.

Both of these are likely to be beyond what you could expect a translator to do, so some pre and post work would need to be done by the report creator.
The task becomes even more onerous as you add more languages and more reports to be translated.

The method

The method I will describe makes use of a custom CRM entity to hold the translated strings. These are loaded as data into the report, where the translated strings are used to populate the report labels.

Custom translation entity

The entity that holds the translations is called into_localisedstring.
I recommend that you:

  • Give it "Organization" ownership because any user might need to see the translations.
  • Turn off everything else, e.g. feedback, notes, activities etc.

The entity has the following fields (N.B. my schema additions are prefixed with "into_" so substitute in your publisher's prefix as required):

Name Description Type
into_component Allows you to group translations together by report Single Line of Text
into_key Identifies the specific label that is being translated Single Line of Text
into_localeid The Windows locale id of the language Whole Number
into_string The translated string Single Line of Text

The report

For the purposes of this article, I have created a very simple report that I will use as an example.
Report Sample Screenshot To allow translation, your report will need to be modified in three ways. Each will be covered in greater detail in the subsequent sections:

  1. Define a translation dataset
    A new dataset should be added so that the localised strings can be loaded.
  2. Apply the translated strings to the report
    Every piece of text that needs translation should have its definition changed in the report so that it loads its text from the localised strings dataset.
  3. Change report language
    Set the report language (in the CRM Report Record) to "All Languages".

In addition to the report changes, a record should be added to the translation entity for every localisable string in all languages.

Define a translation dataset

Using the SQL Server Data Tools/BIDS, add a new data set to your report. I have called mine LocalisedStrings.
N.B. You will need to substitute in your publisher prefix instead of mine everywhere you see into_.
Added Dataset

Dataset Query

For copy/paste convenience, here is the text of the query
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="into_localisedstring"> <attribute name="into_localisedstringid" /> <attribute name="into_name" /> <attribute name="into_string" /> <attribute name="into_localeid" /> <attribute name="into_key" /> <attribute name="into_component" /> <order attribute="into_name" descending="false" /> <filter type="and"> <condition attribute="statecode" operator="eq" value="0" /> <condition attribute="into_component" operator="eq" value="TranslationReportSample" /> <condition attribute="into_localeid" operator="eq" value="@CRM_UILanguageId" /> </filter> </entity> </fetch>

Language ID Parameter

You might notice that the query is using the @CRM_UILanguageId parameter to detect the user's language. You will need to add this as a dataset parameter, like this:
Dataset Parameter

Apply the translated strings to the report

In your report, edit the Expression for the label you want to translate. Here I am editing the label for a column heading:
Edit Expression Set the expression like this, substituting in a unique value for the Key (in my example, "AccountName").
N.B. You will need to substitute in your publisher prefix instead of mine everywhere you see into_.
Expression Value .. and here again for copy/paste:

=Lookup("AccountName", Fields!into_key.Value, Fields!into_string.Value, "LocalisedStrings")

Change report language

On the Report definition, in Dynamics 365 (CRM), set the language of the report to "All Languages":
Report Language

Report Name Limitation

One of the limitations of this technique is that it does not allow the report name to be translated. If you need this, then instead of setting 'All Languages", you could create a CRM report definition for each language (but pointing at the same rdl file). More records to create, but at least you only need to develop the report rdl once.

Localised Strings

You can get access to the Localised Strings by using Advanced Find, where you should add a row per language for every string you need translated:
Localised Strings List

The Final Result

At the start of the post, I showed you the sample report in English. Here it is, translated into Spanish:
Spanish Report Sample N.B. You can see that the traditional concerns of internationalisation still apply, i.e. Nombre de cuenta is longer than Account Name, so it has wrapped onto two lines. You need to take this into consideration when laying out your report.

That's all for my first blog post. Congratulations for making it this far. Thanks for reading and check back soon for the next episode.

Post image flags at the Rockefeller Center copyright Ryan (license)