Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Help with VB and Crystal 8

Help with VB and Crystal 8

Help with VB and Crystal 8

I am new to VB, but wish to call my reports from inside a VB program, rather than using the compiler (downloadable patch for CR8).

I have absolutely no idea of how to do this, although I now it can be done. Is there anyone who can help me. I also do not particularly want to use the CR Web viewer either. Please tell me I have other options.

Thanks in advance

RE: Help with VB and Crystal 8

I don't know if this will help but the following code works in VB and Access.  It opens an existing report, refreshes the data, and then saves a new copy.  You will have to change it just to display the report, but this will give you some idea how the process works.
P.S. you have to add the crystal reports engine as a reference in your VB Project.
Hope this helps.

    Dim Rs As Recordset
    Dim strStartDirectory As String
    Dim strEndDirectory As String
    Dim strFile As String
    Dim crpApplication As CRPEAuto.Application
    Dim crpReport As CRPEAuto.Report
    Set crpApplication = CreateObject("Crystal.CRPE.Application")
    Set crpReport = crpApplication.OpenReport(strStartDirectory & "\" & Rs!ReportName)
    crpReport.ExportOptions.DiskFileName = strEndDirectory & "\" & Rs!ReportName
    crpReport.ExportOptions.DestinationType = crEDTDiskFile
    crpReport.ExportOptions.FormatType crEFTCrystalReport
    crpReport.Export (False)

RE: Help with VB and Crystal 8

There are 4 differnt ways to launch CR from VB, some are simple, others are more sophisticated.   The CR8 developers guide should give you some ideas.  There are also 3rd party books you can buy, including my own , that give an overview.

You do have the developer's edition, don't you?

Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close