Loading Reports Dynamically by Name

2 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    57 posts
    Member since:
    Jun 2012

    Posted 20 Jul 2009 Link to this post

    I am trying to setup a asp.net page that can run a report based on a report name in the querystring. How can I make this happen?

    I tried this
    Dim ReportName As String = Request.QueryString("Report")  
            If ReportName IsNot Nothing Then 
                Dim r As Telerik.Reporting.Report = Activator.CreateInstance(Type.GetType("MyReportProject." & ReportName))  
                ReportViewer1.Report = r  
            End If 

    But it doesn't seem to work. Any ideas?
  2. Jonathan
    Jonathan avatar
    57 posts
    Member since:
    Jun 2012

    Posted 20 Jul 2009 Link to this post

    Figured it out:
    Dim r As Telerik.Reporting.Report = Activator.CreateInstance(Reflection.Assembly.Load("MyReportProject).GetType("MyReportProject." & ReportName)) 
  3. DevCraft banner
Back to Top