首页 > 解决方案 > ReportDocument 类失败

问题描述

我目前在我的应用程序中使用 ReportDocument 类时遇到问题。如果您能帮助我找出解决方案,我将不胜感激;这是我的代码:

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System;
using System.Windows.Forms;
using CrystalDecisions.ReportAppServer.ClientDoc;

namespace CrystalReportApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ReportDocument rptDoc = new ReportDocument();
            rptDoc.Load(@"C:\Lading.rpt");
            MessageBox.Show(rptDoc.FileName);
        }

    }
}

每次运行代码时发生的异常是:System.IO.FileNotFoundException:'无法加载文件或程序集'CrystalDecisions.ReportAppServer.ClientDoc,版本 = 11.0.3300.0,文化 = 中性,PublicKeyToken = 692fbea5521e1304'或其之一依赖关系。该系统找不到指定的文件。'

注意:我已经添加了所需的参考资料,如下所示: 在此处输入图像描述

标签: c#crystal-reports

解决方案


您是否在计算机上安装了“SAP Crystal Reports Runtime For .NET 4.0”32 位?


推荐阅读