Crystal Report 无法为 64 位机器打开

Crystal Report is not opening for 64 bit machines(Crystal Report 无法为 64 位机器打开)

本文介绍了Crystal Report 无法为 64 位机器打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的报告在 32 位计算机上运行良好,但无法在 64 位计算机上打开.需要 64 位,因为在其中一个屏幕上加载数据会导致内存问题 - 所以它不能在 32 位上工作.

My reports work fine on a 32 bit machine but won't open on 64 bit. 64 bit is required because loading data on one of the screen causes a memory issue - so it can't work on 32 bit.

  1. Windows 10 64 位
  2. 已安装 Crystal Reports 尝试安装 13.0.20(latest) 并重新启动 PC,但没有成功.
  3. Application Target Framework 4.6.2(我什至在 4.0 上试过但同样的错误)
  4. 使用 Visual Studio 2017 社区(VS 2015 试用)
  5. 平台 x64(不是 AnyCPU)
  6. 正在通过传递 DataTable 生成报告,没有活动报告中的连接或 ConnectionString
  7. 错误信息

编辑#1

  1. Web.config 包括 useLegacyV2RuntimeActivationPolicy="true"
  2. x86 和 x64 中的数据表是相同的

编辑#2

显示报表的源代码是

CrystalDecisions.CrystalReports.Engine.ReportClass c = new 
    CrystalDecisions.CrystalReports.Engine.ReportClass();

c.FileName = System.IO.Path.Combine(Root_Path, 
    "Reports", "Prod", mFileName);

c.Load();
c.SetDataSource(dt);  // dt => DataTable
c.SetParameterValue("prmSystemDate", Current_Date);

frmReportViewer v = new frmReportViewer();
v.ReportClass = c;
v.Show();

而frmReportViewer FormLoad是

And frmReportViewer FormLoad is

private void frmReportViewer_Load(object sender, EventArgs e)
        {
            CRViewer.ReportSource =  ReportClass;
            //CRViewer => 
            //CrystalDecisions.Windows.Forms.CrystalReportViewer
        }

我是不是哪里出错了?

编辑#3

x86 和 x64 上的 DataTable 是相同的.(将数据表保存在xml中,两个文件完全相同).

DataTable on x86 and x64 are same. (saved the datatables in xml and both files are exactly the same).

进程监视器显示我的程序对以下文件执行 CreateFile 操作

Process Monitor shows that my program performs CreateFile operation on following files

C:WINDOWSMicrosoft.NetassemblyGAC_64CrystalDecisions.Webv4.0_13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dllC:WINDOWSMicrosoft.NetassemblyGAC_MSILCrystalDecisions.Webv4.0_13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dllC:WINDOWSMicrosoft.NetassemblyGACCrystalDecisions.Webv4.0_13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dllC:WINDOWSassemblyGAC_64CrystalDecisions.Web13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dll

C:WINDOWSMicrosoft.NetassemblyGAC_64CrystalDecisions.Webv4.0_13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dll C:WINDOWSMicrosoft.NetassemblyGAC_MSILCrystalDecisions.Webv4.0_13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dll C:WINDOWSMicrosoft.NetassemblyGACCrystalDecisions.Webv4.0_13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dll C:WINDOWSassemblyGAC_64CrystalDecisions.Web13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dll

所有失败,PATH NOT FOUND 结果.它成功了

All fails with PATH NOT FOUND Result. It succeeds on

C:WindowsassemblyGAC_MSILCrystalDecisions.Web13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dll

C:WindowsassemblyGAC_MSILCrystalDecisions.Web13.0.2000.0__692fbea5521e1304CrystalDecisions.Web.dll

然后两个BUFFER OVERFLOW发生在同一个文件上.

and then two BUFFER OVERFLOW occurs on this same file.

它只发生在 x64 上.x86上没有与CrystalDecisions.Web.dll相关的操作.

It only happens on x64. There is no operation related with CrystalDecisions.Web.dll on x86.

它表示什么?

推荐答案

这可能不是一个完整的答案",因为您仍在进行故障排除并寻求帮助,但评论太长了.值得注意的是,此时 SAP 不支持 VS 2017,并且有可能与此有关,但我什至在 VS 2010 中也看到过类似的消息,所以这里......

This might not be an complete "answer" since you're still troubleshooting, and asking for help, but its too long for a comment. Of note, at this time SAP does not support VS 2017, and there is possibility that has something to do with this, but I've seen similar messages even back in VS 2010 so here goes...

简短的猜测将其添加到您的 app.config 文件中:

Short guess add this to your app.config file:

<startup useLegacyV2RuntimeActivationPolicy="true"></startup>

或更具体地针对 .NET,例如:

or more specifically target .NET like:

<startup useLegacyV2RuntimeActivationPolicy="true">
 <supportedRuntime version="v4.0"/>
</startup>

更长的故障排除思考过程.错误消息通常表明 DataSet(在本例中为 DataTable)在报表对象中使用时未设置.您可以在此处放置一个断点,看看是否为真(使用 SetDataSource 的地方).

Longer troubleshooting thought process. The error message usually would indicate that the DataSet (DataTable in this case) is not set at the time it is used in the report object. You could put a breakpoint there and see if this is true (where SetDataSource is used).

这可能是我在这里错了,即使在那个时候也有一个正确设置的 DataSet,并且问题在查看器中稍后发生.我很久以前就遇到过这样的问题,如果没有记错的话,这就是我寻找解决方案的途径.

It might be that I am wrong here and there is a properly set DataSet even at that point, and the issue happens a little later in the viewer. I ran into issues like this a long time ago and if memory serves this was the route I took to track down a solution.

基本上我的问题是 EXE 在查看器中使用 ADO 对象的方式.在不了解您的项目的所有信息的情况下,我将开始沿着这条路径进行调试.

Basically my problem was the way the EXE was using ADO objects in the viewer. Without knowing everything about your project I would start down this path to debug.

其他问题是它在 VS 2015 中是否有效?它曾经在 X64 中工作过并停止工作吗?它是否适用于其他操作,例如您可以以编程方式访问报表对象,并且它只是在查看器中出错?

Other questions would be does it work in VS 2015? Did it ever work in X64 and stop working? Does it work for other operations, like can you access the report object programatically, and it's only erring in viewer?

这篇关于Crystal Report 无法为 64 位机器打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Crystal Report 无法为 64 位机器打开