Uncaught Error: Sys.InvalidOperationException: 'DocMapUpdatePanelId' is not a property or an existing field when trying to run report

Uncaught Error: Sys.InvalidOperationException: 'DocMapUpdatePanelId' is not a property or an existing field when trying to run report

我的报告查看器有问题。我已经在我的机器上安装了 Reports Viewer 2015 Runtime,但每当我尝试 运行 报告时,我都会得到以下信息:

未捕获错误:Sys.InvalidOperationException:'DocMapUpdatePanelId' 不是 属性 或现有字段。

这就是所谓的报表查看器:

<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" AsyncRendering="true" SizeToReportContent="True" Width="100%" Height="500px"> </rsweb:ReportViewer>

在 aspx 页面的顶部,我有:

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

我的web.config是这样的:

 <system.web>

<compilation debug="true" targetFramework="4.5.2">
  <assemblies>
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
    <add assembly="Microsoft.ReportViewer.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
    <add assembly="Microsoft.ReportViewer.ProcessingObjectModel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
    <add assembly="Microsoft.ReportViewer.Design  , Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
  </assemblies>
  <buildProviders>
    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
  </buildProviders>
</compilation>
<httpHandlers>
  <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
  <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />
</httpHandlers>

也在system.webServer下面我有:

<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" resourceType="Unspecified" />
  <add name="Reserved-ReportViewerWebControl-axd" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler" resourceType="Unspecified" />

此时,我不确定如何解决这个问题。

谢谢

尝试在 system.webserver 部分的 web.config 中添加这个名为 ReportViewerWebControlHandlerReportViewer HTTP 处理程序(注意 resourceType 设置为 Unspecified) :

<system.webserver>
    <add name="ReportViewerWebControlHandler" 
         preCondition="integratedMode" verb="*"
         path="Reserved.ReportViewerWebControl.axd"
         type="Microsoft.Reporting.WebForms.HttpHandler"
         resourceType="Unspecified" />
</system.webserver>

如果您有多个 Microsoft.ReportViewer.WebForms 程序集引用,请坚持使用最新或可用的程序集引用(即 12.0)并删除重复引用。

参考:

ReportViewer gives JS error: 0x800a139e 'DocMapUpdatePanelId' is not a property or an existing field