Dim doc As New PrintDoc \'定义一个报表
doc.PageSetting.PaperKind = 9
doc.PageSetting.Landscape = True
Doc.PageSetting.LeftMargin = 20 \'设置左边距
Doc.PageSetting.RightMargin = 20 \'设置右边距
Doc.PageSetting.TopMargin = 10 \'设置上边距
Doc.PageSetting.BottomMargin = 10 \'设置下边距
Dim rm As prt.RenderImage \'定义一个图片对象
For Each i As Row In rs
If i("发票") <> Nothing Then
\' Dim fil As String = i("发票")
Dim fi As List(of String) = i.DataRow.Lines("发票") \'fil.Split(vbcrlf)
Dim file As String
For Each ff As String In fi
ff = ff.Trim()
file = "\\\\10.100.100.129\\产品中心\\foxtable资料\\发票\\" & ff
Dim img As image = getImage(file)
If img IsNot Nothing Then
\'Dim rep As New prt.RenderEmpty \'定义一个新的空对象
\'rep.BreakBefore = prt.BreakEnum.Page \'打印前换页
\'doc.Body.Children.Add(rep ) \'加入到报表中
rm = new prt.RenderImage
rm.Image = img \'请改为实际的图标名称和路径
rm.Width = "Parent.Width" \'宽度等于页面宽度
rm.Height = "Auto" \'高度由图片大小自动决定
\' rm.Style.ImageAlign.StretchHorz = False \'禁止图片水平拉伸
rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center \'居中显示
rm.BreakBefore = prt.BreakEnum.Page
doc.Body.Children.Add(rm) \'将表格对象加入到报表中
\'Doc.Preview()
\'Doc.PrinterName = "HP LaserJet 6L"
End If
Next
End If
Next
doc.Print()