Exporter (0) Imprimer
Développer tout

Use ReportViewer in a Web Site Hosted in Azure

Mis à jour: avril 2014

You can build a Windows Azure Web site with the Visual Studio ReportViewer control that displays a report stored on an Windows Azure Virtual Machine. The ReportViewer control is in a Web application that you build using the ASP.NET Web application template.

The ASP.NET MVC Web Application templates do not support the ReportViewer control.

To incorporate ReportViewer into your Windows Azure Web site, you need to complete the following tasks.

Review the prerequisites described in Getting Started Guide for Application Developers (SQL Reporting). You must have published reports on a SQL Reporting report server.

ReportViewer controls are shipped with Visual Studio, Standard Edition or above. If you are using the Web Developer Express Edition, you must install the Microsoft Report Viewer Redistributable Package to use the ReportViewer runtime features.

ReportViewer configured in local processing mode is not supported in Windows Azure.

When you host your ASP.NET application on-premise, the ReportViewer assemblies are usually installed directly in the global assembly cache (GAC) of the IIS server during Visual Studio installation, and can be accessed directly by the application. However, when you host your ASP.NET application in the cloud, Windows Azure does not allow anything to be installed into the GAC, so you must make sure the ReportViewer assemblies are available locally for your application. You can do this by adding references to them in your project and configure them to be copied locally.

In remote processing mode, the ReportViewer control uses the following assemblies:

  • Microsoft.ReportViewer.WebForms.dll Contains the ReportViewer code, which you need to use ReportViewer in your page. A reference for this assembly is added to your project when you drop a ReportViewer control onto an ASP.NET page in your project.

  • Microsoft.ReportViewer.Common.dll Contains classes used by the ReportViewer control at run time. It is not automatically added to your project.

To add a reference to Microsoft.ReportViewer.Common

  • Right-click your project’s References node and select Add Reference, select the assembly in the .NET tab, and click OK.

To make the assemblies locally accessible by your ASP.NET application

  1. In the References folder, click the Microsoft.ReportViewer.Common assembly so that its properties appear in the Properties pane.

  2. In the Properties pane, set Copy Local to True.

  3. Repeat steps 1 and 2 for Microsoft.ReportViewer.WebForms.

To get ReportViewer Language Pack

  1. Install the appropriate Microsoft Report Viewer 2012 Runtime redistributable package from Microsoft Download Center (http://go.microsoft.com/fwlink/?LinkId=317386).

  2. Select the language from the dropdown list and the page gets redirected to the corresponding download center page.

  3. Click Download to start the download of ReportViewerLP.exe.

  4. After you download ReportViewerLP.exe, click Run to install immediately, or click Save to save it to your computer. If you click Save, remember the name of the folder where you save the file.

  5. Locate the folder where you saved the file. Right-click ReportViewerLP.exe, click Run as administrator, and then click Yes.

  6. After running ReportViewerLP.exe, you will see the c:\windows\assembly has the resource files Microsoft.ReportViewer.Webforms.Resources and Microsoft.ReportViewer.Common.Resources.

To configure for localized ReportViewer control

  1. Download and install the Microsoft Report Viewer 2012 Runtime redistributable package by following the above specified instructions.

  2. Create <language> folder in the project and copy the associated resource assembly files there. The resource assembly files to be copied are: Microsoft.ReportViewer.Webforms.Resources.dll and Microsoft.ReportViewer.Common.Resources.dll.

    Select the resource assembly files, and in the Properties pane, set Copy to Output Directory to “Copy always”.

  3. Set the Culture & UICulture for the web project. For more information about how to set the Culture and UI Culture for an ASP.NET Web page, see How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization (http://go.microsoft.com/fwlink/?LinkId=237461).

The ReportViewer needs to use proper credentials to authenticate with the report server, and the credentials must be authorized by the report server to access the reports you want. For more information, follow the steps in Authentication to SQL Reporting in Getting Started Guide for Application Developers (SQL Reporting).

Ajouts de la communauté

© 2014 Microsoft