老师,下面的代码 msgbox(2) 不执行,是什么原因?
If Tables("一类疫苗出库单").current IsNot Nothing Then
If Tables("一类疫苗出库单.一类疫苗出库表").current IsNot Nothing Then
Dim drs As List(Of DataRow) = Tables("一类疫苗出库单").Current.DataRow.GetChildRows("一类疫苗出库表")
For n As Integer = 0 To drs.Count - 1 '遍历所有子行
msgbox(1)
If n > 0 AndAlso drs(n-1)("确认下级退回") = True AndAlso drs(n)("确认下级退回") = True Then '
msgbox(2)
Dim tm As String = ProjectPath & "Attachments\打印一类疫苗退回冲单.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\打印一类疫苗退回冲单.doc" '指定目标文件
Dim wrt As New WordReport(Tables("一类疫苗出库单"),tm,fl) '定义一个WordReport
wrt.Build() '逐行生成报表
wrt.print
wrt.quit
Else
PopMessage("明细表中有未""确认下级退回""的行!","提示",PopIconEnum.Error,3)
Return
End If
Next
Else
MessageBox.Show("没有明细,无法打印!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
Else
MessageBox.Show("没有出库单需要打印!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If