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

One DataSource, 2 Report Items

1 Answer 25 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Veteran
sitefinitysteve asked on 16 Nov 2010, 03:08 PM
Ok, lets say in my report I setup a SqlDS which points to a stored procedure

Then inside the Detail portion I drop in a crosstab wizard and a table wizard and link them into the SQLDS

Is the SqlDS being called twice?

I'm running into a problem right now where if I add in the table I go from 3 second report generation to infinite generating icon.

(The DS is 21,000 rows)

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 19 Nov 2010, 04:10 PM
Hi Steve,

Currently the data is being retrieved for every report data item. The declarative DataSource components don't store the data in order to avoid large memory allocation. Generally retrieving 21000 rows of data should take a few seconds, thus in most cases retrieving data is not the bottleneck, but the actual rendering. However if in your case retrieving the data is time consuming operation our suggestion is to create a method with some custom logic that will fill a dataset just once and use the table's NeedDataSource event to call your methods and set the datasource as shown in the following code snippet:

private void table1_NeedDataSource(object sender, EventArgs e)
{
    ((Telerik.Reporting.Processing.Table)sender).DataSource = this.getData();
}
  
private void table2_NeedDataSource(object sender, EventArgs e)
{
    ((Telerik.Reporting.Processing.Table)sender).DataSource = this.getData();
}
  
private object getData()
{
    if (this.productCatalogDataSet.ProductCatalogDataSetTable.Count == 0)
    {
        this.productCatalogDataSetTableAdapter1.Fill(this.productCatalogDataSet.ProductCatalogDataSetTable);
    }
  
    return this.productCatalogDataSet.ProductCatalogDataSetTable;
}

Greetings,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Veteran
Answers by
Peter
Telerik team
Share this question
or