此主题相关图片如下:未命名.jpg
我想要设置打印的时候,那个标题多个。要怎么写代码?以下是我现在的代码
Dim doc As New Printdoc
Dim rx As prt.RenderText
Dim rt As prt.RenderTable
rx = New prt.RenderText
rx.Style.FontSize = 14
rx.Style.FontBold = True
rx.Style.Spacing.Bottom = 9
rx.Text = "采购单编号: " & Tables("采购单").Current("采购编号")
rx.Text = "供应商简称: " & Tables("采购单").Current("供应商简称")
rx.Text = "采购员: " & Tables("采购单").Current("采购员")
rx.Text = "采购日期: " & Tables("采购单").Current("采购日期")
rx.Text = "交货期: " & Tables("采购单").Current("交货期")
rx.Text = "交货日期: " & Tables("采购单").Current("交货日期")
doc.Body.Children.Add(rx)
rt = New prt.RenderTable
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.Style.TextAlignVert = prt.AlignVertEnum.Center
rt.Style.Borders.Bottom = New prt.LineDef(0.3,Color.LightGray)
rt.CellStyle.Spacing.All = 1
rt.Cols.Count = 4
rt.Cells(0,0).Text = "物料编号"
rt.Cells(0,1).Text = "物料名称"
rt.Cells(0,2).Text = "物料型号"
rt.Cells(0,3).Text = "颜色"
rt.Cells(0,4).Text = "单价"
rt.Cells(0,5).Text = "采购数量"
rt.Cells(0,6).Text = "交货数量"
rt.Cells(0,7).Text = "单位"
rt.Cells(0,8).Text = "未交数"
rt.Cells(0,9).Text = "备注"
rt.rows(0).Style.Borders.Top = New prt.LineDef(1,Color.LightGray)
rt.rows(0).Style.Borders.Bottom = New prt.LineDef(1,Color.LightGray)
With Tables("采购单.采购单明细表")
For r As Integer = 0 To .Rows.Count - 1 '遍历关联表每一行
rt.Cells(r+1,0).Text = .rows(r)("物料编号")
rt.Cells(r+1,1).Text = .rows(r)("物料名称")
rt.Cells(r+1,2).Text = .rows(r)("物料型号")
rt.Cells(r+1,3).Text = .rows(r)("颜色")
rt.Cells(r+1,4).Text = .rows(r)("单价")
rt.Cells(r+1,5).Text = .rows(r)("采购数量")
rt.Cells(r+1,6).Text = .rows(r)("交货数量")
rt.Cells(r+1,7).Text = .rows(r)("单位")
rt.Cells(r+1,8).Text = .rows(r)("未交数")
rt.Cells(r+1,9).Text = .rows(r)("备注")
'If .rows(r)("中止") = True Then
'Dim rm As New prt.RenderImage
'rm.Image = getImage("Check.Ico")
'rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center
'rm.Style.ImageAlign.StretchHorz = False
'rm.Style.ImageAlign.StretchVert = False
'rt.Cells(r+1,5).RenderObject = rm
'End If
Next
End With
doc.Body.Children.Add(rt)
rx = New prt.RenderText
rx.Style.FontBold = True
rx.Style.Spacing.Top = 3
rx.Text = "物料种类: " & Tables("采购单.采购单明细表").Rows.Count
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Right
doc.Body.Children.Add(rx)
doc.Preview