Dim doc As New PrintDoc '定义一个报表
Dim tbl As Table = Tables("图片信息")
Dim Rows As List(Of DataRow)
For i As Integer = tbl.TopRow To tbl.BottomRow
Dim rw As Row = tbl.Rows(i)
Dim rm As New prt.RenderImage '定义一个图片对象
Dim rt00 As New prt.RenderTable()
Dim rx As prt.RenderText '定义一个文本对象
Dim drs As List(Of DataRow)
drs = DataTables("文件附件").Select("文件编号= '" & rw("ID") & "'")
For Each dr As DataRow In drs
Dim ra As New prt.RenderArea '定义一个容器
ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never '禁止容器因为分页而被垂直分割
rt00 = New prt.RenderTable
rt00.Cells(0,0).Text = Date.Today
rt00.Cells(0,1).Text = "党员发展工作资料"
rt00.Cells(0,2).Text = "第[PageNo]页,共[PageCount]页"
rt00.Cols(0).Style.TextAlignHorz = prt.AlignHorzEnum.Left
rt00.Cols(1).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt00.Cols(2).Style.TextAlignHorz = prt.AlignHorzEnum.right
rt00.Style.Borders.Bottom = New prt.LineDef '设置底边框
rt00.CellStyle.Spacing.Bottom = 0.5 '底端内容缩进0.5毫米
rt00.Style.FontSize = 8 '字体大小为8磅
Doc.PageHeader = rt00 '作为页眉使用
rt00 = New prt.RenderTable
rt00.Cells(0,0).Text = Date.Today
rt00.Cells(0,1).Text = "党员发展工作资料"
rt00.Cells(0,2).Text = "第[PageNo]页,共[PageCount]页"
rt00.Cols(0).Style.TextAlignHorz = prt.AlignHorzEnum.Left
rt00.Cols(1).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt00.Cols(2).Style.TextAlignHorz = prt.AlignHorzEnum.right
rt00.Style.Borders.Bottom = New prt.LineDef '设置底边框
rt00.CellStyle.Spacing.Bottom = 0.5 '底端内容缩进0.5毫米
rt00.Style.FontSize = 8 '字体大小为8磅
Doc.PageFooter = rt00 '作为页眉使用
rx = new prt.RenderText
rx.text = dr("文件名")
rx.Style.FontBold = True '字体加粗
rx.Style.Font= New Font("宋体", 24, FontStyle.Bold)
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中排列
rx.Style.Spacing.top = 5 '和下面的对象(表格)距离3毫米
ra.Children.Add(rx) '加入到容器中
rm = New prt.RenderImage
rm.Image = dr.SQlLoadImage("附件")
rm.Width = 160
rm.Height = 90
rm.Style.ImageAlign.TileHorz=True
rm.Style.ImageAlign.TileVert=True
rm.Style.ImageAlign.StretchHorz = True '禁止图片水平拉伸
rm.Style.ImageAlign.StretchVert = True '禁止图片水平拉伸
rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.center '居中显示
rm.Style.ImageAlign.AlignVert = prt.ImageAlignHorzEnum.center '居中显示
rm.Style.Spacing.Bottom = 5
rm.Style.Spacing.top = 5
ra.Children.Add(rm) '加入到容器中
rt00 =New prt.RenderTable '定义一个表格对象
rt00.Width = 160 '表宽为150毫米
rt00.Height = 30 '表高为150毫米
rt00.Rows.Count = 4 '设置行数
rt00.Cols.Count = 2 '设置列数
rt00.Cols(0).Width = 10
rt00.Cols(1).Width = 90
rt00.Cells(0,0).Text="拍摄对象"
rt00.Cells(0,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置字体
rt00.Cells(0,0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt00.Cells(0,0).Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt00.Cells(0,0).Style.TextColor = Color.red '字符颜色设为红色
rt00.Cells(1,0).Text="拍摄作者"
rt00.Cells(1,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置字体
rt00.Cells(1,0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt00.Cells(1,0).Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt00.Cells(1,0).Style.TextColor = Color.red '字符颜色设为红色
rt00.Cells(2,0).Text="拍摄时间"
rt00.Cells(2,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置字体
rt00.Cells(2,0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt00.Cells(2,0).Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt00.Cells(2,0).Style.TextColor = Color.red '字符颜色设为红色
rt00.Cells(2,1).Text="[Format(date.today,""yyyy年MM月dd日"")]"
rt00.Cells(2,1).Style.TextColor = Color.red '字符颜色设为红
rt00.Cells(2,1).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置字体
rt00.Cells(2,1).Style.TextAlignHorz = prt.AlignHorzEnum.left '水平居中
rt00.Cells(2,1).Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt00.Cells(3,0).Text="拍摄主题"
rt00.Cells(3,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置字体
rt00.Cells(3,0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt00.Cells(3,0).Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt00.Cells(3,0).Style.TextColor = Color.red '字符颜色设为红色
rt00.Rows(3).Height = 12 '
rt00.Rows(1).Height = 6
rt00.Rows(2).Height = 6
rt00.Rows(0).Height = 6
rt00.Cells(3,1).Text="某某县人民检察院某年某月某日召开全院干警大会,传达中共中央第十九届五中全会精神和学习贯彻落实十九届十四五发展规划会议"
rt00.Cells(3,1).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置字体
rt00.Cells(3,1).Style.TextAlignHorz = prt.AlignHorzEnum.left '水平居中
rt00.Cells(3,1).Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt00.Cells(3,1).Style.TextColor = Color.red '字符颜色设为红色
'rt00.Style.Spacing.Bottom = 5
ra.Children.Add(rt00) '加入到容器中
Doc.Body.ChildRen.Add(ra) '将容器加入到报表中
Next
Next
'doc.Preview() '预览