Foxtable(狐表)用户栏目专家坐堂 → 请问在导出时能否选择所需要的列


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

主题:请问在导出时能否选择所需要的列

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:111414 积分:567140 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/12/11 17:45:00 [显示全部帖子]

Dim ckl As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
Dim nms As New List(of String)
For i As Integer = 0 To ckl.Items.count - 1 '获取已经勾选的列
    If ckl.GetItemChecked(i) Then
        nms.Add(ckl.Items(i).split("(")(1).replace(")","")) '这里对应5楼的用法进行解析
    End If
Next
[此贴子已经被作者于2017/12/11 20:36:39编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:111414 积分:567140 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/12/11 20:36:00 [显示全部帖子]

窗口afterload

Dim lieming As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
Dim s As String
For Each c As Col In Tables("l_goods").cols
    s=s & "|" & c.caption & "(" & c.name & ")"
Next
lieming.ComboList=s

导出按钮

Dim ckl As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
Dim nms As New List(of String)
For i As Integer = 0 To ckl.Items.count - 1 '获取已经勾选的列
    If ckl.GetItemChecked(i) Then
        nms.Add(ckl.Items(i).split("(")(1).replace(")","")) '这里对应5楼的用法进行解析
    End If
Next
……

 回到顶部
帅哥,在线噢!
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:111414 积分:567140 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/12/11 20:59:00 [显示全部帖子]

Dim ckl As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
Dim nms As New List(of String)
Dim nms2 As New List(of String)
For i As Integer = 0 To ckl.Items.count - 1 '获取已经勾选的列
    If ckl.GetItemChecked(i) Then
        Dim arr() As String = ckl.Items(i).split("(")
        nms.Add(arr(1).replace(")",""))
        nms2.Add(arr(0))
    End If
Next


If nms.Count = 0 Then
    MessageBox.Show("至少要选择一列","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
'生成Excel表
Dim dt As Table = Tables("l_goods")
Dim Book As New XLS.Book
Dim Sheet As XLS.Sheet = Book.Sheets(0)
For i As Integer = 0 To nms.count -1
    Sheet(0, i).Value = nms2(i)
Next
……

 回到顶部