然后报表事件BuildDetail代码,注意下面只处理了第2、3个图片,第4个图片的代码自己参考添加If e.DataRow IsNot Nothing Then
Dim idx As Integer = Tables("表A").FindRow(e.DataRow)
If idx > -1 Then
Dim fla As String = ProjectPath & "Images\a.jpg"
Dim flb As String = ProjectPath & "Images\b.jpg"
If idx + 1 < Tables("表A").Rows.Count Then
Dim r As Row = Tables("表A").Rows(idx + 1)
Dim fl As String = ProjectPath & "Images\" & r("spdm") & "_" & r("gg1dm") & ".jpg"
If FileSys.FileExists(fl) Then
FileSys.CopyFile(fl, fla, True)
Else
FileSys.DeleteFile(fla, 2, 2)
End If
If idx + 2 < Tables("表A").Rows.Count Then
r = Tables("表A").Rows(idx + 2)
fl = ProjectPath & "Images\" & r("spdm") & "_" & r("gg1dm") & ".jpg"
If FileSys.FileExists(fl) Then
FileSys.CopyFile(fl, flb, True)
Else
FileSys.DeleteFile(fla, 2, 2)
End If
Else
FileSys.DeleteFile(flb, 2, 2)
End If
Else
FileSys.DeleteFile(fla, 2, 2)
End If
End If
End If