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

SqlDataObject to Telerik.Reporting.Processing.Expressions.IHierarchicalData

4 Answers 224 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 15 Apr 2011, 07:23 PM
When previewing a report I get the following error:

Unable to cast object of type 'SqldataObject' to type 'Telerik.Reporting.Processing.Expressions.IHierarchicalData'

I have narrowed down the problem to a textbox that has

=Sum(Exec("group4",Fields.Amount1))

Any help is appreciated

4 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 19 Apr 2011, 07:24 PM
I have narrowed it down. It is an invalid scope exception. This is something I run into quite often. The only thing I've been able to successfully use as a scope is a whole report. Looking at the documentation on scope wasn't much help as to any special syntax to using a group as a scope other than indicating it can be done. Is there an example I can look at to further help me?
0
Steve
Telerik team
answered on 20 Apr 2011, 04:24 PM
Hi Andrew,

As duly noted in the description of the Exec function in the Functions help article, Exec is used mostly with aggregate expressions as a second parameter. So your correct expression should be:

= Exec("group4", Sum(Fields.Amount1))


Kind regards,
Steve
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
0
Andrew
Top achievements
Rank 1
answered on 26 Apr 2011, 06:35 PM
Thank you Steve, however my invalid scope exception still remains. I have looked in the group explorer to verify the name of my group. My current expression is:

= Exec("group3", Sum(Fields.Amount1))

To confirm the name further, I looked in the TabComFA.Designer.cs and saw the line:

this.group3.Name = "group3";

The expression, or rather the textbox with the expression, is contained in the report footer. 
0
Steve
Telerik team
answered on 28 Apr 2011, 04:46 PM
Hi Andrew,

This is expected. A named scope can be the name of a data item, or a group. You must specify the current scope or a containing scope; you cannot specify a scope that is lower or at the same level in containment order than the current scope. More information is available in the Expression scope help article.

Kind regards,
Steve
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
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Steve
Telerik team
Share this question
or