老师,我写一个打印函数,这个是参数配置表获取到系统打印机,已维护好,我是有 打印类型 两种,piao据 报表,当选择的是入库单、出库单是,调取打印类型为 piao据,打印机名称为该类型的打印机, 下面是已经写好了,在 入库单打印时,调用这个函数,不起作用,老师,你看一下,是怎么回事。
Dim e = args(0)
Dim 参数类型 As String = args(1)
Dim 参数名称 As String = args(2)
Dim 配置参数 As String = args(3)
Dim 打印类型 As String = args(4)
Dim 打印机名称 As String = args(5)
Dim dr As DataRow = DataTables("参数配置表").find("参数名称='" & 参数名称 & "'and 打印类型 = '" & 参数名称 & "' and 打印机名称 = '" & 参数名称 & "'And 参数类型='是否启用打印' And 配置参数='是'")
If dr IsNot Nothing Then
Dim doc As PrintDoc = e.Form.GernatePrintDoc()
For Each c As object In Doc.Body.Children
If Typeof c Is prt.RenderTable Then
Dim t As prt.RenderTable = c
t.Rows(0).Style.Font = new font("宋体", 10, fontstyle.bold) '第一行,即标题行加粗
't.Rows(t.Rows.count-1).Style.Font = new font("宋体", 10, fontstyle.bold) '最后一行,即标题加粗,这里是打印表格明细,不需要
For i As Integer = 0 To t.Rows.count-1
For j As Integer = 0 To t.Cols.count-1
t.cells(i,j).Style.BackColor = Color.white
t.cells(i,j).Style.TextColor = Color.black
Next
Next
End If
Next
doc.Print()
Else
Return Nothing
End If