ActiveReports 13
Localize Reports, TextBoxes, and Chart Controls
ActiveReports 13 > ActiveReports User Guide > How To > Localize and Deploy > Localize Reports, TextBoxes, and Chart Controls

In a section layout report, the Report object, TextBox control, and Chart control have a public Culture property that allows you to localize data when the OutputFormat property is set to D (date), C (currency), or other .NET formats.

Note: The default value for the Culture property is (default, inherit). For the Report object, this is the culture of the current thread and for the TextBox control and the ChartControl, this is the culture of the Report object.

In a page layout report, the Report object, TextBox control, and Chart control all have a Language property that works in the same way. The default value for the Language property is Default, which is the culture of the current thread.

Design Time

At design time, you can set the culture or language in the Visual Studio Properties window.

To localize a Report at design time

  1. Click the gray area around the design surface to select the Report in the Properties window.
  2. In the Properties window, drop down the Culture or Language property and select the culture that you want to apply to the report.

To localize a TextBox control at design time

  1. Click the TextBox control that you want to localize to select it.
  2. In the Properties window, drop down the Culture or Language property and select the culture that you want to apply to the textbox.

To localize a Chart control at design time

  1. Click the Chart control to select it.
  2. In the Properties window, drop down the Culture or Language property and select the culture that you want to apply to the chart.

Run Time

You can also specify a culture in code for section reports. For a list of System.Globalization culture codes, see Cultures.

To localize a Report at run time

  1. Double-click the gray area around the design surface, to create an event handling method for the ReportStart event.
  2. In the code view of the report that appears, paste code like the following.

    To write the code in Visual Basic.NET

    Visual Basic.NET code. Paste INSIDE the ReportStart event.
    Copy Code
    YourReportName.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US")

    To write the code in C#

    C# code. Paste INSIDE the ReportStart event.
    Copy Code
    YourReportName.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");

To localize a TextBox at run time

  1. On the design surface, double-click the section containing the TextBox control that you want to localize to create an event handling method for the section Format event.
  2. In the code view of the report that appears, paste code like the following inside the Format event.

    To write the code in Visual Basic.NET

    Visual Basic.NET code. Paste INSIDE the Format event.
    Copy Code
    TextBox.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US")

    To write the code in C#

    C# code. Paste INSIDE the Format event.
    Copy Code
    textBox.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");

To localize a Chart at run time

  1. On the design surface, double-click the section containing the ChartControl that you want to localize to create an event handling method for the section Format event.
  2. In the code view of the report that appears, paste code like the following in the Format event.

    To write the code in Visual Basic.NET

    Visual Basic.NET code. Paste INSIDE the Format event.
    Copy Code
    ChartControl.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US")

    To write the code in C#

    C# code. Paste INSIDE the Format event.
    Copy Code
    chartControl.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
See Also

Concepts