Dim doc As New PrintDoc '定义一个报表
Dim rx As prt.RenderText '定义一个文本对象
Dim rm As prt.RenderImage '定义一个图形队形
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.Text = CurRow("卷宗内别")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 25, FontStyle.Bold)
rx.Style.FontBold = True '字体加粗
rx.y = 76
rx.x = 36
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("案卷编号")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 25, FontStyle.Bold)
rx.Style.FontBold = True '字体加粗
rx.y = 94
rx.x = 36
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("案件来源")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 25, FontStyle.Bold)
'rx.Style.FontBold = True '字体加粗
rx.y = 113
rx.x = 43
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("人员类别")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Left '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("仿宋", 20, FontStyle.Bold)
'rx.Style.FontBold = True '字体加粗
rx.y = 130
rx.x = 35
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("人员名称")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 25, FontStyle.Bold)
'rx.Style.FontBold = True '字体加粗
rx.y = 128
rx.x = 43
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("案由")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 25, FontStyle.Bold)
rx.Style.FontBold = True '字体加粗中
rx.y = 146
rx.x = 43
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("处理结果")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
'rx.Style.FontBold = True '字体加粗
rx.y = 160
rx.x = 20
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = Format(CurRow("收案时期"), "yyyy")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 205
rx.x = -8
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = Format(CurRow("收案时期"), "mm")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 202
rx.x = 6
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = Format(CurRow("收案时期"), "dd")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 202
rx.x = 18
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = Format(CurRow("结案日期"),"yyyy")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 202
rx.x = 70
doc.body.Children.Add(rx)
'rx.Text = Format(CurRow("结案日期"),"mm")
'rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
'rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
'rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
'rx.y = 205
'rx.x = 80
'doc.body.Children.Add(rx)
'
'rx.Text = Format(CurRow("结案日期"),"dd")
'rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
'rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
'rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
'rx.y = 205
'rx.x = 85
'doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("共卷")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 221
rx.x = -4
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("第几卷")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 220
rx.x = 35
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("共页码")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 220
rx.x = 75
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("承办人")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 238
rx.x = -16
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("归档日期")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 238
rx.x = 45
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("保管期限")
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rx.Style.Font = New Font("黑体", 15, FontStyle.Bold)
rx.y = 238
rx.x = 95
doc.body.Children.Add(rx)
Next
Doc.Preview() '预览报表