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:
  1. Private Sub Form_Load()
  2.   Dim oApp As CRAXDRT.Application
  3.     Dim oReport As CRAXDRT.Report
  4.     Dim oRs As ADODB.Recordset
  5.     Dim sSQL As String
  6.  
  7.     sSQL = "SELECT * FROM Permits"
  8.     Set oRs = New ADODB.Recordset
  9.     Set oRs = oCnn.Execute(sSQL)
  10.     Set oApp = New CRAXDRT.Application
  11.     Set oReport = oApp.OpenReport(App.Path & "\Surface.", 1)
  12.     oReport.Database.SetDataSource oRs, 3, 1
  13.     crvMyCRViewer.ReportSource = oReport
  14.     crvMyCRViewer.ViewReport
  15. End Sub

If anyone has any good refernces or ideas they would be greatly appreciated.