If you run the ReportViewer in local mode, you can also bind it to your business logic directly, instead of having to bind it to a database directly.
I found localizing the reports a bit tricky and not well documented, so here is a step by step guide:
- When I installed Visual Studio 2005, only the English version of the report viewer itself was installed. The toolbar buttons for searching, exporting, etc. were displayed only in English. First you have to download and install the Microsoft Report Viewer Redistributable 2005. You will need to install this even if you have Visual Studio 2005 installed, as otherwise the installation of the following download will crash (at least it did that on my machine).
- Now you can download the Microsoft Report Viewer 2005 Language Pack. Go here, choose the language from the dropdown, download and install for each language that you want to support.
- If you run the report viewer now, you can see the localized toolbar.
- In order for the report itself to display localized formats for currencies, dates, etc., make sure you have set the Language property of your report either to default, or to the desired language. This property is initialized to English if you use the English version of Visual Studio.
- You also have to make sure that the thread is using the correct culture settings. This will default to the setting of your server. You can override it with the language the user has selected in his browser by doing something like
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages);
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages);
in a suitable place, like the page load or session start.
- Finally, make sure you use culture aware formatting settings in your report, for example "C" for currencies.