Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top