【问题标题】:SQL Server Reporting Services - error running a report (Azure web site deployment issue?)SQL Server Reporting Services - 运行报告时出错(Azure 网站部署问题?)
【发布时间】:2013-10-22 16:21:08
【问题描述】:

我有一个 ASP.NET MVC 前端,它列出了 SQL Azure Reporting Services 上的报告。用户选择要运行的报告,并且该报告被加载到另一个浏览器窗口中。问题是当报告在某些浏览器上运行时(例如 Win7 上的 IE10),所有显示的都是以下消息:

Method not found: 'Boolean Microsoft.ReportingServices.Common.DateTimeUtil.TryParseDateTime(System.String, System.IFormatProvider, System.DateTimeOffset ByRef, Boolean ByRef)'.

在 Win7 上使用 Chrome 报告“半途而废” - 我得到带有日期时间框和另一个下拉列表的顶部栏,当我单击“运行”按钮时,我得到报告导航栏,但没有报告正文.我没有收到上面的消息。

网站已发布到 Azure 网站。我引用了以下 DLL 并将 CopyLocal 设置为 true:

Microsoft.ReportViewer.Common
Microsoft.ReportViewer.WebForms
Microsoft.ReportViewer.DataVisualization
Microsoft.ReportViewer.ProcessingObjectModel

已发布的报告在我安装了 ReportViewer 2012 可再发行组件(控件版本 11)的开发机器上运行良好。

所以,问题:

我发布的网站还缺少哪些其他可再分发的 dll? 什么是 Microsoft.ReportingServices.Common? 'ByRef' 似乎暗示这是 VB - 这是客户端脚本组件吗?我需要在客户端计算机上安装什么东西才能查看报告吗?

【问题讨论】:

    标签: asp.net azure reporting-services


    【解决方案1】:

    同样的问题发生在部署后在 IE 和 Firefox 上找不到方法错误,而在本地运行时一切正常。

     Method not found: 'Boolean Microsoft.ReportingServices.Common.DateTimeUtil.TryParseDateTime(System.String, System.IFormatProvider, System.DateTimeOffset ByRef, Boolean ByRef)'.
    

    发生的情况是,在我们的本地 bin 文件中,Microsoft.ReportViewer dll 的版本比部署服务器更新。当部署服务器添加 dll 时,它从 GAC 中选择了与本地使用不同的版本。版本 11.0.2 而不是 11.0.33 导致未匹配。在本地计算机上将 dll 更新为相同版本后,它解决了该问题。有可能在您重新部署后使用了正确的 dll,从而解决了您的问题。

    要验证 bin 文件夹和部署文件夹中 dll 的版本,您只需在导航到包含 dll 的文件夹后使用简单的 power shell 脚本即可。

    dir *.dll | %{ $_.VersionInfo }
    

    【讨论】:

    • +1 用于识别它是版本号的“RELEASE”部分中的细微差异可能导致问题。我有两个不同的“11.x”发布版本,现在它们都是“11.0.3452.0”,我的测试环境部署再次工作。我使用@AaronSieb 的建议从 GAC 中提取了四个 DLL,并将它们添加到 Web 项目中并强制引用“COPY LOCAL”
    【解决方案2】:

    crackhaus's answer 为我指明了正确的方向。

    这是我遵循的完整步骤:

    1. 使用以下 PowerShell 命令检查 bin 文件夹中程序集的版本号:

      dir *.dll | %{ $_.VersionInfo }
      
    2. 发现其中一个 ReportViewer 程序集的版本号与其他两个不同。

    3. 我在本地 GAC 中检查了该 DLL 的版本号,发现 GAC DLL 与我的 bin 文件夹中的其他两个 DLL 的版本匹配。

      我使用Option 2 described here 来访问 GAC(基本上是:PowerShell to c:\WINDOWS\assembly\GAC_MSIL\\),以及上面的命令来检查版本号。

    4. 使用 PowerShell(copy-item 命令),我提取了 DLL,并将其放入站点的 BIN 文件夹中。

    【讨论】:

      【解决方案3】:

      转到 Nuget 并安装,从那里获得 Micorsoft.ReportViewer runtime 2012 和 ReportViewer.Common 10.0

      【讨论】:

        【解决方案4】:

        这已经解决了我的问题,虽然我不得不承认我不知道为什么......

        只需将 SizeToReportContent="true" 属性添加到 aspx 页面中的标签,例如:

        <rsweb:ReportViewer ID="ReportViewer1" runat="server" SizeToReportContent="true" Font-Names="Verdana" Font-Size="8pt" Height="100%" ProcessingMode="Remote" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%">
            <ServerReport />
        </rsweb:ReportViewer>
        

        神奇的是,这一切似乎都在起作用。

        【讨论】:

          【解决方案5】:

          我们遇到了同样的问题。我想补充一点,您需要将所有 4 个 dll 复制到服务器:

          Microsoft.ReportViewer.Common.dll
          Microsoft.ReportViewer.WebForms.dll
          Microsoft.ReportViewer.DataVisualization.dll
          Microsoft.ReportViewer.ProcessingObjectModel.dll
          

          【讨论】:

          • 并确保它们是完全相同的版本...“Major.Minor.Release.Build”我在两个 DLL“Microsoft.ReportViewer.DataVisualization”和“ Microsoft.ReportViewer.ProcessingObjectModel”,我遇到了这个问题。
          【解决方案6】:

          我们遇到了同样的问题。我们使用了可再发行组件中的 dll: http://www.microsoft.com/en-us/download/confirmation.aspx?id=35747

          【讨论】:

            【解决方案7】:

            我决定根据MSDN article 在服务器上安装 Microsoft System CLR Types for Microsoft SQL Server 2012Microsoft Report Viewer 2012 Runtime。之后,我从站点 bin 目录中删除了错误的程序集。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2011-11-01
              • 2018-12-22
              相关资源
              最近更新 更多