狐狸爸爸,可不可以把易表的报表设计功能全盘移过来呀?那个功能很好用的.
以下是引用yangming在2009-5-20 9:32:00的发言:
这是不用打开EXCEL表而直接打印的,打印完就关闭了
CurrentTable.SaveExcel("C:\test.xls","sheet1",False)
Dim Book As New XLS.Book("C:\test.xls") '打开模板
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim r As Integer = Sheet.Rows.Count-1
Dim c As Integer = Sheet.Cols.Count -1
With Sheet.PrintSetting
'页眉
.Header = "&L"&"期间:" & e.Form.Controls("DTPqsrq").Value & "至" & e.Form.Controls("DTPjzrq").Value
End With
Sheet(r+2,c).Value = "制单人:" & User.Name
Book.Save("C:\test.xls") '保存工作簿
Dim Proc As New Process
Proc.File = "C:\test.xls"
Proc.Verb = "Print" '指定动作
Proc.Start()
学习..