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


  共有2391人关注过本帖树形打印复制链接

主题:关于打印数据

帅哥哟,离线,有人找我吗?
裴保民
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1989 积分:12631 威望:0 精华:0 注册:2017/4/3 15:01:00
  发帖心情 Post By:2017/12/6 21:13:00 [只看该作者]

我调整打印窗体表的宽度不管用

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/12/6 21:20:00 [只看该作者]

以下是引用裴保民在2017/12/6 21:13:00的发言:
我调整打印窗体表的宽度不管用

 

调整列宽不管用?简单做个例子发出来看看。


 回到顶部
帅哥哟,离线,有人找我吗?
裴保民
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1989 积分:12631 威望:0 精华:0 注册:2017/4/3 15:01:00
  发帖心情 Post By:2017/12/6 22:00:00 [只看该作者]

可以了刚才把 Dim t As Table = e.form.controls("Table1").Table 代码形成Dim t As Table = e.form.controls("提醒窗体_Table1").Table 了,不过还有一个问题就是多久的以后打印调整窗体一直置顶影响打印预览,打印调整窗体又是模式窗体,以前打印的表是Tables("流量卡资料")中的数据在打印之前是将它关闭了,写了如下代码:
e.Form.baseForm.hide
'e.Form.Close
现在打印的是该窗体表就不能用代码把它关闭了,如果关闭就无法打印该窗体的表了,怎么处理呢?
[此贴子已经被作者于2017/12/6 22:11:33编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/12/6 22:14:00 [只看该作者]

Dim lieming As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
Dim t As Table = e.form.controls("Table1").Table
Dim str As String = t.getColVisibleWidth
If lieming.value > "" Then
    For Each c As Col In t.Cols
        c.visible = False
    Next
    For Each s As String In lieming.value.split(",")
        t.cols(s).visible = True
    Next
End If

e.Form.visible = false '隐藏
t.Print(True, False)
t.SetColVisibleWidth(str)

e.Form.visible = true '显示

'e.Form.Close


 回到顶部
帅哥哟,离线,有人找我吗?
裴保民
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1989 积分:12631 威望:0 精华:0 注册:2017/4/3 15:01:00
  发帖心情 Post By:2017/12/7 9:05:00 [只看该作者]

Dim lieming As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
If sjdcxzb="POS机库存资料" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="POS机查询数据表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
   ElseIf sjdcxzb="POS机绑定商户历史记录表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="流量卡绑定商户历史记录表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="代理商资料表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="POS机信息表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="供应商资料" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="仓库资料" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="物品表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="客户资料" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="流量卡资料" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="流量卡充值提醒表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="客户资料提醒表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="杂项库存资料" Then
    Dim t As Table =  e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
ElseIf sjdcxzb="杂项统计" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
End If


甜老师您看看哪错了怎么单击打印按钮打印调整窗体不隐藏呀?
已解决


还有一个问题就是如果"流量卡历史绑定记录查询窗体"中的表如果作为副本代码可如下写
  e.form.controls("Table1").Table.Filter = Tables("流量卡历史绑定记录查询窗体_Table2").Filter

如果不是作为副本代码怎么写呢?



[此贴子已经被作者于2017/12/7 9:32:33编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/12/7 9:49:00 [只看该作者]

e.form.controls("Table1").Table.Filter = forms("流量卡历史绑定记录查询窗体").Controls("Table2").table.Filter

 回到顶部
帅哥哟,离线,有人找我吗?
裴保民
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1989 积分:12631 威望:0 精华:0 注册:2017/4/3 15:01:00
  发帖心情 Post By:2017/12/9 8:14:00 [只看该作者]

Dim lieming As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
If sjdcxzb="POS机库存资料表" Then
    Dim t As Table = e.form.controls("Table1").Table
    Dim str As String = t.getColVisibleWidth
    If lieming.value > "" Then
        For Each c As Col In t.Cols
            c.Visible = False
        Next
        For Each s As String In lieming.value.split(",")
            t.cols(s).visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
  End If
运行后发现::
(1)如果列表框值全选和全不选打印的列都一样,都是全部列,这样设置如果列表框未选l列时,单击打印按钮不执行打印操作呢?
(2)怎么设置不打印表的行号呢?




 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  18楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105948 积分:538809 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/12/9 9:10:00 [只看该作者]

Dim lieming As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
If sjdcxzb="POS机库存资料表" Then
    Dim tbl As WinForm.Table = e.form.controls("Table1")
    tbl.PrintRowNumber = False '不打印行号
    Dim t As Table = tbl.Table
    Dim str As String = t.getColVisibleWidth
    If lieming.CheckedIndices.Count > 0 Then
        For Each c As Col In t.Cols
            c.Visible = False
        Next
        For Each idx As Integer In lieming.CheckedIndices
            t.cols(lieming.Items(idx)).Visible = True
        Next
    End If
    e.Form.visible = False '隐藏
    t.Print(True, False)
    t.SetColVisibleWidth(str)
    e.Form.visible = True '显示
End If

 回到顶部
帅哥哟,离线,有人找我吗?
裴保民
  19楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1989 积分:12631 威望:0 精华:0 注册:2017/4/3 15:01:00
  发帖心情 Post By:2017/12/9 9:22:00 [只看该作者]

运行后发现:和之前一样


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  20楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105948 积分:538809 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/12/9 9:24:00 [只看该作者]

整个事件代码所有打印的地方都要改

 回到顶部
总数 26 上一页 1 2 3 下一页