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

How can multiple charts share a datasource?

1 Answer 235 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Samuel Santiago
Top achievements
Rank 1
Samuel Santiago asked on 17 Sep 2010, 08:45 PM
I have a report with two charts on it.  The report has a particular datasource and the charts have a different datasource, but both charts use the same.  The Stored Procedure for the charts is called twice - once for each chart.  I was hoping to prevent this behavior.  Is there anyway to bind the 2nd charts datasource to the first chart?  I found this article:

http://www.telerik.com/community/forums/reporting/telerik-reporting/set-datasource-of-table-same-as-report-data-source.aspx

Which talks about sharing the Report's datasource.  I have not been able to figure out how to get two child objects (the charts) to share a datasource.  Any ideas out there?  Any tips greatly appreciated.

Thanks,

Sam

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 22 Sep 2010, 09:40 AM
Hi Samuel Santiago,

Currently the SqlDataSource is retrieving the data for every data item and we do not cache the retrieved data. If your stored procedure is slowing down the report you have two options:

  • The article you've referenced explains how to use the same datasource for a container data item (the report) and a Table item and this is not applicable for your scenario. However if you haven't set a datasource to the report itself you can move your charts to the Report Header, set the SqlDataSource to the report and use the Bindings property of the Chart items to bind it to the same datasource as the report by using the following expression: =ReportItem.DataObject.
  • Another solution will be to retrieve your data in a collection and bind the Charts to an ObjectDataSource component.
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
Tags
General Discussions
Asked by
Samuel Santiago
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or