Dim gzxx As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim Book As New XLS.Book(ProjectPath & "Attachments\发放名单.xls") '打开模板
Dim fl As String = ProjectPath & "Reports\发放名单.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
If gzxx.text=""
MessageBox.show("请先选择要打印的学校,然后点击查询,再打印")
Return
Else
Sheet(5,7).Value = "<gzxx ='" & gzxx.text & "' and sfydy='false'>" '写入打印条件
End If
Book.Marks.Add("用户名",User.Name)
Book.Build() '生成报表
Book.Save(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()