单据套打
有了专业报表,单据套打将是一件非常轻松的任务,您只需量量好每一个对象的尺寸,设置好对象的坐标,然后将其加入到报表中即可。
例如有一个印刷好的员工资料卡:
下面是套打员工资料卡的代码,由很多几乎相同的代码段组成:
Dim
doc
As New PrintDoc
'定义一个报表
Dim rx As
prt.RenderText '定义一个文本对象
Dim rm As
prt.RenderImage '定义一个图形队形
Dim CurRow
As
Row =
Tables("员工").Current
rx = new prt.RenderText
rx.Text = CurRow("姓名")
rx.x = 51
rx.y = 36
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("出生日期")
rx.x = 109
rx.y = 36
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("部门")
rx.x = 51
rx.y = 43
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("雇佣日期")
rx.x = 109
rx.y = 43
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("性别")
rx.x = 51
rx.y = 50
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("职务")
rx.x = 109
rx.y = 50
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("城市")
rx.x = 51
rx.y = 57
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("邮政编码")
rx.x = 109
rx.y = 57
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("地址")
rx.x = 51
rx.y = 63
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("家庭电话")
rx.x = 51
rx.y = 69.5
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("办公电话")
rx.x = 109
rx.y = 69.5
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("备注")
rx.x = 26.5
rx.y = 76
rx.Width= 163
doc.body.Children.Add(rx)
rm= New prt.RenderImage
rm.Height = 38
rm.Width = 34
rm.Image = GetImage(CurRow("照片"))
rm.x= 149.5
rm.y = 36
doc.body.Children.Add(rm)
Doc.Preview() '预览报表
本页地址:http://www.foxtable.com/webhelp/topics/1246.htm