BrettaThompson
Programmer
Let me preface this by saying I'm quite new to VB and very new to CR.
I have successfully created a vb form with the cr designer and viewer objects. Now I want to place the designer object only on a user control so that it can be accessed via Visual FoxPro.
The code:
User control:
(Project references include "Crystal Report Viewer Control", "Crystal Reports 8.5 ActiveX Designer Run Time Library", "Crystal Reports 8.5 ActiveX Designer Design and Runtime Library", "Embeddable Crystal reports 8.5 Designer Control".)
Dim m_crdReportObject As String
Public Property Get ReportObject() As String
ReportObject = m_crdReportObject
End Property
Public Property Let ReportObject(vNewValue As String)
m_crdReportObject = vNewValue
End Property
Form:
Dim m_Application As New CRAXDDRT.Application
Dim m_Report As CRAXDDRT.Report
Public Sub Form1_DisplayReport()
Set m_Report = Nothing
Set m_Report = m_Application.NewReport
*next line is where error occurs*
CrystalDesigner1.ReportObject = m_Report
End Sub
Private Sub Command1_Click()
Call Form1_DisplayReport
End Sub
No matter which value I expose the ReportObject property as on the user control (Object, String, Variant) I get this error at run time(i.e on the form): "Run-time error '438': Object doesn't support this property or method".
The property is exposed, as stepping through the code CrystalDesigner1.ReportObject shows the following right before the bomb. Included the type value as it dictates what appears when you hover over the ReportObject property.
String: ""
Variant: Empty
Object: <Object variable or With Block variable not set>
I've found an article or two on the cr website that has the error but not that is applicable to my problem. Any ideas on how to correct that error so that I can create and edit a new report at run time?
Tia for the help!
Brett Thompson
I have successfully created a vb form with the cr designer and viewer objects. Now I want to place the designer object only on a user control so that it can be accessed via Visual FoxPro.
The code:
User control:
(Project references include "Crystal Report Viewer Control", "Crystal Reports 8.5 ActiveX Designer Run Time Library", "Crystal Reports 8.5 ActiveX Designer Design and Runtime Library", "Embeddable Crystal reports 8.5 Designer Control".)
Dim m_crdReportObject As String
Public Property Get ReportObject() As String
ReportObject = m_crdReportObject
End Property
Public Property Let ReportObject(vNewValue As String)
m_crdReportObject = vNewValue
End Property
Form:
Dim m_Application As New CRAXDDRT.Application
Dim m_Report As CRAXDDRT.Report
Public Sub Form1_DisplayReport()
Set m_Report = Nothing
Set m_Report = m_Application.NewReport
*next line is where error occurs*
CrystalDesigner1.ReportObject = m_Report
End Sub
Private Sub Command1_Click()
Call Form1_DisplayReport
End Sub
No matter which value I expose the ReportObject property as on the user control (Object, String, Variant) I get this error at run time(i.e on the form): "Run-time error '438': Object doesn't support this property or method".
The property is exposed, as stepping through the code CrystalDesigner1.ReportObject shows the following right before the bomb. Included the type value as it dictates what appears when you hover over the ReportObject property.
String: ""
Variant: Empty
Object: <Object variable or With Block variable not set>
I've found an article or two on the cr website that has the error but not that is applicable to my problem. Any ideas on how to correct that error so that I can create and edit a new report at run time?
Tia for the help!
Brett Thompson