Dim sd As WinForm.DateTimePicker
Dim ed As WinForm.DateTimePicker
sd = e.Form.Controls("StartDate")
ed = e.Form.Controls("EndDate")
If sd.Value <> Nothing And ed.Value <> Nothing Then
Dim Book As New XLS.Book(ProjectPath & "Attachments\入库报表.xls") '打开模板
Dim fl As String = ProjectPath & "Reports\入库报表.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(3,9).Value = "< [入库日期] >= #" & sd & "# And [入库日期] <= #" & ed & "# >"
'Sheet(3,9).Value = "< 入库日期 >= sd And 入库日期 <= >" '写入打印条件
Book.Build() '生成报表
Book.Save(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()
Else
MessageBox.Show("请输入起始日期和终止日期!","提示", MessageBoxButtons.OK ,MessageBoxIcon.Information)
End If