2

操作系统:Windows7 64bit

Visual Studio 2010 (C#):
解决方案资源管理器中的属性:
目标框架:.NET Framework 4

我的代码:

ReportDocument rd = new ReportDocument();//Line1
rd.FileName = "rpt1.rpt";//Line2
rd.SetDataSource(getinfo());//Line3
crystalReportViewer1.ReportSource = rd;//Line4
crystalReportViewer1.Show();//Line5

第3行
错误:加载文件错误(文件存在):错误图片:
http ://s2.picofile.com/file/7873257090/SetDataSource.png

4

1 回答 1

0

打开 app.config 并添加代码:

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
  <generatePublisherEvidence enabled="false"/>
</runtime>
于 2013-08-28T12:55:10.840 回答