想在这段代码前价格判断 ,如果数据被复制过,就只复制新的数据,不再复制之前已经复制过的数据
Dim Cols1() As String = {"tanumru","jiecun","chuanhuoc","tasallnum","shangpinming","cord"}
Dim Cols2() As String = {"in","jie","chuanhuo","xiaoshou","name","cord"}
For Each dr1 As DataRow In DataTables("product").Select("[newnum]<>0")
Dim dr2 As DataRow = DataTables("kucun").AddNew()
For i As Integer = 0 To Cols1.Length -1
dr2(Cols2(i)) = dr1(Cols1(i))
Next
Next
If Tables("xiaoshou").Current IsNot Nothing Then
Dim p As String = Tables("xiaoshou").Current("time1")
Dim Book1 As New XLS.Book(ProjectPath & "Attachments\库存.xls") '打开模板
Dim fl1 As String = ProjectPath & "Reports\库存.xls"
Dim Sheet1 As XLS.Sheet = Book1.Sheets(0)
Book1.Build() '生成报表
Book1.Save(fl1)
Dim Proc1 As New Process
Proc1.File = fl1
Book1.Save("c:\mifeng\kucun\" & p & format(Date.Now, "ddhhmm") & "库存.xls")
Proc1.Start()
msgbox(2)
Dim Book2 As New XLS.Book(ProjectPath & "Attachments\明细.xls") '打开模板
Dim fl2 As String = ProjectPath & "Reports\明细.xls"
Dim Sheet2 As XLS.Sheet = Book2.Sheets(0)
Book2.Build() '生成报表
Book2.Save(fl2)
Dim Proc2 As New Process
Proc2.File = fl2
Book2.Save("c:\mifeng\mingxi\" & p & format(Date.Now, "ddhhmm") & "明细.xls")
Proc2.Start()
End If