using System;
using System.Reflection;
using System.Web.UI;
using Telerik.Reporting;

public partial class ReportViewer : Page
{   
    
	protected void Page_Load(object sender, EventArgs e)
	{        	    
        string reportName = Server.UrlDecode(this.Request.QueryString["ReportName"]);
	    
	    if (!string.IsNullOrEmpty(reportName))
        {
            Type reportType = Type.GetType(reportName);
            ConstructorInfo ctor= reportType.GetConstructor(new Type[] { typeof(string) });
            Report report = (Report)ctor.Invoke(new object[] { "my custom value" });
            //Report report = (Report)Activator.CreateInstance(reportType);
            //report.ReportParameters["MyParameter"].Value = this.Request.QueryString["MyReportParameterValue"];
            this.ReportViewer1.Report = report;
            this.Page.Title = "telerik Report Viewer - " + reportType.Name;
        }	    
	}   
}
