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:
I'm using the following code to render the report:
vb Code:
Private Sub RenderReport() 'The Crystal Reports "application" to hold the CRReport and control the viewer Dim vl_CRApp_cra As CRAXDRT.Application 'The Crystal Reports "CRReport" containing the CRReport itself and any changes Dim vl_CRRep_cra As CRAXDRT.Report 'Initialize objects 'On Error GoTo RenderReport_Error Stack.Push "RenderReport" Set vl_CRApp_cra = New CRAXDRT.Application Set vl_CRRep_cra = New CRAXDRT.Report 'Ensure that parameters are entered and file exists If (SourceFile <> vbNullString) And (Dir(SourceFile) <> vbNullString) Then 'Open the CRReport Set vl_CRRep_cra = vl_CRApp_cra.OpenReport(SourceFile) vl_CRRep_cra.RecordSelectionFormula = SelectionFormula vl_CRRep_cra.DiscardSavedData vl_CRRep_cra.Database.SetDataSource DataSource 'Set the selection formula on the CRReport CRReport.ReportSource = vl_CRRep_cra RefreshReport Else MsgBox "Invalid parameters" End If Set vl_CRApp_cra = Nothing Set vl_CRRep_cra = Nothing CleanUp: On Error GoTo 0 Stack.Pop Exit Sub RenderReport_Error: ErrHandler "frmCRX", "Form", "Sub", "RenderReport", Erl 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.




Reply With Quote