我尝试将ReportViewer添加到web.config中,因此我不必单独在每个页面上添加它,但它不起作用。
我将它添加到Assemblies:
<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'.
答案 0 :(得分:1)
想出来。 controls标签应为:
<controls>
<add tagPrefix="RSWEB" namespace="Microsoft.Reporting.WebForms" assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</controls>