Results 1 to 9 of 9

Thread: How To Set Up CR 8.5 Report With VB6

  1. #1

    Thread Starter
    Addicted Member LeonX's Avatar
    Join Date
    Dec 2004
    Location
    Jakarta, Indonesia
    Posts
    172

    Question How To Set Up CR 8.5 Report With VB6

    Hi guys ...
    I using VB6 and CR8.5.
    Now I try to open a pre-design report which made using CR8.5 and saved as report file with .rpt extension.

    What references i should use to open this report? For your note, i don't want to use Crystal 8.5 Designer.

    Thanks in advance.
    Regards,
    Ferry

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How To Set Up CR 8.5 Report With VB6

    rpt files can only be opened and modified by using the Crystal Report Designer.

  3. #3
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: How To Set Up CR 8.5 Report With VB6

    Are you asking about what references to add to allow the user to print or view the report from your application using the Crystal APIs?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  4. #4

    Thread Starter
    Addicted Member LeonX's Avatar
    Join Date
    Dec 2004
    Location
    Jakarta, Indonesia
    Posts
    172

    Re: How To Set Up CR 8.5 Report With VB6

    I want to view the report on a new window using CR viewer.
    Regards,
    Ferry

  5. #5
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: How To Set Up CR 8.5 Report With VB6

    If using the CR Viewer OCX then Select Project--> Components --> Controls and select the Crystal report control (crystal32.ocx). This will add the view control to the tools. If you want to do it on your own then the API selections I use add the following references to the project: Crystal Report 7 ActiveX Designer Design Time Library (Internal) (craxddt.dll), Crystal Report 8.5 ActiveX Designer Design Time (craxdrt.dll), Crystal Reprot Engine 7 Object Library (cpeaut32.dll).
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  6. #6

    Thread Starter
    Addicted Member LeonX's Avatar
    Join Date
    Dec 2004
    Location
    Jakarta, Indonesia
    Posts
    172

    Re: How To Set Up CR 8.5 Report With VB6

    Well, a little confused about that. Can you give me an example project for this? Thanks.
    Regards,
    Ferry

  7. #7
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: How To Set Up CR 8.5 Report With VB6

    I will generate a small app using both methods later today and post.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  8. #8
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: How To Set Up CR 8.5 Report With VB6

    Here is an example using and OCX and API to display or print using CR 8.5, VB6 with an MSAccess 2000 DB backend. Hope it helps.
    Attached Files Attached Files
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  9. #9

    Thread Starter
    Addicted Member LeonX's Avatar
    Join Date
    Dec 2004
    Location
    Jakarta, Indonesia
    Posts
    172

    Re: How To Set Up CR 8.5 Report With VB6

    thanks for the code sample.

    i also try different way using craxdrt.dll, crviewer.dll, crviewer.oca.
    What the difference between using crystal report activex designer runtime library and crystal report engine object library?

    here is my code:
    VB Code:
    1. Dim crApp As New CRAXDRT.Application
    2. Dim crReport As New CRAXDRT.Report
    3.        
    4. Set crReport = crApp.OpenReport(App.Path & "\Reports\ICPShipment.rpt")
    5. frmViewer.crView.ReportSource = crReport
    6. frmViewer.crView.ViewReport
    7. frmViewer.Show vbModeless, Me
    8.  
    9. Set crReport = Nothing
    10. Set crApp = Nothing

    But i have problem with that code, why everytime i run that code always give me an error "server has not yet been opened"?
    But when i try to open an empty report, it just work fine.
    Last edited by LeonX; Sep 9th, 2005 at 07:18 AM.
    Regards,
    Ferry

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