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!

Setting the data source on the fly with VB

Status
Not open for further replies.

freewilly

Programmer
Feb 19, 2001
43
AU
I want to dynamically create a recordset and get Crystal to use this as its data source.
How do I do this?
 
In the code module of a form that has the Crystal Reports Viewer component:

Code:
Dim mReport As CRAXDRT.Report
Dim rst as new ADODB.Recordset

' Uses the Crystal RDC 
Set mReport = New CR_TRANSACTION_RPT

' Get ADODB Recordset here
'          .
'          .

mReport.Database.SetDataSource rst    

'CRViewer on this VBForm
CRViewer1.ReportSource = mReport
Me.Caption = mReport.ReportTitle
CRViewer1.Zoom (100)
CRViewer1.ViewReport

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top