如题,该代码是在打印按钮中的:
Dim db As DataRow=Forms("窗口1").Controls("TextBox2").BindRow.DataRow
dim f As New Filler
DataTables("bdlshz").DataRows.Clear() '清除原有数据
f.SourceTable = DataTables("bdmx")
f.SourceCols = "bwmc,clmc"
f.DataTable = DataTables("bdlshz")
f.DataCols = "bwmc,clmc"
f.Filter= "[bh]='" & db("bh") & "' and [je]> 0"
f.Fill()
Dim dr1 As DataRow
For Each dr As Datarow In DataTables("bdlshz").DataRows
dr("dh") = DataTables("bdmx").Compute("Sum(dh)","[bh]='" & db("bh") & "' and [bwmc] = '" & dr("bwmc") & "' and [clmc] = '" & dr("clmc") & "'")
dr("je") = DataTables("bdmx").Compute("Sum(je)","[bh]='" & db("bh") & "' and [bwmc] = '" & dr("bwmc") & "' and [clmc] = '" & dr("clmc") & "'")
dr1 = DataTables("bdmx").Find("[bh]='" & db("bh") & "' and [bwmc] = '" & dr("bwmc") & "' and [clmc] = '" & dr("clmc") & "'")
dr("dj") = dr1("dj")
dr("id") = dr1("id")
Next
Tables("bdlshz").Sort = "id"
Dim Book As New XLS.Book(ProjectPath & "Attachments\bjd1.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(5,37).Value =Tables("bjd.bdmx").Compute("Sum(je)")
Book.Save(ProjectPath & "reports\bjd1.xls") '保存工作簿
Dim Proc As New Process '打开工作簿
Dim p as string = ProjectPath & "reports\bjd1.xls"
Proc.File = p
Proc.Start()
发生以下错误:
此主题相关图片如下:01.jpg