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

Getting values from multiple scopes

1 Answer 533 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 15 Dec 2016, 10:24 PM

I need to perform a calculation and show the result in the Page Header of my report.

The calculation comes from 3 different data sources:  The report-scoped data source, and 2 separate data sources that are being bound to 2 tables in the Report Footer.

I'm able to get the values I need from the report-scoped data source, as follows:

= exec("ReportName", sum(Fields.Amount))

I have not been able to determine how to access the fields from the other 2 data sources.  I've tried numerous ways to access the scope, but I always get "invalid scope" error.  I've tried:

= exec ("My2ndDataSourceName", sum(Fields.Amount))

= exec ("My2ndTableName", sum(Fields.Amount))

= exec ("ReportName.My2ndTableName", sum(Fields.Amount))

I can't find good examples in the documentation that describe how to access scopes other than the top-level "report" scope.

Thanks

 

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 16 Dec 2016, 02:46 PM
Hi Brian,

Please check Expressions Scope. The report and Table items are data items, and they define separate data scopes not accessible to each other.
The Exec function can be used in the current scope e.g. the report where the set scope is the report, or in a section where the set scope is the section, parent section or the report; but not in a Table item if the set scope of the function is the report or the container section, nor if the expression is used in a report section but the set scope is of a nested Table item.

The Page Exec function can be used in page sections, where the function needs an item from the page as scope and operates with the data visualized by the current physical page. For more details, check check Data functions and the attached demo report that can be previewed in the Standalone Report Designer of Telerik Reporting R3 2016.

Regards,
Stef
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
Brian
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or