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

Does anyone know how to connect to Crystal XI using VB 6?

Status
Not open for further replies.

mpodlesny

Programmer
Mar 23, 2005
24
US
I want to run a report created in Crystal XI developer edition through VB 6 code. Does anyone know how or can you point me in the right direction?
 
Add a reference to the Crystal Reports ActiveX Designer Run Time Library 11.0 (craxdrt.dll). From Project > Components, add the Crystal ActiveX Report Viewer Library 11.0 (crviewer.dll).

The minimum code to open a report, and send it to a CR ActiveX Viewer:
Code:
'General Declarations
Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report

Private Sub Form_Load()

'Open the report
Set crxRpt = crxApp.OpenReport(App.Path & "\Reports\Profile.rpt")

'Clear any saved data to force to report to read from the db
crxRpt.DiscardSavedData

'Set login information for the report here, if necessary

'View the report
CRViewer.ReportSource = crxRpt
CRViewer.ViewReport

You can download the sample RDC apps for CR 10 (which will work with CR XI) here.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top