[英]SSRS report viewer in MVC Error (ReportViewerForMVC)
I am trying to include SSRS (.rdl) in my MVC application. 我试图在我的MVC应用程序中包含SSRS(.rdl)。 It always give me error: 它总是给我错误:
The WebResource.axd handler must be registered in the configuration to process this request.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<httpHandlers>
<add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
</httpHandlers>
</system.web>
</configuration>
I have installed 我已经安装
Microsoft.Report.Viewer v. 11.0.0
Microsoft.ReportingServices.ReportViewerControl.WebForms 14.1000.523
ReportViewerForMVC
Here is my code: 这是我的代码:
ReportViewer reportViewer = new ReportViewer();
reportViewer.ProcessingMode = ProcessingMode.Local;
reportViewer.SizeToReportContent = true;
reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Areas\Daleel.HRIS\Reports\DailyAttendance.rdl";
reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", data));
ViewBag.ReportViewer = reportViewer;
View: 视图:
@using ReportViewerForMvc;
<div class="ui attached very relaxed segment">
<div class="ui container">
@Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer)
</div>
</div>
WEbconfig: WEbconfig:
<system.web>
<trace enabled="false" />
<httpRuntime targetFramework="4.6" waitChangeNotification="0" maxWaitChangeNotification="0" maxRequestLength="1048576" />
<compilation>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</buildProviders>
<assemblies>
<add assembly="Microsoft.ReportViewer.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
<add assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</assemblies>
</compilation>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers>
<clear />
<add name="StaticFile" path="*" verb="*" type="" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="" resourceType="Either" requireAccess="Read" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
Can anyone help me fixing this? 谁能帮我解决这个问题?
Have you done what the error message is asking you? 您是否已完成错误消息的要求? Adding the handler in the web.config 在web.config中添加处理程序
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.