Results 1 to 2 of 2

Thread: Using an external .RPT file with RDC in VB6 **RESOLVED**

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Location
    So. Cal., USA
    Posts
    11

    Arrow Using an external .RPT file with RDC in VB6 **RESOLVED**

    I am trying to use an existing .RPT file from within the Report Designer Component in VB6. The code I'm using is code I've seen in multiple places (books, forums, etc.) yet it does not work. I get an error message back saying "Server has not yet been opened."

    According to the Crystal Reports Support site, this error is caused by an invalid database connection. I already have a database connection opened and used by the time I get to the report, and the report itself has all (?) of the connection info. The report was created using Crystal Reports Developer 8.5.

    I've tried creating another connection from within the form, but without success.

    Here is my current code:

    VB Code:
    1. Dim Application As CRAXDRT.Application
    2. Dim Report As CRAXDRT.Report
    3.  
    4. Private Sub Form_Load()
    5.     Screen.MousePointer = vbHourglass
    6.     Set Application = CreateObject("CrystalRuntime.Application")
    7.     Set Report = Application.OpenReport(App.Path & "\reports\ticketless.rpt")
    8.     CRViewer1.ReportSource = Report
    9.     CRViewer1.ViewReport
    10.     Screen.MousePointer = vbDefault
    11. End Sub
    12.  
    13. Private Sub Form_Resize()
    14.     CRViewer1.Top = 0
    15.     CRViewer1.Left = 0
    16.     CRViewer1.Height = ScaleHeight
    17.     CRViewer1.Width = ScaleWidth
    18. End Sub

    Any help is greatly appreciated! Thanks
    Last edited by wileecoyote; Apr 1st, 2003 at 05:32 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width