加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 在CrystalReport中分配DataSource时发生FileNotFoundExcep

发布时间:2020-12-16 02:01:52 所属栏目:百科 来源:网络整理
导读:在报表中分配数据源时抛出System.IO.FileNotFoundException execption. 我正在使用visual studio 2013,C#4.5,WinForm应用程序.我为visual studio 13安装了水晶报告. 这是代码 DataSet ds = new DataSet(); ds.Tables.Add(new DataTable("administration_Cash
在报表中分配数据源时抛出System.IO.FileNotFoundException execption.
我正在使用visual studio 2013,C#4.5,WinForm应用程序.我为visual studio 13安装了水晶报告.

这是代码

DataSet ds = new DataSet();
    ds.Tables.Add(new DataTable("administration_CashDeskManager_Reports_ReportDataBusinessObject"));
    ds.Tables.Add(new DataTable("administration_CashDeskManager_Reports_ReportDataDetailBusinessObject"));

    Reports.CrystalReport.rptCashDeskTransactionLog Report = new Reports.CrystalReport.rptCashDeskTransactionLog();
    Report.SetDataSource(ds);
    crViewer.ReportSource = Report;

Report.SetDataSource(ds)命令抛出错误.

我认为此错误是特定于版本的错误.

例外细节:

An unhandled exception of type ‘System.IO.FileNotFoundException’
occurred in mscorlib.dll

Additional information: Could not load file or assembly
‘file:///C:Program FilesSAP BusinessObjectsCrystal Reports for .NET
Framework 4.0CommonSAP BusinessObjects Enterprise XI
4.0win32_x86dotnet1crdb_adoplus.dll’ or one of its dependencies. The system cannot find the file specified.

解决方法

在配置中添加以下部分后再试一次:

<startup uselegacyv2runtimeactivationpolicy="true">
  <supportedruntime version="v4.0" />
</startup>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读