【发布时间】:2019-10-26 11:34:25
【问题描述】:
我有一个打印类(名为 prinBill.cs)
using Tes4._3_Tier.DTO;
using System.Collections.Generic;
namespace Tes4.GUI.PrintBill
{
public partial class printBill : DevExpress.XtraReports.UI.XtraReport
{
public printBill()
{
InitializeComponent();
}
public void InitData(int patient_id, int bill_id, string name_pa, string add, string dob, string sym, string treat, string gender, float Sum,List<bill_ItemDTO> data)
{
bill_ID.Value = bill_id;
patienntID.Value = patient_id;
patientNName.Value = name_pa;
patientAdd.Value = add;
patientTreat.Value = treat;
patienSym.Value = sym;
patientDOB.Value = dob;
Total.Value = Sum;
patientGender.Value = gender;
objectDataSource1.DataSource = data;
}
}
}
我不知道我的代码在重建后到底发生了什么(我上次运行良好)。这是我在 printBill.Designer.cs(this 参数)中遇到错误的代码
this.components = new System.ComponentModel.Container();
this.InitializeComponent();
DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager1 = new DevExpress.XtraSplashScreen.SplashScreenManager(this, null, true, true);
我搜索了一些主题,但它根本没有帮助我。非常感谢您的帮助。
【问题讨论】:
-
XtraReport不继承自System.Windows.Form,因此任何从XtraReport继承的实例都不能转换为System.Windows.Form(就像我让你使用胡萝卜作为信用卡,没有地方会接受)。 -
link,我只是按照本教程进行操作。我上次调试真的很好,但是下次就出错了。很抱歉向您询问解决方案。
-
我在教程中没有看到您遇到问题的那一行。
-
@LắcLê,请尝试理解 John cmets,您正在尝试从 Windows 窗体继承 XtraReport。 Xtraprint 的 DevExpress 网站有很多示例。请在您的计算机中检查 DevExpress 演示中心 Exe,它与您的 devexpress 安装一起安装。如果不是请在您的系统中安装相关版本并尝试。
-
我明白约翰的意思。 @John,printBill.designer 的代码是自动生成的。
标签: c# winforms devexpress report