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?

Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top