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

Exception in nested property

6 Answers 94 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eastern
Top achievements
Rank 1
Eastern asked on 05 Oct 2010, 11:32 AM
i am using telerik reporting 2010 Q2 trial version .

i put a textbox and bind it to Fields.A.B.C.Name with objectdatastore
but it says :
the expression contains object 'Name' that is not defined in the current context

what is the problem and how can i solve it ?

6 Answers, 1 is accepted

Sort by
0
Eastern
Top achievements
Rank 1
answered on 06 Oct 2010, 04:57 PM
any help or support ?
0
Steve
Telerik team
answered on 07 Oct 2010, 04:31 PM
Hi Eastern,

By design, properties from all levels are visible, except properties that are collections. In your setup - when you have an expression =Fields.A.B.C.Name, if B is a collection, how do we know for which B which C should we display?

In this line of thoughts, if you want to show data from this collection, you should use a separate data region (i.e. Table or SubReport) and provide this collection as its data source. You can see such implementation in the following forum thread: Data Source Business Objects.

Greetings,
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
Eastern
Top achievements
Rank 1
answered on 08 Oct 2010, 08:11 PM
i found the source of problem,

i am using the XPO ORM for my Data access layer, i dont know what is the problem exactly, but the problem is that all the objects inherit from XPObject of XPO , so i think its the source of this problem.

is there any known issue with telerik reporting and XPO ORM ?
0
Eastern
Top achievements
Rank 1
answered on 10 Oct 2010, 07:47 AM

is there any known issue with telerik reporting and XPO ORM ?
0
Eastern
Top achievements
Rank 1
answered on 10 Oct 2010, 10:55 AM
Okay Telerik support Team,

i found the source of problem, here it is :
Telerik Reporting is using Propertydescriptor to access the property values and evaluate the expressions.
in the Devexpress XPO , when creating new propertydescriptor by default it replace all the reference relations with a Collection object.( replacing the A relation property with XPCollection() {A} ). so that telerik cannot access to object because it is in a collection.

there is a workaround for it , if the propertyname endswith "!" or "!Key" , the XPO doesn't make that Collection and leave relation properties. BUT the telerik reporting Lexer cannot parse "!" symbol at the end of properties and throw exception for Unknown Token.

so Telerik Reporting cannot work with XPO ORM because of this problem,

1solution that i can say is that telerik reporting have an escape character array that i can add "!" to them and Lexer do not care about it and treat it as a normal letter character.
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 11 Oct 2010, 07:47 AM
In the presence of telerik's own ORM (Open Access) for which Telerik Reporting has extensive support and a DataSource component for the Entity Framework, I don't think that it is a priority to include "feature" like escaping ! character, which IMHO should not be used in a first place. Second XPO is competitors product, i.e. probably the guys @ telerik would not be very excited to work on such support.

In short, my suggestion would be switching to Entity Framework or Open Access for your ORM needs, if you want to get somewhere fast with Telerik Reporting.

Cheers!
Tags
General Discussions
Asked by
Eastern
Top achievements
Rank 1
Answers by
Eastern
Top achievements
Rank 1
Steve
Telerik team
Massimiliano Bassili
Top achievements
Rank 1
Share this question
or