Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top