1、这个代码删除
ra.x=10
2、我这样测试没问题
Dim tb As Table=Tables("表A")
Dim doc As New PrintDoc '定义一个报表
Doc.PageSetting.Landscape=False
'doc.PageSetting.Width = 285'纸张宽度为100毫米
'doc.PageSetting.Height = 216 '纸张高度为120毫米
doc.PageSetting.PaperKind = 9
doc.PageSetting.Landscape = True
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Doc.PageSetting.leftMargin = 0
Doc.PageSetting.rightMargin = 0
Doc.PageSetting.TopMargin =0
Doc.PageSetting.BottomMargin =0
'doc.AutoRotate = False
For i As Integer = tb.TopPosition To tb.BottomPosition
Dim ra As New prt.RenderArea
ra.Width = 285 '宽度53毫米
ra.Height = 216 '高度24毫米
ra.Style.Spacing.All = 0
ra.Style.Borders.All = New prt.Linedef(0, Color.Red) '设置边框
ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never '禁止水平分割
ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never '禁止垂直分割
'将容器加入到报表中
Doc.Body.ChildRen.Add(ra)
Dim rt As New prt.RenderText
rt.Text = 111
rt.Style.Font=New Font("宋体", 15, FontStyle.Bold)
rt.Y =55
rt.x=45
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = 222
rt.Style.Font=New Font("宋体", 15, FontStyle.Bold)
rt.Y =73
rt.x=45
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = 333
rt.Style.Font=New Font("宋体", 15, FontStyle.Bold)
rt.Y =90
rt.x=45
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = 4444
rt.Style.Font=New Font("宋体", 15, FontStyle.Bold)
rt.Y =108
rt.x=50
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = 555
rt.Style.Font=New Font("宋体", 15, FontStyle.Bold)
rt.Y =144
rt.x=50
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = 6666
rt.Style.Font=New Font("宋体", 15, FontStyle.Bold)
rt.Y =171
rt.x=36
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = 7777
rt.Style.Font=New Font("宋体", 15, FontStyle.Bold)
rt.Y =171
rt.x=50
ra.Children.Add(rt) '添加到容器
rt = New prt.RenderText
rt.Text = 8888
rt.Style.Font=New Font("宋体", 15, FontStyle.Bold)
rt.Y =171
rt.x=61
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = 9999
rt.Style.Font=New Font("宋体", 18, FontStyle.Bold)
rt.Y =15
rt.x=130
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = 23434
rt.Style.Font=New Font("行楷", 18, FontStyle.Bold)
rt.Y =78
rt.x=160
ra.Children.Add(rt) '添加到容器中
Dim ra1 As New prt.RenderArea
ra1.Style.Borders.All = New prt.Linedef(0, Color.black) '设置边
ra1.width=149
ra1.height =15
ra1.x=118
ra1.y=149
ra.ChildRen.Add(ra1)
Next
Doc.Preview() '预览报表