ActiveReports 6 Online Help Send comments on this topic.
Localize ActiveReport Classes, TextBoxes, and Chart Controls
See Also
ActiveReports 6 > ActiveReports User Guide > How To > Customize, Localize and Deploy > Localize ActiveReport Classes, TextBoxes, and Chart Controls

Glossary Item Box

Each of the following objects has a public Culture property that allows you to define how ActiveReports formats data when the OutputFormat is set to D (date), C (currency), or other .NET format specifiers.

Note: The default value for the Culture property is (default, inherit).

For the ActiveReport object, this is the culture of the current thread.

For the TextBox and ChartControl, this is the culture of the ActiveReport object.

Design Time

At design time, you can set the globalization culture in the Visual Studio Properties grid.

ShowTo localize an ActiveReport at design time

  1. In the Design view of the report, select the ActiveReport object in the Properties grid.
  2. Drop down the Culture property list, and select the culture that you want to apply to the report.

ShowTo localize a TextBox at design time

  1. In the Design view of the report, select the TextBox control that you want to localize in the Properties grid.
  2. Drop down the Culture property list, and select the culture that you want to apply to the textbox.

ShowTo localize a Chart at design time

  1. In the Design view of the report, select the ChartControl in the Properties grid.
  2. Drop down the Culture property list, and select the culture that you want to apply to the chart.

Run Time

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

ShowTo localize an ActiveReport at run time

  1. In the Design view of the report, double-click in the grey area below the report 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.

    ShowTo write the code in Visual Basic.NET

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

    ShowTo write the code in C#

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

ShowTo localize a TextBox at run time

  1. In the Design view of the report, 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 in the Format event.

    ShowTo write the code in Visual Basic.NET

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

    ShowTo write the code in C#

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

ShowTo localize a Chart at run time

  1. In the Design view of the report, 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.

    ShowTo write the code in Visual Basic.NET

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

    ShowTo write the code in C#

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

See Also