Dim doc As New PrintDoc
Dim rx As prt.RenderText
Dim rm As prt.RenderImage
doc.PageSetting.Width = 58 '纸张宽度为85毫米
doc.PageSetting.Height = 85 '纸张高度为58毫米
Doc.PageSetting.LeftMargin = 10 '设置左边距
Doc.PageSetting.RightMargin = 10'设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边
Dim Currow As Row
Dim tbl As Table = Tables("合格证")
For i As Integer = tbl.TopRow To tbl.BottomRow
CurRow = tbl.rows(i)
Dim rep As New prt.RenderEmpty '定义一个新的空对象
rep.BreakBefore = prt.BreakEnum.Page '打印前换页
doc.Body.Children.Add(rep ) '加入到报表中
rx = new prt.RenderText
rx.x = 10
rx.y = 30
rx.Text = CurRow("型号")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 10 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
doc.Body.Children.Add(rx) '加入到报表中
rx = new prt.RenderText
rx.x = 20
rx.y = 30
rx.Text = CurRow("钢号")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 10 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
doc.Body.Children.Add(rx) '加入到报表中
rx = new prt.RenderText
rx.x = 30
rx.y = 30
rx.Text = CurRow("检验")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 10 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
doc.Body.Children.Add(rx) '加入到报表中
rx = new prt.RenderText
rx.x = 40
rx.y = 30
rx.Text = CurRow("日期")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 10 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
doc.Body.Children.Add(rx) '加入到报表中
Next
'Doc.PrinterName = "Canon G1010 series" '指定的打印机上打印
Doc.Preview() '预览报表