在CrystalReport中分配DataSource时发生FileNotFoundException [英] FileNotFoundException occured while assign DataSource in CrystalReport

查看:226
本文介绍了在CrystalReport中分配DataSource时发生FileNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在报表中分配数据源时抛出System.IO.FileNotFoundException execex。
我使用visual studio 2013,C#4.5,WinForm应用程序。我已经为visual studio 13安装了水晶报告。

System.IO.FileNotFoundException execption thrown while assigning data source in report. I am using visual studio 2013, C# 4.5, WinForm application. I have installed crystal report for 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)命令抛出的错误。

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

I think this error is version specific error.

异常详细信息:

在mscorlib.dll中出现类型为System.IO.FileNotFoundException的未处理异常

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

其他信息:无法加载文件或程序集
'file:/// C:\Program Files\SAP BusinessObjects \Crystal Reports for .NET
Framework 4.0 \Common \SAP BusinessObjects Enterprise XI
4.0 \win32_x86 \dotnet1 \crdb_adoplus.dll'或其中一个依赖项。系统找不到指定的文件。

Additional information: Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.


推荐答案

在您的配置中添加以下部分后再试:

Try again after adding below section in your config:

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

这篇关于在CrystalReport中分配DataSource时发生FileNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆