1

我尝试将 ReportViewer 添加到 web.config,因此我不必在每个页面上单独添加它,但它不起作用。

我将它添加到程序集中:

<assemblies>
    <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"/>
</assemblies>

我还添加了控件:

<controls>
    <add tagPrefix="RSWEB" namespace="Microsoft.ReportViewer.WebForms" assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</controls>

在我的网页上,我有:

<RSWEB:ReportViewer ID="MyRV" runat="server">
    <ServerReport ReportPath="/my_webpage_path" 
         ReportServerUrl="http://my_server/my_report" />
</RSWEB:ReportViewer>

我得到的错误是:

Unknown server tag 'RSWEB:ReportViewer'.
4

1 回答 1

2

弄清楚了。控制标签应该是这样的:

<controls>
    <add tagPrefix="RSWEB" namespace="Microsoft.Reporting.WebForms" assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</controls>
于 2012-11-28T13:29:51.337 回答