I have created a crystal reports viewer that handles multiple reports, but I have not been able to figure out how to pass the report objects as a parameter in the method. If I want to pass different types of report objects, what is the abstraction?
If RepString = "MonthlyAcc" Then
Dim MyReport As New MonthlyReportName
MyReport.SetParameterValue("ParameterName", ParmValue)
Else
If RepString = "YearlyAcc" Then
Dim MyReport As New YearlyReportName2
MyReport.SetParameterValue("ParameterName", ParmValue)
End If
End If
CRviewer1.ReportSource = MyReport
Select Case RepString
Case "MonthlyAcc"
Dim MyReport As New MonthlyReportName
MyReport.SetParameterValue("ParameterName", ParmValue)
Case "YearlyAcc"
Dim MyReport As New YearlyReportName2
MyReport.SetParameterValue("ParameterName", ParmValue)
Case Else
'Statements executed if no Case value is = variable
End Select
CRviewer1.ReportSource = MyReport