|
Hi
I've used the examples in earlier Posts w.r.t. Entities and ReportViewer Control to create an ObjectDataSource for my LINQ Entities and directly bound it a RDLC in local mode, and successfully set the Data Source at run time.
However, at this stage it seems that the RDLC created only allows access to the direct / immediate properties of the entity that I've bound. e.g. in the below example I need to navigate the entity graph : Service->ServiceType->Name
Has anyone managed to successfully 'walk' through the entity graph in RDLC, or will I need to flatten my entity graph in order to use properties of related entities in my report (i.e. First need to denormalise the complex Entity into a new wide Entity class containing all properties)
(i.e. meaning that there isn't any point in using entities in an RDLC. The LINQ language extensions could be used to create the 'flattened' entity, e.g. using a new anonymous class)
What I need is something like the 3rd Field listed below, where I need to reference a property of asubentity in the report
<DataSet Name="Service"> <Fields> <Field Name="Code"> <!-- Simple Field is a direct Property on the Entity identified for the ObjectDataSource--> <DataField>Code</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="ServiceType"> <!-- Many : One Entity Property on the Entity identified for the ObjectDataSource--> <DataField>ServiceType</DataField> <rd:TypeName>MyAssembly.Entities.ServiceType</rd:TypeName> </Field> <Field Name="ServiceTypeName"> <!-- "walked" field on the above Sub Entity--> <DataField>ServiceType.Name</DataField>* Doesn't work <rd:TypeName>System.String</rd:TypeName> </Field>
Thanks in advance
Stuart |