ActiveReports for .NET 3 Online Help Request technical support
Localizing the ActiveReports Viewer Control
See Also
User Guide > Samples and Walkthroughs > Walkthroughs > Standard Edition Walkthroughs > Advanced > Localization Walkthroughs > Localizing the ActiveReports Viewer Control

Glossary Item Box

In ActiveReports, the viewer control and associated dialogs can be localized.

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

The walkthrough is split up into the following activities:

To complete the walkthrough, you must have the following files, which are located in your Program Files/Data Dynamics/ActiveReports for .NET 3.0/ Localization folder.

The .resx and .txt files are located within the Viewer.zip file.

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

Creating a new Visual Studio project

To create a new Visual Studio project

  1. Open Visual Studio.
  2. From the File menu, select New > Project.

  3. Select the project type and click on Windows 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 EXE 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. From the File menu, select 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 following files from the Program Files/Data Dynamics/ActiveReports for .NET 3.0/Localization folder into the new CultureInfo folder: 
    • LocalizeViewer.bat
    • publickey.snk
  5. Add a new folder to the CultureInfo folder and name it "Viewer."
  6. Navigate to the Program Files/Data Dynamics/ActiveReports for .NET 3.0/Localization folder and locate Viewer.zip. This file contains the the .resx and .txt files necessary to localize the Viewer.
  7. Extract the contents of Viewer.zip to the Viewer folder you created. The Viewer folder should contain the following:
    • A Resources folder, which contains the files "Descriptions.txt" and "Strings.txt" 
    • A Document folder, which contains the file "PrintingStatus.resx"
    • TableOfContents.resx
    • FindDialog.resx

Localizing the Resource and Text Files

To localize the resource and text files 

  1. Open a Visual Studio .NET 2003 or 2005 command prompt. 
  2. Run the Windows Resource Localization Editor by typing "winres" and hitting Enter. This editor allows you to edit dialog .resx files for a certain locale. The utility is included as part of the .NET framework.
  3. From the menu bar of the Localization Editor, select File > Open.
  4. Change the file type to "ResX File(*.resx)".
  5. Navigate to the directory that you created and copied the required files into, choose the FindDialog.resx file and click Open to open the file in the Editor.
  6. Make any necessary changes, then from the menu bar click File > Save. Select your localization culture from the list and press OK.
  7. Repeat Steps 3-6 for the PrintingStatus.resx file.
  8. Repeat Steps 3-6 for the TableOfContents.resx file.
  9. Close the Windows Resource Localization Editor.
  10. Close the Visual Studio .NET 2003 or 2005 command prompt window.
  11. In Windows Explorer, browse to the folder in your project that contains the files, Strings.txt and Descriptions.txt. Edit each file for the language to which you have chosen to localize. Below is an image of part of the "Strings.txt" file used for this project. 

If any .resx files contain combo box items the .resx files need to be modified after they are saved.

Compiling the ActiveReports.Viewer3.resources.dll using the LocalizeViewer.bat file

To compile the ActiveReports.Viewer3.resources.dll

  1. Right-click on the LocalizeViewer.bat file and select Edit. The file will open in your default text editor.
  2. Set the value of CULTURE to the CultureInfo you are using.
  3. Add the CultureInfo extension to each .resx file to ensure that the localized .resx files you edited are used when the resources assembly is compiled. The following image highlights the changes that must be made.

  4. If you are using Visual Studio 2005, you will need to change the call command to "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat".
    You need to include references to the RtfExport and TextExport DLLs in order to enable the viewer's copy button.

Adding the ActiveReports Viewer control

To add the viewer control

  1. Select the ActiveReports Viewer control from the appropriate toolbox and drop it onto the Windows Form.
  2. Set the Dock property for the viewer to Fill.

Adding Code to Change the Culture Information (Optional Step)

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

Prior to deploying the project, you can send the ActiveReports.Design3.resources.dll file to ActiveReports.Support@DataDynamics.com to have it signed. Once Data Dynamics has signed the DLL, you will need to use sn -Vu "ActiveReports.Design3.resources.dll." When you deploy the project, if your other DLLs are being sent to the Global Assembly Cache, this file will also need to be sent there.
  

See Also

©2009. All Rights Reserved.