Bind a property of a child using rdlc (Report)

I have a custom object say "objMain" in which I have several properties, as well as a property of an object type (for example, as a child object).

objMain has the following properties: 1. Name [type: string] 2. Description [type: string] 3. StartDate [type: date and time] 4. ObjSubject [type: object] is a special type

ObjAddress has these properties 1. SubjectID [type: int] 2. SubjectName [type: string]

I need to display the Name, Description, Starting Date, and SubjectNames associated with this name. It displays data in the Name, Description, and startdate fields, but does not appear in the SubjectName field.

Here is how I want to show:

Name | Description | StartDate | Subjectname

Amod Kumar ABCDEFG 08/19/2009 Physics Chemistry Mathematics

But the result is as follows

Name | Description | StartDate | Subjectname

Amod Kumar ABCDEFG 08/08/2009

Can any body tell me how I do it. I also tried to show only SubjectName in the table, it does not show anything in the report. I define both data sources for the report ie For objMain and ObjSubject.

+4
source share
2 answers
=Fields!ObjSubject.Value.SubjectName 

This expression in the text box in the report should give you a nested value.

+1
source
  • Make a partial class of your base class
  • Make a new property
  • Define the logic in getter and setter using the property of your nested object
  • Then add it to the rdlc report, like any other property of your base class
+1
source

All Articles