开发篇--让收据显示欠费金额
(效果图,黄色框内,即显示欠费的地方。除打印机边距,坐标大约是 x = 11.5cm,y = 1.5cm。 )
首先找到消费单的数据源代码:(在说明书的第四章 功能扩展-->二、如何修改打印报表?-->报表数据库(DataSet)-->消费单)
public static DataSet GetBill(long BillID)
{
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
OleDbCommand Comm = new OleDbCommand();
OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet("ds");
Comm.Parameters.Add("@BillID", OleDbType.BigInt);
Comm.Parameters["@BillID"].Value = BillID;
da.SelectCommand = Comm;
Comm.Connection = connection;
Comm.CommandText = @"Select * from Bill where BillID = @BillID";
da.Fill(ds, "Bill");
Comm.CommandText = @"Select * from BillItem where BillID = @BillID";
da.Fill(ds, "BillItem");
Comm.CommandText = @"Select Student.* from Student,Bill where Student.StudentID = Bill.StudentID and Bill.BillID = @BillID";
da.Fill(ds, "Student");
Comm.CommandText = @"Select StuClass.* from StuClass,BillItem where StuClass.StuClassID and StuClass.BillItemID = BillItem.BillItemID and BillItem.BillID=@BillID";
da.Fill(ds, "StuClass");
Comm.CommandText = @"Select Class.* from StuClass,BillItem,Class where StuClass.StuClassID and StuClass.BillItemID = BillItem.BillItemID and StuClass.ClassID = Class.ClassID and BillItem.BillID=@BillID";
da.Fill(ds, "Class");
return ds;
}
}
上面这段代码就是消费单/退货单的DateSet数据集,我们可以看到分别从Bill,BillItem,Student,StuClass,Class 五张数据表上调用数据,每张表的含义请查询数据库手册:http://www.mtcnsoft.com/help/swt2_db/,前面讲到学员欠费是针对账户级的,所以重点查看Student表,我们打开数据库手册Student表:Student 学员表
学员基础信息表。
字段
类型
说明
StudentID
Int
学员编号。
StudentName
VarChar
学员姓名。
PYSimple
VarChar
拼音简码。
Byname
VarChar
别名。
Appellation
VarChar
称呼。
Sex
Int
性别。(0女,1男)
StudentType
Int
学员类型。(0学生,1上班族)
Birthday
DateTime
出生日期。
SchoolID
Int
校区编号。
SchoolName
VarChar
校区名称。
Photo
VarBinary
相片。
ExistPhoto
Boolean
是否存在相片。
Password
VarChar
密码。
DateAndTime
DateTime
报名日期。
Tel
VarChar
电话。
MobileTel
VarChar
手机。
VarChar
电子信箱。
HomeAddress
VarChar
家庭地址。
PostCode
VarChar
邮编。
School
VarChar
学校。
Grade
VarChar
年级。
Class
VarChar
班级。
Company
VarChar
单位。
Headship
VarChar
职务。
IDcard
VarChar
身份证号。
SignInID
VarChar
ID卡号。
LastClassName
VarChar
最后加入的班级。
StuClassCount
Int
选班数量。
ConsultantID
Int
所属咨询员编号。
ConsultantName
VarChar
所属咨询员姓名。
MediaID
Int
媒体编号。
MediaName
VarChar
媒体名称。
Remark
VarChar
备注。
UserID
Int
录入者编号。
TrueName
VarChar
录入者姓名。
BillCount
Int
消费单数量。
ConsumedMoney
Currency
消费金额。
CreditMoney
Currency
欠费金额。
AvailableMoney
Currency
可用金额。
从上面表,我们可以看到CreditMoney字段表示欠费金额。找准了字段,我们就可以通过xsl语句读出这个值了。实际上asp.net中DataSet就是一种存储在内存中的XML文件。我们用这条语法操作它:<xsl:value-of select="ds/Student/CreditMoney" />,下一步就是采用文本标签给欠费字段定位。
<span x="11.5cm" y="1.5cm">欠费金额:<xsl:value-of select="ds/Student/CreditMoney" />元</span>
最后,我们把这段代码加入到“消费明细单模板”(位置:分析-->打印模板-->消费明细单模板-->编辑),如下图:
这样消费单上显示欠费信息就实现了:) 向大家晒晒实际打印效果呵!!
- 1怎样提升企业培训的效益
- 2中国培训网•网络商学院套餐方案——致力打造中国网络培训第一平台
- 3挖掘员工潜能的八大方法
- 4开发篇--短信群发开课通知
- 5员工管理系统需要实现哪些功能?
- 612月9日,重要公告!
- 7企业培训需求分析,当前企业关注的一种行为
- 8公司该培训“人情世故”吗?
- 9品牌经理做好网络推广很关键
- 10细节成就培训之美:训前篇
- 11培训管理系统V5.0测试版发布!
- 12泛普软件 1.0试用版正式发布了!
- 13企业的员工培训要怎样做
- 14如何评鉴出有魅力的人才
- 15遵从员工意愿地进行企业培训
- 16培训经理如何化解各类培训难题
- 17谷歌内部培养人才的奥秘
- 18如何将自己“培训”成为负责任的培训经理
- 19如何确保培训学习可以获得投资回报
- 20提高企业培训效果应该注意哪些问题
- 21科学有效的企业员工培训应该怎么做
- 22黄鹤楼酒:如何实现价格提升100倍
- 23学无止境,欣赏每一天进步的自己
- 24托管用户域名备案审核通知
- 25微言大义:寻找领导力的原点
- 26培训管理系统 2008 CS版即将发布,网站空间80元/年
- 27开发篇-怎样查询年、月收入?
- 28喜迎中秋国庆,培训管理系统2007促销大优惠
- 29现代员工求职的四个要求
- 30学员出勤课时消耗金额高精度分析
成都公司:成都市成华区建设南路160号1层9号
重庆公司:重庆市江北区红旗河沟华创商务大厦18楼