以下内容为程序代码:
1 Dim t As Table = Tables("流水账_流水账")
2 Dim Filter As String
3 Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
4 dlg.Filter= "Excel文件|*.xls" '设置筛选器
5 If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
6 Dim Book As New XLS.Book(dlg.FileName)
7 Dim Sheet As XLS.Sheet = Book.Sheets(0)
8 For n As Integer = 7 To Sheet.Rows.Count -5
9 Filter = "[物料编码] = " & Sheet(n,0).Value
10 Dim Val1 As Double =t.DataTable.Compute("Sum(入库数量)",Filter)
11 Dim Val2 As Double = t.DataTable.Compute("Sum(出库数量)",Filter)
12 Sheet(n,5).Value = Val1 - Val2
13 Next
14 Book.Save("c:\reports\test.xls")
15 Dim Proc As New Process
16 Proc.File = "c:\reports\test.xls"
17 Proc.Start()
18 End If
出现如下错误,请老师指教!
.NET Framework 版本:2.0.50727.5483
Foxtable 版本:2014.8.24.1
错误所在事件:窗口,流水账,Button8,Click
详细错误信息:
无法在 System.String 和 System.Int64 上执行“=”操作。
[此贴子已经被作者于2014-8-24 17:09:01编辑过]