调用画面类内部
Public Class AAA
Private Shared mstrTitle As String
Private Shared mobjDocument As GrapeCity.ActiveReports.Document.PageDocument
Private Shared mfrmForm As AAA= Nothing
Private Sub AAA_Load(sender As Object, e As System.EventArgs) Handles Me.Load
End Sub
Public Shared Sub sub_CallForm(ByVal aaa As GrapeCity.ActiveReports.Document.PageDocument, _
ByVal pstrMsg As String)
Dim objT1 As Threading.Thread
mobjDocument = aaa
mstrTitle = pstrMsg
objT1 = New Threading.Thread(AddressOf sub__CallForm)
objT1.Start()
End Sub
Private Shared Sub sub__CallForm()
If mfrmFormIs Nothing Then
mfrmForm= New frmPageView2()
mfrmForm.Text = mstrTitle
mfrmForm.SetPageDocument(mobjDocument)
mfrmForm.Viewer1.LoadDocument(mobjDocument)
mfrmForm.ShowDialog()
End If
End Sub
Public Sub SetPageDocument(objDocument As GrapeCity.ActiveReports.Document.PageDocument)
Try
mobjDocument = objDocument
Catch ex As Exception
LogUtil.Fatal(Me, ex)
Exit Sub
End Try
End Sub
End Class
调用
Public Sub sub_PrintView(ByVal aa As GrapeCity.ActiveReports.Document.PageDocument, _
ByVal bb As String)
Try
frmPageView2.sub_CallForm(aa, bb)
Catch ex As Exception
LogUtil.Fatal(Me, ex)
Throw (ex)
End Try
End Sub