本文介绍了在Visual Studio 2019中的客户端计算机中,Crystal Report SP26 SetDataSource()方法失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2019和Crystal Report Service Pack 26.我的代码将数据读取到ADO.NET数据集中,并将这些数据设置为报告的数据源。在Visual Basic.Net中是这样的:

​I'm working on Visual Studio 2019 and Crystal Report Service Pack 26. My code read data into ADO.NET dataset and I set those datases as datasourse of my reports. something like this in Visual Basic.Net:

    Dim ds1 As New DataSet1()

    Dim myRep As New CrystalReport1
    taAccArticleFields_TBL.Fill(ds1.AccArticleFields_TBL)
    myRep.SetDataSource(ds1)
    crvReport.ReportSource = myRep

当我通过VS运行程序时,一切都很好,并且报告显示没有错误。但是,当我想在安装了CR26运行时的另一台计算机上运行程序时,在调用SetDataSource方法获取报告时出现错误,如下所示:

When I run program through VS all is good and reports show without error. But when I want to run my program on another computer which only has CR26 runtime installed, it gives an error on calling SetDataSource method for report as below:

System.Runtime.InteropServices.COMException (0x800002CD): Error in File temp_04020c6d-5b84-40d9-8558-bf87b6d5e554 4840_5464_{1C1D3ACF-9F25-45E2-B0EE-BB77F1DDA6B6}.rpt: Failed to load database information.
at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.ReplaceConnection(Object oldConnection, Object newConnection, Object parameterFields, Object crDBOptionUseDefault)
at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)

我遇到这与我编写的任何程序有关。有人有解决这个问题的想法吗?

I encounter this with any program I write. Does anyone have idea to solve this?

推荐答案

感谢@Julie,我发现缺少的文件需要使用Crystal运行ADO.Net报告。报告SP26。
不幸的是,在安装SP26运行时时,它不会复制需要Crystal Report从ADO.Net数据集中加载数据的 crdb_adoplus.dll 文件。

Thanks to @Julie I found missing file need to run ADO.Net report using Crystal Report SP26.Unfortunately, When you install SP26 run-time it doesn't copy crdb_adoplus.dll file which need to Crystal Report to load data from ADO.Net dataset.

这是解决方案:


  • 在32位操作系统中:您必须从以下文件夹将crdb_adoplus.dll文件从开发人员计算机复制到客户端计算机:

  • In 32bit operating systems: you have to copy crdb_adoplus.dll file from developer computer to client machine from following folder:

C:\Program Files(x86)\SAP BusinessObjects\Crystal Reports适用于.NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86

在64位操作系统中:从以下文件夹将crdb_adoplus.dll文件从开发人员计算机复制到客户端计算机:

In 64bit operating systems: you have to copy crdb_adoplus.dll file from developer computer to client machine from following folder:

C:\Program Files(x86)\SAP BusinessObjects\Crystal Reports for。 NET Framework 4.0-常见-SAP BusinessObjects Enterprise XI 4.0-win64_x64

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64

它可以正常工作。我希望SAP在以后的Service Pack中解决此问题。

And it work correctly. I hope SAP resolve this problem in the future service pack.

这篇关于在Visual Studio 2019中的客户端计算机中,Crystal Report SP26 SetDataSource()方法失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 05:07