Question

I want to show Telerik Report in Telerik ReportViewer in Asp.net page. I have create a Class Library Project and Telerik Report in it, configure correctly, it show data in preview. Also created an asp.net website and AddReference of class Library Project in it.

Now, how do I show Report in Telerik ReportViewer Control?

Was it helpful?

Solution

You can use the following code:

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        var instanceReportSource = new Telerik.Reporting.InstanceReportSource();
        instanceReportSource.ReportDocument = new YourClassLibrary.YourReport();
        this.ReportViewer1.ReportSource = instanceReportSource;
    }
}

You can also set the ReportSource declaratively from the ReportViewer properties.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top