Question

I have created a Telerik report and I am setting the datasource on runtime to an object with some properties and a List. I am using the properties in the page and report header sections and i want to use the list as the details. Now the problem is binding to the List's item properties in the details section. I have played around with the expression builder and it seems that i should access the properties like this :

[=Fields.myList.Item.myProperty]

when i run the program i get a nice big red rectangle with the following error :

An error has occured while processing TextBox 'textBox28':Common Language Runtime detected an invalid program.

I have tried to change different variants of expression which also gives me other errors

[=Fields.myList.myPropery]

An error has occured while processing TextBox 'textBox28': The expression contains object 'myProperty' that is not defined in the current context.

The closest i have gotton was with the object it self, which outputs the object.toString()

[=Fields.myList]
Was it helpful?

Solution

I found a working solution although not what i was looking for, I created my own class with properties and made a List. I then retrieved the data from the db did the changes i wanted to do in the class and set the datasource of the report to the list. This is working quite well.

OTHER TIPS

I struggled with this error:

An error has occured while processing TextBox 'textBox28': The expression contains object 'myProperty' that is not defined in the current context.

The solution I came up with was to make my model object inherit from List. For example:

public class MyReportModel : List<MyEntityDto> {
}

The look of the report wizard makes it seem like this isn't necessary, but I found no other way around this error.

This is for Telerik Reporting Q3 2013.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top