【问题标题】:"CrystalDecisions.Windows.Forms.ReportDocuments' does not contain a definition for 'Load'" error while loading ReportDocuments加载 ReportDocuments 时出现“CrystalDecisions.Windows.Forms.ReportDocuments”不包含“加载”的定义”错误
【发布时间】:2016-09-22 14:51:55
【问题描述】:
ReportDocuments Rdoc = new ReportDocuments();
string Apppath = Application.StartupPath;
string Reppath = @"reports\Report.rpt";
string fullPath = Path.Combine(Apppath, Reppath);
Rdoc.Load(fullPath);
crystalReportViewer1.ReportSource = Rdoc;
crystalReportViewer1.Refresh();

这段代码给出了这个错误

Error1'CrystalDecisions.Windows.Forms.ReportDocuments' 没有 包含“加载”的定义并且没有扩展方法“加载” 接受类型的第一个参数 'CrystalDecisions.Windows.Forms.ReportDocuments' 可以找到(是 您缺少 using 指令或程序集 参考?) C:\Users\ACS\documents\visual studio 2013\Projects\CrystalReportDemo\CrystalReportDemo\Form1.cs

在这一行

Rdoc.Load(fullPath);

请帮我解决这个问题。

【问题讨论】:

  • ReportDocuments 不是有效的 Crystal Report 类;使用新的 CrystalDecisions.CrystalReports.Engine.ReportDocument()?

标签: c# crystal-reports


【解决方案1】:

将 ReportDocuments 更改为 ReportDocument。

【讨论】:

  • 谢谢先生,它现在正在工作
猜你喜欢
  • 2016-09-05
  • 2016-09-11
  • 2015-06-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-07
  • 2017-09-19
  • 2017-10-07
相关资源
最近更新 更多