using System;
using System.Reflection;
using Telerik.Reporting;
using Telerik.Reporting.Examples.CSharp;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!Page.IsPostBack)
            //this.ReportViewer1.Report = new BarcodesReport();
    }


    public void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
    {
        //create an report instance from the assembly qualified name
        Type reportType = Type.GetType(e.Value);
        //Report report = (Report)Activator.CreateInstance(reportType);
        ConstructorInfo ctor = reportType.GetConstructor(new Type[] { typeof(string) });
        Report report = (Report)ctor.Invoke(new object[] { "my custom value" });

        //check the report type and set report parameter value
        //if(report is ReportParameterDemo)
        //{
        //    report.ReportParameters["Parameter1"].Value = "Test the runtime value";
        //}

        //set the report 
        this.ReportViewer1.Report = report;
    }

}
