Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "df = '" & .Value & "'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "rq >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "rq <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Tables("ry").Filter = Filter
End If
Dim Book As New XLS.Book(ProjectPath & "Attachments\dc1.xls")
Dim fl As String = ProjectPath & "Reports\dc1.xls"
Book.Build() '生成细节区
Book.Sheets(0).Rows.RemoveAt(0) '删除第一行,Excel报表的第一行通常是标记行
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
此主题相关图片如下:qq图片20221121162624.png