Dim filter,ss,ss1 As String
Dim s5 As String = e.form.controls("开始日期").value
Dim s6 As String = e.form.controls("结束日期").value
Dim fds As String
If s5<>Nothing
fds="提交日期>= # "& s5 &" #"
If filter>"" Then
filter=filter & " and "
End If
filter=filter & fds
End If
If s6<>Nothing
fds="提交日期<= # "& s6 &" #"
If filter>"" Then
filter=filter & " and "
End If
filter=filter & fds
End If
Dim filter1,filter2 As String
If filter>"" Then
filter1=filter & " and [审核人] is not null"
filter2=filter & " and [审核人] is null"
Else
filter1="[审核人] is not null"
filter2="[审核人] is null"
End If
messagebox.show(filter1)
If s5<>Nothing
ss=s5
Else
ss="未指定"
End If
If s6 <>Nothing
ss1=s6
Else
ss1="未指定"
End If
If FileIsOpened(ProjectPath & "Reports\\佣金明细.pdf")= True Then
ShowAppWindow("佣金明细.pdf",5)
End If
messagebox.show(filter1)
Dim Book As New XLS.Book(ProjectPath & "Attachments\\佣金明细.xls") \'打开模板
Dim fl As String = ProjectPath & "Reports\\佣金明细.pdf"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(4,20).Value = "<" & filter1 & ">"
If s5 <> Nothing
Sheet(2,9).Value = s5
Else
Sheet(2,9).Value = "未指定"
End If
If s6 <> Nothing
Sheet(2,10).Value ="至 " & s6
Else
Sheet(2,10).Value ="至 未指定"
End If
Book.Build() \'生成报表
Book.SaveToPDF(fl) \'保存为PDF文件
Dim Proc As New Process \'打开PDF文件
Proc.File = fl
Proc.Start()