Foxtable(狐表)用户栏目专家坐堂 → 单据打印


  共有2020人关注过本帖平板打印复制链接

主题:单据打印

帅哥哟,离线,有人找我吗?
outcat
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:470 积分:3641 威望:0 精华:0 注册:2017/11/5 14:47:00
单据打印  发帖心情 Post By:2020/7/13 11:45:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:123.jpg
图片点击可在新窗口打开查看

我这是一个参数配置表,然后我要做一个打印功能,写了下面的自定义函数,想实现 不同的窗体,打印功能开启,该种单据可以打印,打印功能关闭,该窗体不打印,可下面这段代码,在控制 参数名称,对应不同的窗体调用,不知道该怎么写了,请老师赐教
Dim e = args(0)
Dim 参数类型 As String = args(1)
Dim 参数名称 As String = args(2)
Dim 配置参数 As String = args(3)
If Tables("参数配置表").Current IsNot Nothing Then
    Dim r As Row = Tables("参数配置表").Current
    If r("参数类型") = "是否启用打印" And r("配置参数") = "是"  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.Preview()
        'doc.Print()
    Else
        Return Nothing
    End If
End If

 回到顶部