This is a migrated thread and some comments may be shown as answers.

Binding table in detail section at runtime

1 Answer 198 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 03 Jul 2012, 09:22 PM
I've a table item in the detail section of the report. I so far couldn't figure out how to bind just the table, not the entire report, to a data source at run time? Please advice how I can achieve this. Thanks.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 04 Jul 2012, 07:38 AM
Hello Jay,

The Table item is Data Item and has its own DataSource property, which can be set to one of our Data Source Components. Here is a sample code how you can set data source to a Table item from the invoking application (if that is what you mean):

protected void Button1_Click(object sender, EventArgs e)
        {
            Telerik.Reporting.InstanceReportSource reportsc = (Telerik.Reporting.InstanceReportSource)this.ReportViewer1.ReportSource;
            Telerik.Reporting.Table table = ((Telerik.Reporting.Report)reportsc.ReportDocument).Items.Find("table1", true)[0] as Telerik.Reporting.Table;
            table.DataSource = GetData();
        }


Kind regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Jay
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or