VS2010を使用して、 Asp.NetWebフォームが1つしかないMVC2Webロールを1つ使用して新しいAzureプロジェクトを開始しました。
問題
ReportViewerがロードされ続け、バージョンで正しく動作しないという問題が発生しています10.0
か?バージョン9.0
は魅力のように機能していますが、この2つの違いはわかりません。
Internet Explorerは点滅し続けますが、Chromeの「インスペクター」を使用すると、次のエラーが発生することがわかります。
<h2>
Report Viewer Configuration Error
</h2><p>The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.web/httpHandlers section of the web.config file, or add <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.webServer/handlers section for Internet Information Services 7 or later.</p>
私がこれまでにしたこと
(複数のサイトでアドバイスされているように)ドラッグアンドドロップは1つだけScriptManager
ですReportViewer
。
プロジェクト参照は自動的に作成され、web.configのアセンブリは問題ないように見えます。
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
次のステップは、ハンドラーをweb.configに追加することです。
<system.web>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler,
Microsoft.ReportViewer.WebForms, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"
/>
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<!-- added handler for reporting -->
<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
</system.webServer>
その後、<script runat="server"></script>
簡単にデバッグできるように、内にレポートプロパティを設定しました。
私のウェブフォーム
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="MvcWebRole1.Reports.Report" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
ReportViewer1.ProcessingMode = ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new Uri("https://XXXX.reporting.windows.net/ReportServer");
ReportViewer1.ServerReport.ReportPath = "/MyReport.rdl";
ReportViewer1.ServerReport.ReportServerCredentials = new Credentials();
}
public class Credentials : IReportServerConnection
{
public IEnumerable<System.Net.Cookie> Cookies { get { return null; } }
public Uri ReportServerUrl { get { return new Uri("https://XXXX.reporting.windows.net/ReportServer"); } }
public int Timeout { get { return 60000; } }
public bool GetFormsCredentials(out System.Net.Cookie authCookie, out string userName, out string password, out string authority)
{
authCookie = null;
userName = "MyUserName";
password = "MyPassword";
authority = "XXXX.reporting.windows.net";
return true;
}
public System.Security.Principal.WindowsIdentity ImpersonationUser { get { return null; } }
public System.Net.ICredentials NetworkCredentials { get { return null; } }
}
</script>
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server">
</rsweb:ReportViewer>
</div>
</form>
</body>
</html>
次は何ですか?
誰かが私がこの問題を解決する方法を知っていますか!?
だから、これまでのところ:
- レポートバージョン10.0
- Web.configは、アセンブリとハンドラーでも問題ないように見えます
- VisualStudioデバッガーを試しました
- IISExpressを試しました
- Windows Azureプロジェクト(エミュレーター付き)を試しました