Hello.
I'm trying to open a Crystal Report that was originally made in CR5 in a CRX viewer. I plan to port all reports into CRX, so I wanted to use the CRX viewer instead of the CR5 one.

I'm getting this message when I try to open my report:
Name:  3-20-2009 11-57-45 AM.jpg
Views: 574
Size:  35.6 KB

I'm using the following code to render the report:
vb Code:
  1. Private Sub RenderReport()
  2. 'The Crystal Reports "application" to hold the CRReport and control the viewer
  3. Dim vl_CRApp_cra As CRAXDRT.Application
  4. 'The Crystal Reports "CRReport" containing the CRReport itself and any changes
  5. Dim vl_CRRep_cra As CRAXDRT.Report
  6.  
  7.  
  8. 'Initialize objects
  9.    'On Error GoTo RenderReport_Error
  10.    Stack.Push "RenderReport"
  11.  
  12. Set vl_CRApp_cra = New CRAXDRT.Application
  13. Set vl_CRRep_cra = New CRAXDRT.Report
  14.  
  15.  
  16. 'Ensure that parameters are entered and file exists
  17. If (SourceFile <> vbNullString) And (Dir(SourceFile) <> vbNullString) Then
  18.    
  19.     'Open the CRReport
  20.     Set vl_CRRep_cra = vl_CRApp_cra.OpenReport(SourceFile)
  21.    
  22.     vl_CRRep_cra.RecordSelectionFormula = SelectionFormula
  23.     vl_CRRep_cra.DiscardSavedData
  24.     vl_CRRep_cra.Database.SetDataSource DataSource
  25.    
  26.    
  27.    
  28.     'Set the selection formula on the CRReport
  29.     CRReport.ReportSource = vl_CRRep_cra
  30.    
  31.    
  32.     RefreshReport
  33. Else
  34.     MsgBox "Invalid parameters"
  35. End If
  36.  
  37. Set vl_CRApp_cra = Nothing
  38. Set vl_CRRep_cra = Nothing
  39.  
  40.  
  41. CleanUp:
  42.    On Error GoTo 0
  43.    Stack.Pop
  44.    Exit Sub
  45.  
  46. RenderReport_Error:
  47.  
  48. ErrHandler "frmCRX", "Form", "Sub", "RenderReport", Erl
  49.  
  50. End Sub

My thought is that perhaps I'm not setting the report's database location properly. I assume I'm supposed to be using SetDataSource - since it makes sense that the report would want to pull info straight from a recordset.
Is there another property in which I would specify a database file name? I'm a n3wb to the CRX SDK.