Subfield values in .NET Local Report
I'm attempting to use business objects as a datasource for an ASP.NET Microsoft rdlc Report and I am having problems displaying the values of subobjects in the report.
For example, if have the following two classes 'Customer' and 'Address'.
Customer
FirstName
LastName
Address
etc.
Address
HomeAddress1
etc.
Customer contains an instance of Address. If I set a list of Customers as the report datasource, I can refer to the values of each customer in the report as follows:
=Fields!FirstName.Value
However, I can't work out how 开发者_运维知识库to refer to the values of the 'Address' sub-object. I had assumed one of the following would work:
=Fields!Address.HomeAddress1.Value
or
=Fields!Address!HomeAddress1.Value
But neither of these do. Can anyone advise?
I had the exact same problem, and I'm sorry to say that I haven't found a way to reference sub-properties (I do hope that someone else has one though!)
What I ended up doing is creating a wrapper class that has all the properties I need directly in it.
The following syntax seems to work.
=Fields!Address.Value.HomeAddress1
精彩评论