Dim tb As Table=Tables("县区_table2")
tb.sort="学校名称,班级"
Dim doc As New PrintDoc '定义一个报表
doc.PageSetting.Width = 82 '纸张宽度为100毫米
doc.PageSetting.Height = 124 '纸张高度为120毫米
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Doc.PageSetting.leftMargin = 0
Doc.PageSetting.rightMargin = 0
Doc.PageSetting.TopMargin =0
Doc.PageSetting.BottomMargin =0
'For Each r As Row In tb.Rows
For i As Integer = tb.TopPosition To tb.BottomPosition
Dim ra As New prt.RenderArea
Dim rt As prt.RenderText
ra.Width = 82 '宽度53毫米
ra.Height = 125 '高度24毫米
ra.Style.Spacing.Top =6
ra.Style.Spacing.Bottom =4
ra.Style.Spacing.left =5.5
ra.Style.Spacing.right =5.5
ra.Style.Borders.All = New prt.Linedef(0.1, Color.black) '设置边框
ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never '禁止水平分割
ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never '禁止垂直分割
Doc.Body.ChildRen.Add(ra) '将容器加入到报表中
rt = New prt.RenderText
rt.Text = "内江市2018年初中学业水平考试" & vbcrlf & " 暨高中阶段招生考试"
rt.Style.Font=New Font("黑体", 8, FontStyle.Bold)
rt.Y =2
rt.x=2
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = " 准 考 证"
rt.Style.Font=New Font("黑体", 16, FontStyle.Bold)
rt.Y =9
rt.x=2
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = "姓 名:" & tb.rows(i)("姓名")
rt.Style.Font=New Font("宋体", 11, FontStyle.Bold)
rt.Y = 20
rt.x=1
ra.Children.Add(rt) '添加到容
Dim Line As New prt.LineDef(0.2, Color.black)
Dim ln As New prt.RenderLine(18,24, 45, 24, Line)
ra.Children.Add(ln) '将线条加入到报表中
rt = New prt.RenderText
rt.Text = "中考考号:" ' & tb.rows(i)("")
rt.Style.Font=New Font("宋体", 11, FontStyle.Bold)
rt.Y = 26
rt.x=1
ra.Children.Add(rt) '添加到容
Line = New prt.LineDef(0.2, Color.black)
ln = New prt.RenderLine(18,30, 45, 30, Line)
ra.Children.Add(ln) '将线条加入到报表中
rt = New prt.RenderText
rt.Text = "中考考点:" ' & tb.rows(i)("kdxxdm")
rt.Style.Font=New Font("宋体", 11, FontStyle.Bold)
rt.Y = 32
rt.x=1
ra.Children.Add(rt) '添加到容
Line = New prt.LineDef(0.2, Color.black)
ln = New prt.RenderLine(18,36, 45, 36, Line)
ra.Children.Add(ln) '将线条加入到报表中
rt = New prt.RenderText
rt.Text = "生地考号:" & tb.Rows(i)("考试号")
rt.Style.Font=New Font("宋体", 11, FontStyle.Bold)
rt.Y = 39
rt.x=1
ra.Children.Add(rt) '添加到容
Line = New prt.LineDef(0.2, Color.black)
ln = New prt.RenderLine(18,43, 45, 43, Line)
ra.Children.Add(ln) '将线条加入到报表中
rt = New prt.RenderText
rt.Text = "生地考点:" & tb.Rows(i)("考点学校")
rt.Style.Font=New Font("宋体", 11, FontStyle.Bold)
rt.Y = 45
rt.x=1
ra.Children.Add(rt) '添加到容
Line = New prt.LineDef(0.2, Color.black)
ln = New prt.RenderLine(18,49, 45, 49, Line)
ra.Children.Add(ln) '将线条加入到报表中
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Bar.QRCodeErrorCorrectionLevel = Barpro.QRCodeErrorCorrectionLevel.m
BAR.DisplayCode = False
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
bar.Code = "http://118.118.191.35:800"
Bar.Text = "扫码填志愿 "
Bar.TextAlignment = Barpro.Alignment.BelowCenter
rg = new prt.RenderGraphics
bar.DrawOnCanvas(rg.Graphics,0,0,1)
rg.Style.Spacing.All = 0
rg.x=47
rg.y=40
RG.Width=25
ra.Children.Add(rg)
Bar = New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code128
BAR.DisplayCode = False
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
bar.Code = tb.Rows(i)("报名号")
Bar.Text = tb.Rows(i)("报名号")
Bar.BarRatio = 3
Bar.BarHeight = 10
Bar.TextAlignment = Barpro.Alignment.BelowCenter
rg = new prt.RenderGraphics
bar.DrawOnCanvas(rg.Graphics,0,0,1)
rg.Style.Spacing.All = 0
rg.x=6
rg.y=50
RG.Width=50
ra.Children.Add(rg)
rt = New prt.RenderText
rt.Text = tb.Rows(i)("班级")
rt.Style.Font=New Font("宋体", 6, FontStyle.Bold)
rt.Y = 15
rt.x=22
ra.Children.Add(rt) '添加到容
Dim rm As New prt.RenderImage()
rm.Style.ImageAlign.KeepAspectRatio= False
rm.Image= GetImage(projectPath & "remotefiles" & tb.Rows(i)("相片"))
rm.Width=25
rm.Height=37
rm.Y = 2
rm.x=47
ra.Children.Add(rm) '添加到容
rm = New prt.RenderImage()
rm.Style.ImageAlign.KeepAspectRatio= False
rm.Image= GetImage(projectPath & "attachments\" & "ap.png")
rm.Width=71
rm.Height=50
rm.Y = 65
rm.x=0
ra.Children.Add(rm) '添加到
rm= New prt.RenderImage '定义一个图片对象
rm.Image = GetImage(projectPath & "attachments\" & "gz.png") '设置图片
rm.x = 39
rm.y = 30
rm.width=40
rm.Height=40
'rm.Style.ImageAlign.StretchHorz = False '禁止图片水平拉伸
rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center '居中显示
ra.Children.Add(rm)
Next
Doc.Preview() '预览报表
老师,为什么当多选几条记录打印时,章就不显示,而一条就要显