Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
Dim doc As New PrintDoc '定义一个新报表
For Each r1 As Row In Tables("样品派工单").GetCheckedRows
Dim rx As prt.rendertext
rx = New prt.RenderText
rx.text = "样品派工单"
rx.Style.FontBold = True '字体加粗
rx.Style.FontSize = 16 '大体大小为16磅
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中排列
rx.Style.Spacing.Bottom = 3 '和下面的对象(表格)距离3毫米
doc.Body.Children.Add(rx) '加入到报表中
rx = New prt.RenderText
rx.Style.FontSize = 16
rx.Style.FontBold = True
rx.Style.Spacing.Bottom = 5
rx.Text = "编号: " & r1("编号") & " 产品货号: " & r1("产品货号") & " 数量: " & r1("数量")
doc.Body.Children.Add(rx)
Dim rt As New prt.RenderTable '定义一个新表格
cmd.CommandText = "S ELECT * From {样品派工明细} where 编号= '"& r1("编号") &"'"
dt = cmd.ExecuteReader()
Dim ColNames As
String() =
New
String(){"部件名称", "材料名称", "规格","部件数量",“用量”,“单位”}
这里代码应该如何写。
rt.SplitVertBehavior = prt.SplitBehaviorEnum.Never
rt.Style.Gridlines.All = New prt.Linedef(Color.Gray) '灰色网格线
rt.CellStyle.Spacing.All = 1 '内容距离网格线1毫米
rt.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '第一行内容水平居中
doc.Body.Children.Add(rt)
rx = New prt.RenderText
rx.Style.FontSize = 16
rx.Style.FontBold = True
rx.Style.Spacing.Bottom = 5
rx.Text = "下单人: " & r1("操作员")
doc.Body.Children.Add(rx)