打印标签
之前我们通过调整排列方式,实现了一行打印多个标签的功能。
现在我们来看看如何通过分栏实现同样的功能。
示例:
Dim
doc As New PrintDoc '定义一个报表 rt = New prt.RenderText
rt.Text = "姓名:"
rt.X = 2
rt.Y = 2
ra.Children.Add(rt)
'添加到容器中
rt = New prt.RenderText
rt.Text = "黄财德"
rt.X = 15
rt.Y = 2
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "职务:"
rt.X = 2
rt.Y = "Prev.Bottom +
2" '垂直坐标位于迁移对象之下的2毫米
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "总经理"
rt.X = 15
rt.Y = "Prev.Top"
'垂直坐标和前一对象相同
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "编号:"
rt.X = 2
rt.Y = "Prev.Bottom +
2"
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text =
"44081919710917243"
rt.X = 15
rt.Y = "Prev.Top"
ra.Children.Add(rt)
Next
Doc.Preview() '预览报表
执行结果: