Glossary Item Box

ActiveReports for .NET 2 Online Help Send feedback to Data Dynamics

Localizing the Active Reports Web Viewer Control

In ActiveReports, the WebViewer control's labels and tool tip text can be localized for the HtmlViewer ViewerType.

This walkthrough illustrates the basics of setting up localized strings for the ActiveReports WebViewer control.

The walkthrough is split up into the following activities:

To complete the walkthrough, you must have the following files: strings.en.resx, BuildSatelliteAssembly.bat, and DataDynamicsPublicKey.snk. You can find these files in your Program Files\Data Dynamics\ActiveReports for .NET 2.0\Localization\Web Viewer folder. You will also need access to the current activereports.web.dll installed on your machine which you can find in the Program Files\Common Files\Data Dynamics\ActiveReports for .NET 2.0 folder.

When you have finished this walkthrough, you will have a localized ActiveReports WebViewer control that looks similar to the following. For purposes of this screenshot, French was used to localize the WebViewer control.

Creating a new Visual Studio project

To create a new Visual Studio project

  1. Open Visual Studio.
  2. Click on File > New > Project.

  3. Select the project type and click on ASP.NET Web Application.
  4. Change the name of your project and click OK.

Creating a Directory

To create a directory

  1. Open Windows Explorer and browse to the folder in which your project's DLL file will be contained when the report is run. For Visual Basic .NET, this will be the "bin" folder. For C#, this will be the "bin/Debug" folder.
  2. On the File menu, click New > Folder.
  3. Name the folder according to the CultureInfo that you will use to localize your project. For example, you would use "ja" for Japanese.
  4. Copy the required files (strings.en.resx, BuildSatelliteAssembly.bat, and DataDynamicsPublicKey.snk) to this new folder.

Localizing the Strings in Visual Studio .NET

To localize the strings in Visual Studio .NET

  1. Double-click strings.en.resx to open it in Visual Studio .NET. 
  2. The .resx file contains three relevant columns:
    • Name - It is important that the name column does not change; this is how the WebViewer control finds the localized resources.
    • Value - To localize the strings, change the string in the Value column for each item you wish to localize.
    • Comment - The comment column describes exactly what each string is used for, helping you to determine how to set the value column.
  3. From the File menu, choose Save strings.en.resx As, set your localization culture, and then press OK.  To set your localization culture:
    • Change the en portion of the strings.en.resx file to the culture name for which you are creating the localized resources (for French, this is fr).
    • A list of the valid culture names can be found in the .NET Framework Class Library documentation under the "about CultureInfo class" topic.
    • The culture name can be neutral or specific. For example, "en" is a neutral culture name, whereas "en-US" is a specific culture name.
  4. Close the Visual Studio .NET IDE.

Compiling the ActiveReports.Web.resources.dll satellite assembly using the BuildSatelliteAssembly.bat file

To compile the Satellite Assembly

  1. Open a command prompt, and in DOS, navigate to your localization folder,  i.e. cd C:\Inetpub\wwwroot\MyWebViewerProject\bin\fr.
  2. You will then need to run the .bat file and pass it your CultureName and the Version of your ActiveReports build.  i.e. BuildSatelliteAssembly.bat es-mx 4.0.0.1009 (The Version of your ActiveReports build can be found by right-clicking the ActiveReports.dll found in C:\Program Files\Common Files\Data Dynamics\ActiveReports for .NET 2.0 and choosing Properties.  The File Version is on the Version tab.)
  3. You should see a Success! message when it has finished, and two new files will be created.  One is DataDynamics.ActiveReports.Web.strings.fr.resources, and the other is ActiveReports.Web.resources.dll.
  4. Send the compiled ActiveReports.Web.resources.dll satellite assembly you just created to the ActiveReports support staff and they will get it signed for you so that the signing key for the satellite .dll matches the key used to sign the ActiveReports.Web.dll assembly. (If the signing key does not match, the localization will be ignored.)

Adding the ActiveReports WebViewer control

To add the WebViewer control

  1. Drag and drop the ActiveReports WebViewer control from the appropriate toolbox to WebForm1.
  2. Localization will only affect the WebViewer with the default value of the ViewerType property, which is the HtmlViewer.

Adding Code to Change the Culture Information (Optional Step)

Note: This step is only necessary if you are developing on a machine with culture information different from that in the project you are localizing.

To add code to change the culture information

Running the Project

To run the project

  1. Press F5 to run the application.
  2. If the satellite assembly in the directory you created has not been signed by Data Dynamics' development staff, the localization will be ignored. 

Note: We have plans to simplify this process in a future version of ActiveReports for .NET.

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.