Hi Guys,This may (or not) help but we use DevExpress and I wanted a generic front end to all our DeVExpress reports that collects the data selection criteria for each report then instantiates the report and I didn't want to hard code anything. The starting point for this was to be able to find all DevExpress reports in a Solution. I couldn't figure out how to do this so I asked DevExpress support who supplied the following code.
Private Sub CreateReportInstance(ByVal ReportName As String, ByRef Report As DevExpress.XtraReports.UI.XtraReport)
Dim asm As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
' Find all reports and assign the instance of the report name we are looking for
For Each type As Type In asm.GetTypes()
If type.IsSubclassOf(GetType(DevExpress.XtraReports.UI.XtraReport)) Then
If (type.Name = ReportName) Then
Dim myReport As DevExpress.XtraReports.UI.XtraReport = CType(Activator.CreateInstance(type, False), DevExpress.XtraReports.UI.XtraReport)
Report = myReport
Exit For
End If
End If
Next type
End Sub
BTW - DevExpress and StrataFrame offer the best support it has ever been my pleasure to come across.
Cheers, Peter