以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  筛选条件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=170187)

--  作者:shenfengxiaozi
--  发布时间:2021/7/15 14:18:00
--  筛选条件

请教老师,如果需要给以下代码加一个filter,内容为当前选择的行,怎么加?

 

Dim exa as New Exporter
exa
.SourceTableName = "表B"
exa
.FilePath = "c:\\Data\\数据.xls"
exa.Format =
"Excel"
exa
.Export()


--  作者:有点蓝
--  发布时间:2021/7/15 14:21:00
--  
exa.filter = "_identify = " & tables("表B").current("_identify")
--  作者:shenfengxiaozi
--  发布时间:2021/7/15 14:25:00
--  
老师 不好意思 我没表达清楚 我这里选择的行 可能是一行,也可能是多行。
--  作者:有点蓝
--  发布时间:2021/7/15 14:38:00
--  
dim s as string = ""
With Tables("表B")
    For 
i as Integer = .TopPosition To .BottomPosition
      s = s & "," & .rows(i)("
_identify")
    Next
End
 
With
if s > "" then
s = s.trim(",")
exa.filter = "_identify in (" & s & ")"
end if