Bind child object property with in rdlc (Report)

白昼怎懂夜的黑 提交于 2019-12-20 01:36:05

问题


I have a custom object say "objMain" in which i have few properties and also the property of object type (i.e. like a child object).

objMain has these properties: 1. Name [type: string] 2. Description [type: string] 3. StartDate [type: datetime] 4. ObjSubject [type: object] - this is of custom type

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

I need to display Name, description, startdate and SubjectNames related to that name. It show the data in Name, description and startdate field but not is shown in the SubjectName field.

This is how i want to show:

Name | Description | StartDate | SubjectName

Amod Kumar ABCDEFG 19/08/2009 Physics Chemistry Maths

But result appears like this

Name | Description | StartDate | SubjectName

Amod Kumar ABCDEFG 19/08/2009

Can any body tell me how i do this. I also tried to show only the SubjectName in the table, it does not show any thing on the report. I am defining both datasource for report i.e. For objMain and ObjSubject.


回答1:


=Fields!ObjSubject.Value.SubjectName

That expression in a textbox on the report should give you the nested value.




回答2:


  1. Make a partial class of your base class
  2. Make a new property
  3. Define the logic in the getter and setter using your nested object property
  4. Then add it to the rdlc report like any other property of your base class


来源:https://stackoverflow.com/questions/1305571/bind-child-object-property-with-in-rdlc-report

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!