Foxtable(狐表)用户栏目专家坐堂 → 打印选择条件


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

主题:打印选择条件

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


加好友 发短信
等级:幼狐 帖子:160 积分:1214 威望:0 精华:0 注册:2015/7/1 17:35:00
打印选择条件  发帖心情 Post By:2016/1/16 10:47:00 [只看该作者]

 这里的条件没有起限制作用,可以帮我改改吗,通过选择报价日期和名称来选择打印记录
Dim ww As String =e.Form.Controls("ComboBox1").Value
Dim rq As Date = e.Form.Controls("DateTimePicker1").Value

Dim Book As New XLS.Book(ProjectPath & "Attachments\报价表.xls") '打开模板
Dim fl As String = ProjectPath & "Reports\报价表.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim Filter As String

With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If      
        Filter = Filter & "报价日期 = '" & .Value & "'"  
 End If
End With
With e.Form.Controls("ComboBox1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "旺旺QQ = '" & .Value & "'"
    End If
End With

If filter > "" Then
    Sheet(3,19).Value = "<" & filter & ">"
Else
    Sheet(3,19).Value = "<all>"
End If
Book.Build() '生成报表
Book.Save(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()
[此贴子已经被作者于2016/1/16 10:58:23编辑过]

 回到顶部