1

我在 VS2013 中有一个 winforms 应用程序

它运行 RDLC 报告和 Razor View 报告(从我们的网络应用程序中提取)

在我的 w7 盒子上,两种类型的报告都可以工作......

在服务器 2012 R2 RDLC 报告失败,深入 CLR,并给出以下错误:(但 Razor 视图 -> pdf via Rotativa 工作正常)

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: EFRG3G.exe
  Application Version:  3.1.16.0
  Application Timestamp:    53dc0cb7
  Fault Module Name:    clr.dll
  Fault Module Version: 4.0.30319.34014
  Fault Module Timestamp:   52e0b86c
  Exception Code:   c0000005
  Exception Offset: 0000000000003150
  OS Version:   6.3.9600.2.0.0.400.8
  Locale ID:    1033
  Additional Information 1: 372e
  Additional Information 2: 372ebc0e88d0905b1dfc62799213ffc9

附加信息 3:0f90 附加信息 4:0f90fe4c558cb8bf2158eb0f66bc20e2

如果我在远程调试器中运行它,我会得到更多信息:

Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in '\\jcdc-d-web-003\d$\WinForm\EFRG3G\EFRG3G.exe'.

Additional information: The runtime has encountered a fatal error. The address of the error was at 0x95ab3150, on thread 0x42fc. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

当我尝试像这样呈现 RLDC 报告时,它就发生了:

LocalReport localViewer =
                new LocalReport
                    {
                        EnableExternalImages = true,
                        ReportEmbeddedResource =
                            "EFRG3G.Reporting.RDLC." + reportRenderParameters.ReportFileName
                    };
         localViewer.DataSources.Add(reportRenderParameters.ReportDataSource);

           // add parameters that rdlc needs
            if (reportRenderParameters.ReportParameters.Count != 0)
                localViewer.SetParameters(reportRenderParameters.ReportParameters);

           // setup subreports
            if (reportRenderParameters.SubReportsDataSources.Count != 0)
            {
                foreach (ReportDataSource reportDataSource in reportRenderParameters.SubReportsDataSources)
                {
                    localViewer.DataSources.Add(reportDataSource);
                }
                localViewer.SubreportProcessing += SetSubReportDataSource;
            }

            Byte[] byteArray = null;

            byteArray = localViewer.Render(  // it blows up right here!!!
                reportRenderParameters.ReportType.ToString( "g" ), "",
                out mimeType,
                out encoding,
                out fileExtension,
                out streamids,
                out warnings );

相同的代码适用于 vs2008、vs2010

我认为它是缺少报告 pre req,没有安装在 2102 服务器上,所以我安装了这个:

Microsoft.ReportViewer 2012

这需要安装这个:

Microsoft® SQL Server® 2012 的 Microsoft® System CLR 类型

但它仍然无法正常工作......

要在 Server 2012 R2 上查看 vs2013 编译的 RDLC,还需要什么?

如果不是缺少先决条件,还有什么可能仅在 Svr 2012 R2 上导致此错误?

4

1 回答 1

0

想通了,原来我不需要上面的安装程序(2012,2008)...

我所需要的只是 2010 报告查看器发行包。我在 vs2010 中构建了报告,所以这是有道理的。

在此处获取 2010 Report Viewer Distro 软件包

您可以安装多个版本的发行版,但我删除了上面的两个,因为查看器是 2012,而 clr 类型是 2008...

是的,我尝试删除 2008 clr 类型并安装了 2012 clr 类型,但这没有用...

万一有人在这里需要它们是 2012 clr 类型(x86 或 x64)你进入下载并选择你想要的特定包

在此处获取 2012 clr 类型

在此处获取 2012 ReportViewer 发行版

于 2014-08-05T16:01:33.367 回答