下面的代码,当“Tables("S征地记录.S征地明细").Cols("政府奖励金额").GrandTotal = 0”时,也是生成“征地协议书.xls”,而不是生成想要的”征地协议书无奖励.xls“,请问老师该怎么修改?
If Tables("S征地记录.S征地明细").Current("村")= "贝林新安分场" Or Tables("S征地记录.S征地明细").Current("村")= "贝林四荣分场" Then
Dim Book As New XLS.Book(ProjectPath & "Attachments\回收土地协议书.xls")
Dim fl As String = ProjectPath & "Reports\回收土地协议书.xls"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
ElseIf Tables("S征地记录.S征地明细").Cols("政府奖励金额").GrandTotal > 0 And Tables("S征地记录.S征地明细").Current("村") <> "贝林新安分场" Or Tables("S征地记录.S征地明细").Current("村") <> "贝林四荣分场" Then
Dim Book As New XLS.Book(ProjectPath & "Attachments\征地协议书.xls")
Dim fl As String = ProjectPath & "Reports\征地协议书.xls"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
Else
Dim Book As New XLS.Book(ProjectPath & "Attachments\征地协议书无奖励.xls")
Dim fl As String = ProjectPath & "Reports\征地协议书无奖励.xls"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
End If