一开始
必须安装'Microsoft.Report.Viewer'、'ReportViewer.WebForms'、'Microsoft.ReportViewer.WinForms'和'Microsoft.SqlServer.Types' 的nuget包
https://www.nuget.org/packages/ReportViewer.WebForms/
https://www.nuget.org/packages/Microsoft.ReportViewer.WinForms/
https://www.nuget.org/packages/Microsoft.Report.Viewer/
https://www.nuget.org/packages/Microsoft.SqlServer.Types/
然后应该检查 web.config 的一些标签
<system.web>
<compilation debug="true" targetFramework="4.5">
<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>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" validate="false" />
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<system.webServer>
<handlers>
<add name="ReportViewerWebControlHandler" verb="*" path="Reserved.ReportViewerWebControl.axd" preCondition="integratedMode" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
</handlers>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>