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 rt As prt.RenderText '定义一个文本对象
Dim rm As New prt.RenderImage '定义一个图片对象
Dim rt00 As New prt.RenderTable() '定义一个表格对象
Dim ra As New prt.RenderArea '定义一个容器
Rows = Tables("图片信息").Rows(i).DataRow.GetChildRows("ID")
For r As Integer = 0 To Rows.Count - 1
ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never '禁止容器因为分页而被垂直分割
rm.Image = Tables("文件附件").Current.DataRow.SQlLoadImage("附件")
rm.y = 50 '指定垂直位置
rm.x = 25 '指定垂直位置
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.KeepAspectRatio=True
rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.center '居中显示
rm.Style.ImageAlign.AlignVert = prt.ImageAlignHorzEnum.center '居中显示
doc.Body.Children.Add(rm) '将图片对象加入报表
Next
rt00.x=25
rt00.y=120
rt00.Width = 160 '表宽为150毫米
rt00.Height = 20 '表高为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.white '字符颜色设为红色
rt00.Cells(0,1).Text=rw("对象")
rt00.Cells(0,1).Style.TextColor = Color.white '字符颜色设为红
rt00.Cells(0,1).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置字体
rt00.Cells(0,1).Style.TextAlignHorz = prt.AlignHorzEnum.left '水平居中
rt00.Cells(0,1).Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
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.white '字符颜色设为红色
rt00.Cells(1,1).Text=rw("作者")
rt00.Cells(1,1).Style.TextColor = Color.white '字符颜色设为红
rt00.Cells(1,1).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置字体
rt00.Cells(1,1).Style.TextAlignHorz = prt.AlignHorzEnum.left '水平居中
rt00.Cells(1,1).Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
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.white '字符颜色设为红色
rt00.Cells(2,1).Text=rw("时间")
rt00.Cells(2,1).Style.TextColor = Color.white '字符颜色设为红
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.white '字符颜色设为红色
rt00.Rows(3).Height = 8 '
rt00.Rows(1).Height = 4
rt00.Rows(2).Height = 4
rt00.Rows(0).Height = 4
rt00.Cells(3,1).Text=rw("主题")
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.white '字符颜色设为红色
doc.Body.Children.Add(rt00) '将表格对象加入到报表中
'ra.Children.Add(rt00) '加入到容器中
Doc.Body.ChildRen.Add(ra)
Next
doc.Preview() '预览