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

Is the NeedDataSource Event Required?

1 Answer 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Timothy Kelley
Top achievements
Rank 1
Timothy Kelley asked on 17 Aug 2010, 11:57 PM

I'm creating a dashboard report where the data is coming from a non-standard source.

Is it necessary to use the NeedDataSource Event to bind the entire report? What if I didnt' want to use it at all..what would I loose?

In my case I need to query the source once and get the data for the entire report.
I was thinking it might be better in my case to get the data from the source and then call the NeedDataSource event for the individual items of the report(tables, lists and etc) instead of creating an object to build the entire report.

Seems like using the NeedDataSource event for the individual charts and other report items on the report would render faster because once the data has been retrieved the child report items could begin rendering at the same time.

Is there any reason I can't bypass the NeedDataSource for things like the Header for the report and just bind the items directly?

thanks,

Tim

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 Aug 2010, 11:54 AM
Hi Timothy,

Report sections (as the name suggests) are part of the report Data Item, thus they depend on its datasource in order to show data. Only Data items can accept datasource and have a NeedDataSource event used for programmatic binding. In order for a report item to show data bound data, its parent should have a DataObject, which in case of a report section is the report. You can find more information in the following articles:
Generally, if your datasource is going to be the same for all data items, you can easily accomplish this declaratively through the report designer by using the Bindings property. You can see this in action in the Product Catalog demo report, where the Table item is getting its data from the main report datasource.

Best wishes,
Steve
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
Tags
General Discussions
Asked by
Timothy Kelley
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or