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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with VB and Crystal 8

Status
Not open for further replies.

marabou

IS-IT--Management
Jan 12, 2001
86
0
0
GB
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
 
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.
Harry

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.DiscardSavedData
crpReport.ExportOptions.DiskFileName = strEndDirectory & "\" & Rs!ReportName
crpReport.ExportOptions.DestinationType = crEDTDiskFile
crpReport.ExportOptions.FormatType crEFTCrystalReport
crpReport.Export (False)
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top