在ASP.NET C#中生成报告

时间:2018-06-29 14:02:04

标签: c# asp.net webforms reportviewer

我正在尝试生成报告,但未显示,并且在html中它向我显示以下错误消息。

Error Creating Control - ReportViewer1Failed to create designer 'Microsoft.Reporting.WebForms.ReportViewer, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'

html代码

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Report</title>
</head>
<body>
    <form id="form1" runat="server">
        <h1 style="font-family: &quot;Austin 11pt&quot;; text-align: center">Returns Report</h1>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="600">
    </rsweb:ReportViewer>
    </form>
</body>
</html>

Web配置

 <assemblies>
    <add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
    <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
    <add assembly="Microsoft.ReportViewer.ProcessingObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
    <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />

1 个答案:

答案 0 :(得分:0)

请看看Reference Check this aswell

  1. 下载并安装了Report Viewer 2010版本。
  2. 从以下位置添加Microsoft.ReportViewer.WebForms.DLL程序集文件 class Worker extends Model { public function workplace() { return $this->morphTo(); } } class Company extends Model { public function workers() { return $this->morphMany('App\Worker', 'workplace'); } } class Branch extends Model { public function workers() { return $this->morphMany('App\Worker', 'workplace'); } }
  3. 最后将以下行添加到.ascx文件。 C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91