ActiveReports for .NET 3 Online Help Request technical support
Localizing the Active Reports Web Viewer Control
See Also
User Guide > Samples and Walkthroughs > Walkthroughs > Professional Edition Walkthroughs > Pro Edition Localization Walkthroughs > Localizing the Active Reports Web Viewer Control

Glossary Item Box

In ActiveReports, the WebViewer control's labels and ToolTip 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:

You can find these files in your Program Files/Data Dynamics/ActiveReports for .NET 3.0/Localization folder.

The Stings.resx file is located within the Web.zip file.

When you have finished this walkthrough, you will have a localized ActiveReports WebViewer control that looks similar to the following. For purposes of this image, 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. From the File menu, select 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 and C#, this will be the bin 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 "fr" for French.
  4. Copy the following files from the Program Files/Data Dynamics/ActiveReports for .NET 3.0/Localization folder into the new CultureInfo folder: 
    • LocalizeWeb.bat
    • publickey.snk
  5. Add a new folder to the CultureInfo folder and name it "Web."
  6. Navigate to the Program Files/Data Dynamics/ActiveReports for .NET 3.0/Localization folder and locate Web.zip. This file contains the Strings.resx file necessary to localize the Web Viewer.
  7. Extract the contents of Web.zip to the Web folder you created. The Web folder should contain the strings.resx file. 

Localizing the Strings in Visual Studio .NET

To localize the strings in Visual Studio .NET

  1. Double-click strings.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. Additionally, you can edit strings.resx in any text editor.

Compiling the ActiveReports.Web.resources.dll using the LocalizeWeb.bat file

To compile the ActiveReports.Web.resources.dll

  1. Right-click on the LocalizeWeb.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, as the following image demonstrates.

  3. 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".
  4. Double-click on LocalizeWeb.bat to run the batch file and compile the resources DLL to your localization folder. From the command window, you should see the resource file written and a verification entry for the ActiveReports.Web.resources assembly. This indicates success and the ActiveReports.Web.resources.dll is added to your localized folder.

Adding the ActiveReports WebViewer control

To add the WebViewer control

  1. Select the ActiveReports WebViewer control from the appropriate toolbox and draw it onto the Web Form.
  2. Localization will only affect the WebViewer if the ViewerType property is set its default value, HtmlViewer.

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

  1. Press F5 to run the application.
Prior to deploying the project, you can send the ActiveReports.Web.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.Web.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.