Dim doc As New PrintDoc '定义一个报表
doc.PageSetting.Width = 210 '纸张宽度为100毫米
doc.PageSetting.Height = 297 '纸张高度为120毫米
Doc.PageSetting.LeftMargin = 0 '设置左边距
Doc.PageSetting.RightMargin = 0 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
Dim CurRow As Row
With Tables("席签打印_table1")
Dim rs As List(of Row) = .GetCheckedRows
Dim ra As prt.RenderArea '背景设置
For i As Integer = 0 To rs.Count - 1 Step 3
Dim rep As New prt.RenderEmpty '定义一个新的空对象
rep.BreakBefore = prt.BreakEnum.Page '打印前换页
doc.Body.Children.Add(rep) '加入到报表中
Dim rt As New prt.RenderTable() '定义一个表格对象
Dim rx As prt.RenderText '定义一个文本对象
rt.Style.GridLines.All = New prt.Linedef '设置网格线
rt.Rows(0).Height = 297
rt.Cols(0).Width= 99
rt.Cols(1).Width= 99
rt.Cols(2).Width= 99
Dim raa As new prt.RenderArea '背景设置
raa.Width = "Parent.Width" '宽度等于页面宽度
raa.Height = "Parent.Height" '高度等于页面高度
raa.Style.BackColor = Color.Pink
raa.Children.Add(rt)
CurRow = rs(i)
rx = new prt.RenderText
ra = rt.Cells(0,0).Area
ra.Style.Font = new Font("华文新魏",160)
rx.Text = CurRow("姓名")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
ra.Children.Add(rx)
If i+1 < rs.Count
CurRow = rs(i+1)
rx = new prt.RenderText
ra = rt.Cells(0,1).Area
ra.Style.Font = new Font("华文新魏",160)
rx.Text = CurRow("姓名")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
ra.Children.Add(rx)
End If
If i+2 < rs.Count
CurRow = rs(i+2)
rx = new prt.RenderText
ra = rt.Cells(0,2).Area
ra.Style.Font = new Font("华文新魏",160)
rx.Text = CurRow("姓名")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
ra.Children.Add(rx)
End If
doc.body.Children.Add(raa)
Next
End With