For Each File As String In FileSys.GetFiles("D:\蒋安\蒋安个人资料\督导组财务\ddzcw2020\ddzcw\Attachments")
Dim tpm As String = File.SubString(File.LastIndexOf("\")+1)
'
Dim doc As New PrintDoc '定义一个报表
'====定义文本对象======
Dim rs As New prt.RenderText '定义一个文本对象
rs.Text = "龙台片区督导组出差凭证(截图)" '设置文本对象的内容
rs.Style.TextColor = Color.Red '字符颜色设为红色
rs.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rs.Style.Font = New Font("宋体", 20, FontStyle.Bold) ''字符大小及类别
rs.Style.Spacing.Bottom = 3 '以象之间的间距
doc.Body.Children.Add(rs)
'====定义表格对象======
Dim rt As New prt.RenderTable() '定义一个表格对象
Dim rm As New prt.RenderImage() '定义一个图片对象
rm.Image = GetImage(tpm) '请改为实际的图标名称和路径
rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center '图片水平居中
rm.Style.ImageAlign.AlignVert = prt.ImageAlignVertEnum.Center '图片垂直居中
rm.Style.ImageAlign.StretchHorz = True '禁止水平方向扩展图片
rm.Style.ImageAlign.StretchVert = False '禁止垂直方向扩展图片
rm.Width = 170
rm.Height = 60
doc.Body.Children.Add(rt) '将表格对象加入到报表中
rt.Style.GridLines.All = New prt.Linedef(Color.DarkGray) '将表格的颜色设为深灰色
rt.Rows.Count = 0 '设置行数
rt.Cols.Count = 0 '设置列数
rt.Width = 170 '设置表格的宽度
rt.Height = 60'设置表格的高度
rt.Cells(0,0).RenderObject = rm '将单元格内容设置为图片对象rm
'====定义文本对象2======
Dim rs2 As New prt.RenderText '定义一个文本对象
rs2.Text = "报账人:蒋安" '设置文本对象的内容
rs2.Style.TextColor = Color.Red '字符颜色设为红色
rs2.Style.TextAlignHorz = prt.AlignHorzEnum.right '水平居中
rs2.Style.Font = New Font("宋体",10 , FontStyle.Bold) '
rs2.Style.Spacing.Top = 3
doc.Body.Children.Add(rs2)
Doc.Preview() '预览报表
Next