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
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.
Peter
the Telerik team

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?
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

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