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

Report with ObjectDataSource and Navigation Property

3 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joan
Top achievements
Rank 1
Joan asked on 09 Apr 2013, 09:06 AM
Hi Telerik Team.
I am new on Telerik reporting and I have looked for any information about what I want to do but any success.
I am trying to do a report which the source is an object I create from my model, which model has a navigation property which is a collection.
For example I create an Object ClassRoom(name, grade, code, amount students, etc) and I have a collection of student belong to that ClassRoom (which is a navigation property in my model), I also have a navigation property in my Entity Studen which is subjtects (Math, English, Spanish, etc), when I create my Object ClassRoom (my datasource) I CANT access to the collections when I am doing my report.
Please if someone can tell me what can I do? I would like to show in my report for example:

ClassRoom 1
Grade First
Code CLAS001
Amount Student 30

Details
Peter   12 years old   Math-9   English-8  Spanish-6
Tom     12 years old   Math-9   English-8  Spanish-6
Pep     12 years old   Math-9   English-8  Spanish-6
Rick     12 years old   Math-9   English-8  Spanish-6

In other things my Object is this was: ClassRoom has Students and Students has Subjects (there are navigation properties collections)
Thanks in advance!

3 Answers, 1 is accepted

Sort by
0
Joan
Top achievements
Rank 1
answered on 09 Apr 2013, 09:29 AM
I hope you understand what I mean.
I dont want to do two subreports, just wnat to merge the Students and Subjects, just one Main Report and Subreport. If anyone can tell me how could I do that? Thanks!
0
Joan
Top achievements
Rank 1
answered on 09 Apr 2013, 12:55 PM
:(  Please telerik team, give me a hand...I really dont know how could i do that...I know how to do a subreport, but what I want is to merge the Students with the Subjects...hope can help me.
Thanks
0
Peter
Telerik team
answered on 11 Apr 2013, 03:06 PM
Hi Joan,

Do you use the EntityDataSource component? Generally the used EF Model should be located in a separate class library in order for the report designer and the report wizards to work properly. Additionally you will have to copy the connection string to the App.config file of the report class library, so that Entity Framework can find your database at design-time.

In order to use nested collections our suggestion is to nest data items (subreports, table,list,crosstab, chart or graph) and set the data items' datasource property with binding to the field representing the complex type. In case of nested table/crosstab/list the nested item should be placed inside a panel item. This way the nested collection is accessible as normal field. Please review the following forum thread that elaborates on your inquiry: Data Source Business Objects.

All the best,
Peter
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
Joan
Top achievements
Rank 1
Answers by
Joan
Top achievements
Rank 1
Peter
Telerik team
Share this question
or