Conditional formatting with the LanguageCode% formula

When you first create a report that is based on a BW query, Crystal Reports automatically generates a formula named LanguageCode%. You can find this formula in the Field Explorer. Rather than performing a calculation, this formula consists of a string value—a single letter—that serves to associate the report with a particular logon language.

When you first create and design your report, the formula contains the code for your current language ("E" for English, "D" for German, and so on). This is the report's master language. When you prepare reports for translation and subsequently publish them to SAP BusinessObjects Business Intelligence platform, the BW Report Publisher modifies the LanguageCode% formula in each translated report. When an SAP user views a Crystal report or logs on to BI launch pad, the application filters the available reports: if a translated report is available in the user's logon language, it is displayed for the user; if a translated report is unavailable, the report appears in its master language.

The LanguageCode% formula is intended to provide you, the report designer, with a tool for conditionally formatting reports in ways that accommodate users with different logon languages. For example, suppose that your report displays values from a Product Category field, the string values of which are translated within SAP. As a report designer, the difficulty lies in that the German strings are longer than the equivalent English strings.

To solve this problem, you could use the LanguageCode% to conditionally reduce the font size for the translated version of the report (as demonstrated in the following steps). Alternatively, you could insert two Details sections—each containing the same database fields—and increase the width of the fields in the second section to accommodate for the longer German strings. Your conditional formatting formula would then show/hide the Details sections according to the report's language.