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

Reuse DataSource for multiple parts of report

1 Answer 147 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 20 Dec 2016, 07:48 PM
I have a report that is made up of four different charts, that all use the same data, just grouped and displayed differently.  Originally, I had them all pointing to the same DataSource, but then found that it was running the same exact query four times, one for each part.  Then I came across this thread: http://www.telerik.com/forums/multiple-database-hits-for-same-datasource which seems to explain the solution.  I tried the proposed solution, which is setting the top-level Report's DataSource to the DataSource I want, and then for each part, setting a Binding of DataSource = ReportItem.DataObject .  However, what I get instead, is that the entire report is repeated multiple times, one for each row in the data.  Now the query is run way more than four times!  What is going on?  Why does the solution work differently now?  Did something change in the way it works?  How do we implement this now? 

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 21 Dec 2016, 11:20 AM
Hi Christopher,

When the report's DataSource property is set the Detail section will be repeated for each row from the data source. This means that if the Graph item is placed inside the Detail section it will be repeated for each row from report's data source.

The solution would be to place the Graph item inside the section that is repeated once, for GroupHeader section of a static group or ReportHeader section
More information about report sections is available in Report Structure help article.


Regards,
Katia
Telerik by Progress
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 Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Christopher
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or