请教老师,在窗口选择填报日期后执行批量打印,下面代码错在哪里 EXCEL模板设计的是主表和明细表关联的 想实现在WebBrowser显示要打印的全部员工的表,并进行批量打印
For s As Integer=0 To Tables("业绩填报").Rows.Count-1
Tables("业绩填报").Position=s
Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
Dim Book As New XLS.Book(ProjectPath & "Attachments\业绩明细A.xls") '打开模板
Dim rpt As String = ProjectPath & "Reports\业绩明细A" & Tables("业绩填报").current("员工工号") & ".xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(7,12).Value = "<填报日期 >= #" & e.Form.Controls("DateTimePicker1").Value & "# And 填报日期 <= #" & e.Form.Controls("DateTimePicker2").Value & "#" '写入打印条件
Book.Build()
Book.Save(rpt)
wbr.OfficeToolBar = True '如果不需要显示工具栏,可删除此行代码
wbr.AddRess = rpt
Next