Dim doc As New PrintDoc '定义一个报表
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Dim ra As New prt.RenderArea
Dim rt As prt.RenderText
ra.Width = 50 '设置标签宽度
ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never '禁止水平分割
ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never '禁止垂直分割
ra.Style.Spacing.Right = 1 '设置标签之间的所有和上下间隔为2毫米
ra.Style.Spacing.Bottom = 1
ra.Style.Padding.All = 1 ' 标签内容距离边框为1毫米
ra.Style.Borders.All = New prt.Linedef(0.3, Color.Red) '设置边框
ra.DataBinding.DataSource = BindTables("生产单") '将容器绑定到员工表
Doc.Body.ChildRen.Add(ra) '将容器加入到报表中
rt = New prt.RenderText
rt = New prt.RenderText
rt.Text = "[Fields!客户.Value]"
rt.X = 1
rt.Y = 1
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = "[Fields!订单号.Value]"
rt.X = 15
rt.Y = 1
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "[Fields!标号.Value]"
rt.X = 2
rt.Y = "Prev.Bottom + 2" '垂直坐标位于迁移对象之下的2毫米
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "[Fields!产品名.Value]"
rt.X =20
rt.Y = "Prev.Top" '垂直坐标位于迁移对象之下的2毫米
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "[Fields!长.Value]"
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "* [Fields!宽.Value]"
rt.X = 12
rt.Y = "Prev.Top" '垂直坐标位于迁移对象之下的2毫米
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "= [Fields!数量.Value]"
rt.X = 26
rt.Y = "Prev.Top" '垂直坐标位于迁移对象之下的2毫米
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "[Fields!加工要求.Value]"
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
Doc.Preview() '预览报表
不会设置~ 标签的个数=产品数量 怎么编??