||There are alot of ways to use Crystal Reports from VBA, or VB, or any other ActiveX or COM compatible Language. You need to set a few references in your project if you want to have your report open in the crystal reports main program. OR you can simply place the crystal reports viewer activex control on a form and have you rreport be view from there, with the ability to print and a few other things. Simple interface too. If you just browse your references list you will see several Crystal Reports entries, and the viewer control is even listed under your controls list too, just take a look. Some keywords you can search for on the internet to find information on how to use all of these things are: Report Viewer Component; crviewer; Crystal Reports ActiveX Designer Run Time Library (this is also the reference you need to set to use it); Create TTX files (you will need to find out about this if you want to use Active (Live) Data in your reports); CRAXDRT (this is the name of the core that all of the objects that you use are derived from)...
Below I'm posting some sample code on how to view a simple report with the Report Viewer Control, any questions, just post back.
' You must first initialize the Main Application Object, this is much like opening the Crystal Reports program
Dim crApp As CRAXDRT.Application
Set crApp = New CRAXDRT.Application
' Then you must initialize the Main Report Object, this is like opening a report in the Crystal Reports program
Dim crReport As CRAXDRT.Report
Set crReport = crApp.OpenReport("C:\Test.rpt")
' This sometimes improves the loading time for large reports.
crReport.UseIndexForSpeed = True
' Since we are assuming then our report uses Active Data (takes an ADO Recordset as it's data source, see "TTX files")
' We need to get a reference to the database tables that the report is going to use.
Dim crTables As CRAXDRT.DatabaseTables
Set crTables = crReport.Database.Tables
' Next we need take a specific table, in this case, since we are going to assume there is only one Active Data source,
' there is only one source table in the report, so we take the first table.
Dim crTable As CRAXDRT.DatabaseTable
Set crTable = crTables.Item(1)
' Using the first table's reference, we set it's data source to a recordset (pRecordset is an ADO recordset) that we have
' previously initialize in our program. The second parameter is always going to be 3, regardless.
' I cannot remember if you can use ArcObjects recordsets here, but I believe you can, I have used this coding in an ArcObject
' VBA program before, so there IS a way.
crTable.SetDataSource pRecordset, 3
' Load the form that has the Crystal Reports Viewer Control (named: crvMain)
' Set the Report Viewer's Report Source property to our Main Report Object
frmView.crvMain.ReportSource = crReport
' I like to set the form's caption to include the title of the report, you can access many of the reports properties at
' this point
frmView.Caption = "Crystal Reports Viewer - [ " & crReport.ReportTitle & " ]"
' This call actually loads the report, and loads all of the data into the template. This is like going from design-time to
' Show the form, you may want to call this before calling the ViewReport method, but you wont be able to make it Modal