Foxtable(狐表)用户栏目专家坐堂 → [求助]求解数据筛选,报表打印代码?


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

主题:[求助]求解数据筛选,报表打印代码?

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


加好友 发短信
等级:小狐 帖子:366 积分:3658 威望:0 精华:0 注册:2008/11/2 21:50:00
[求助]求解数据筛选,报表打印代码?  发帖心情 Post By:2018/3/1 10:41:00 [只看该作者]

Dim nd As String = e.Form.Controls("ComboBox1").Text
Dim sd As String = e.Form.Controls("ComboBox2").Text
Dim str As String = "-1,"
str &= DataTables("生存认证资料").GetComboListString(“姓名" and "公民身份号码", "认证年度 = '" & nd & "'" Or "认证时段 = '" & sd & "'").replace("|", ",")
Tables("退休生存人员").filter = "_Identify in (" & str.trim(",") & ")"
'==========================以上是筛选已经认证的人员==============================
Dim Book As New XLS.Book(ProjectPath & "Attachments\退休认证表.xls")
Book.Build()
Book.Save(ProjectPath & "Reports\退休认证表.xls")
Dim Proc As New Process
Proc.File = ProjectPath & "Reports\退休认证表.xls"
Proc.Start()
'==============================以上是认证报表打印=================================
Tables("退休生存人员").Filter = ""
e.Form.Close

 

 

以上是我自己弄的代码,但报错;主要问题出现在数据筛选上。其它是否还有问题还不清楚。请各位老师帮忙纠正下。此代码是用于[按钮]。

[此贴子已经被作者于2018/3/1 10:41:12编辑过]

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


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

Dim nd As String = e.Form.Controls("ComboBox1").Text
Dim sd As String = e.Form.Controls("ComboBox2").Text
Dim str As String = ""
str &= DataTables("生存认证资料").GetComboListString("公民身份号码", "认证年度 = '" & nd & "' Or 认证时段 = '" & sd & "'").replace("|", "','")
Tables("退休生存人员").filter = "公民身份号码 in ('" & str.trim(",") & "')"

'==========================以上是筛选已经认证的人员==============================
Dim Book As New XLS.Book(ProjectPath & "Attachments\退休认证表.xls")
Book.Build()
Book.Save(ProjectPath & "Reports\退休认证表.xls")
Dim Proc As New Process
Proc.File = ProjectPath & "Reports\退休认证表.xls"
Proc.Start()
'==============================以上是认证报表打印=================================
Tables("退休生存人员").Filter = ""
e.Form.Close


 回到顶部