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

Datasource Binding Problem

5 Answers 220 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jasper
Top achievements
Rank 1
Jasper asked on 31 Aug 2010, 12:52 PM
Hi,

I'm trying to populate a table with a DataTable object.

private void detailTable_NeedDataSource(object sender, EventArgs e)
{
    (sender as Telerik.Reporting.Processing.Table).DataSource = OrderDetails;
}

Unfortunately nothing happeens, the table is empty. I've searched the forum and docs for any explanation or solution, but I was not able to figure out how to put the data at runtime into the table.

Any suggestions whats wrong with my code?

PS: I found a forum post which stated that I have to use a parameterless constructor. If I do so, to problem remains the same. No data shows up.

5 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 02 Sep 2010, 09:34 AM
Hi Jasper,

The code you have provided looks correct. However be aware that a NeedDataSource event fires only when the data item (Table) does not have data source set.

Check out the attached sample report that is using a NeedDataSource event to populate a Table item with a DataTable object.

Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jasper
Top achievements
Rank 1
answered on 02 Sep 2010, 12:52 PM
Thanks, could solve this.

Am I right in thinking, that it is not possible (out of the box) to bind any datasource to a table and populate it automatically at runtime without defining the fields/columns at design time before?
0
Accepted
Peter
Telerik team
answered on 03 Sep 2010, 12:13 PM
Hi Jasper,

You are correct -  the Table item needs a definition and doesn't support auto generation out of box . However there is a workaround available. Please check out the "Dynamic" Table in Telerik Reports article that elaborates on the topic.

Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Binod Kumar
Top achievements
Rank 1
answered on 17 Oct 2011, 07:35 AM
Hi,
I am trying to use same DataSource For Both table and Report. But when I use same datasource then the table is repeated for each data item of the report datasource. Again i tried to Bind the table with report datasource by using ReportItem.DataObject Expression but still the table is repeated.
I want details shouldn't repeat in table if i bind it with report data source.
Any Suggestion What Shall I Do?
0
Peter
Telerik team
answered on 19 Oct 2011, 04:13 PM
Hello Binod Kumar,

Generally a detail section is printed once for every data record. Thus if you want to have only one table instance our suggestion is to move the table item to a non repeater section such as an unbound group (group without grouping) footer/header section.

Greetings,
Peter
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

Tags
General Discussions
Asked by
Jasper
Top achievements
Rank 1
Answers by
Peter
Telerik team
Jasper
Top achievements
Rank 1
Binod Kumar
Top achievements
Rank 1
Share this question
or