Case "产品档案标签"
Dim doc As New PrintDoc '定义一个报表
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置排列方式
doc.PageSetting.Width = 100 '纸张宽度为100毫米
doc.PageSetting.Height = 75 '纸张高度为120毫米
Doc.PageSetting.LeftMargin = 5 '设置左边距
Doc.PageSetting.RightMargin = 5 '设置右边距
Doc.PageSetting.TopMargin = 5 '设置上边距
Doc.PageSetting.BottomMargin = 5 '设置下边距
'doc.PageSetting.Landscape = True
For i As Integer = 1 To 2
Dim ra As New prt.RenderArea
Dim rt As prt.RenderText
ra.Width = 48 '宽度53毫米
ra.Height = 70 '高度24毫米
ra.Style.Spacing.All = 4
ra.Style.Borders.All = New prt.Linedef(0.7, Color.Red) '设置边框
ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never '禁止水平分割
ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never '禁止垂直分割
Doc.Body.ChildRen.Add(ra) '将容器加入到报表中
rt = New prt.RenderText
rt.Text = "档案标签"
rt.X = 2
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 = “AAAAACCCCCBBBBBBBBBB" "这个就会超出了标签宽度那该怎么过行
rt.X = 17
rt.Y = "Prev.Top" '垂直坐标和前一对象相同
ra.Children.Add(rt)
Next
Doc.PrinterName = "TSC TTP-244 Plus"
Doc.Preview() '预览报表