For some reason there arent many CR XI resources available. As a matter of fact, Robdogg's code on the forums is about all I could find when it came to attaching data to the CRViwer. The only problem is it says my object is not defined, and it is talking about CRAXDRT being not referenced(I assume that is the crystal reports viewer control).
Main problem.
I have CR XI and I am using Crystal Reports Active X Viewing Control and i cant find any help on getting it to view a report through visual basic. The only code i could find came from robdogg and i got a referencing error. Maybe it is because I am missing a .dll *exp craxdrt.dll
I honestly dont know.
Here is the code i attempted to use:
VB Code:
Private Sub Form_Load()
Dim oApp As CRAXDRT.Application
Dim oReport As CRAXDRT.Report
Dim oRs As ADODB.Recordset
Dim sSQL As String
sSQL = "SELECT * FROM Permits"
Set oRs = New ADODB.Recordset
Set oRs = oCnn.Execute(sSQL)
Set oApp = New CRAXDRT.Application
Set oReport = oApp.OpenReport(App.Path & "\Surface.", 1)
oReport.Database.SetDataSource oRs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
End Sub
If anyone has any good refernces or ideas they would be greatly appreciated.