Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cr Designer, VB, ActiveX, and Run-Time error 438

Status
Not open for further replies.

BrettaThompson

Programmer
Jun 12, 2002
1
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top