Articles in this section
Category / Section

How to localize the report content?

2 mins read

This article explains how to localize the report contents. The report contents can be localized using the following two ways.

1. Use Code class expressions instead of static texts in report item values to display them based on culture. To add custom codes in a report, do the following.

a)In Design view, right-click the design surface outside the border of the report and click Report Properties.

b)Click Code.

c)In Custom code, type the code. Errors in the code produce warnings when the report runs. The following example creates a custom function named Change Word that replaces the word "bike" with "bicycle".

Public Function ChangeWord(ByVal s As String) As String
   Dim strBuilder As New System.Text.StringBuilder(s)
   If s.Contains("Ito") Then
      strBuilder.Replace("bike", "bicycle")
      Return strBuilder.ToString()
      Else: Return s
   End If
End Function

d)The following example shows how to pass a dataset field named Category to this function in an expression:

=Code.ChangeWord(Fields!FullName.Value)

2. Set Language property in Text Box Report item to display the textbox numeric, date time values in current culture.

In report Design view, select the text box to which you want to apply locale settings and in the Properties pane, do the following:

  1. For the Calendar property, type or select the calendar that you want to use for dates.
  2. For the Direction property, type or select the direction in which the text is written.
  3. For the Language property, type or select the language that you want to use for the text box. This value overrides the Language property for the Report.
  4. For the Numeral Language property, type or select the format to use for numbers in the text box.
  5. For the Numeral Variant property, type or select the variant of the format to use for numbers in the text box.
  6. For the Unicode Bidi property, select the level of bidirectional embedding to use in the text box.

Sample Link:

https://www.syncfusion.com/downloads/support/directtrac/139571/ze/Localization_Sample1613961880568368536.zip

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied