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

Report calling code multiple times

1 Answer 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tobania
Top achievements
Rank 1
Tobania asked on 10 Jan 2013, 03:31 PM
Hey,

I have a report with a table and a chart for each column in this table. All these objects use the same Objectdatasource set from the designer. The problem is that the code behind this datasource is called once foreach object. In my case this is 5 times. 

The data returned is always the same so why is the code called once for each object that uses this datasource ?

How can i solve this problem?

if have added a screenshot of the report

Thanks in advance
Sodi We

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 11 Jan 2013, 11:47 AM
Hello Sodi We,

The data source components are declarative and they only specify how to obtain the data for the data item. They don't store or cache the data. Thus they are invoked once for every data item that is referencing the data source components. Additionally have in mind that the datasource parameters support expressions that can be report item contextual. In this line of thoughts if your data member execution is time and resource expensive our suggestion is implement in your DAL a data source caching mechanism.

All the best,
Peter
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

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