|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Deploying Reports and ReportViewer Controls
You can freely distribute reports and the ReportViewer controls as part of your application. Deployment requirements vary widely depending on the control type and whether your report is configured for local or remote processing. You can deploy locally processed and remotely processed reports in the same application.
Redistributing the ReportViewer Controls
The ReportViewer control redistributable is a self-extracting file named ReportViewer.exe that includes an .msi and other files. You can find ReportViewer.exe at the following location: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ReportViewer\ReportViewer.exe.
When you run ReportViewer.exe, the following files are copied to the Global Assembly Cache folder on the deployment computer.
Provides core reporting functionality that is common to the ReportViewer Windows forms control and Web server control.
Exposes the report object model so that it can be accessed programmatically at run time from expressions in the report definition.
Provides the ReportViewer control for ASP.NET pages.
Provides the ReportViewer control for Windows applications.
The type of control you are using determines where ReportViewer.exe should be run.
For ASP.NET applications, run ReportViewer.exe on the Web server that hosts your application.
For Windows Forms applications, include the controls as an application prerequisite so that they are installed automatically with your application. You can use the bootstrapping application to automate this step:
Open the project properties page.
Click Publish, and then click Prerequisites.
Select Microsoft Visual Studio 2005 Report Viewer, and then click OK.
Publish the application.
During application installation, a check is performed on the local computer to see if ReportViewer is already installed. If it is not installed, the Setup program will install it.
Deploying Localized Versions of ReportViewer Controls
The ReportViewer control includes language packs for eight languages: Chinese-Simplified, Chinese-Traditional, French, German, Italian, Japanese, Korean, and Spanish. To use a localized version of the control, you must do the following:
Navigate to the folder that contains the language pack you want to use. Language pack folders are located at <drive>:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ReportViewer\<lang>.
To use other languages in a ReportViewer control, you can implement the Microsoft.Reporting.WebForms.IReportViewerMessages or the Microsoft.Reporting.WinForms.IReportViewerMessages interface to create tooltips and other user interface text in a specific language.
Detecting Browser Language and Culture Settings
If you are using the ReportViewer Web server control to host reports in a browser application, be sure to set the thread culture if you want to provide a user interface that matches the browser language and culture settings. ASP.NET does not set the thread culture based on the header information provided by the client. To match your application to the culture settings of the browser, you can set System.Threading.Thread.CurrentCulture and System.Threading.Thread.CurrentUICulture in your application code. For more information about how to work with culture settings in your application, see System.Globalization.CultureInfo.
Deployment Considerations for the Report Viewer Web Server Control
Deploying an ASP.NET application in a Web farm requires additional configuration to ensure that view state is maintained across the farm. If you are deploying the ReportViewer Web server control in a Web farm environment, you should specify the machineKey element in your application's Web.config file. For more information, see Web.config Settings for ReportViewer.
Reports that are processed in the ReportViewer Web server control have varying browser requirements. Browser compatibility issues can affect the availability of some kinds of report functionality. For more information, see Browser Support for ReportViewer Web Server Controls.
Unless you are dynamically generating client report definition (.rdlc) files at run time, reports that are processed locally are stored on the file system as .rdlc files and must ship with your application. The files can be installed on the disk drive, or compiled into the application executable.
Reports that are processed on a remote server are stored on a Microsoft SQL Server 2005 Reporting Services report server. There are no report files to include in your application because the reports are processed remotely and do not exist on the local system. To deploy reports that are published on a report server, you must provide ongoing access to a report server and ensure that application users are authorized to view reports on that server. Deploying server reports requires an understanding of the authentication extension used by the report server and the role-based authorization model that provides access to content and operations. For more information, see Deployment Considerations for Server Reports.