Var denne side nyttig?
Din feedback på dette indhold er vigtigt. Giv os din mening.
Mere feedback?
1500 tegn tilbage
Eksportér (0) Udskriv
Udvid alt
EN
Dette indhold er ikke tilgængeligt på dit sprog, men her er den engelske version.

Use ReportViewer in a Web Site Hosted in Azure

Updated: December 16, 2014

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

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

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

Review the “General recommendation and best practices” section in SQL Server Business Intelligence in Azure Virtual Machines.

ImportantImportant
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 2012 RUNTIME to use the ReportViewer runtime features.

noteNote
ReportViewer configured in local processing mode is not supported in Microsoft Azure.

Review the white paper Reporting Services report viewer control and Microsoft Azure virtual machine based report servers.

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, Microsoft 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.

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

  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.

  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.

  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.

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 information on authentication, see the white paper Reporting Services report viewer control and Microsoft Azure virtual machine based report servers.

For instructions on publishing an ASP.NET Web application to Azure, see How to: Migrate and Publish a Web Application to an Azure Cloud Service from Visual Studio and Get started with Web Apps and ASP.NET.

ImportantImportant
If the Add Azure Deployment Project or Add Azure Cloud Service Project command does not appear in the shortcut menu in Solution Explorer, you may need to change the Target framework for the project to .NET Framework 4.

The two commands provide essentially the same functionality. One or the other command will appear in the shortcut menu depending on which version of the Microsoft Azure SDK you have installed.

Vis:
© 2015 Microsoft