Lesson 10: Inheriting Properties from Other Entities
You can change the properties of an entity so that it inherits the fields of the entity to which it is bound. For example, in the AdventureWorks model, the Sales Person entity is bound to the Employee entity. All sales people are employees. When working with the Sales Person entity, it would be helpful to see the Employee fields too. In this lesson, you will set the Inheritance properties so that the Sales Person entity inherits the Employee fields, and then you will view the model changes you made in lessons 9 and 10 in Report Builder.
To specify inheritance properties
In the Tree view, select the Sales Person entity.
In the Properties window, expand the Inheritance property.
Click the InheritsFrom drop-down button, and select Employee.
Click the Binding drop-down button, and select FK_SalesPerson_Employee_SalesPersonID.
The SalesPersonId attribute is the field that binds the Sales Person entity to the Employee entity.
On the File menu, click Save All.
To deploy the model
On the Build menu, click Deploy AdventureWorks.
To view report model changes in Report Builder
Launch Report Builder.
In the Getting Started pane, select the AdventureWorks model, and then click OK.
In the Entities list, select the Sales Person entity.
In the Fields list, review the fields from the Employee entity that now appear in the Sales Person entity field list: National ID Number, Title, Hire Date, Birth Date, etc.
In the Entities list, select the Product entity.
In the Fields list, notice that Product Subcategory and Product Category appear as fields below the Name field (if you moved Product Subcategory up the list as directed in Lesson 9).
Drag the Product entity to the design area.
In the Entities list, notice that the Product Subcategory and Product Category roles are no longer displayed as roles from the Product entity.
Drag the Product Subcategory field to the left of the Product group in the design area.
In the Entities list, select the Purchase Order Details entity.
Drag the Total Order Qty field to the right of the Name field in the design area.
Drag the Total Rejected Qty field to the right of the Total Order Qty field.
On the Report toolbar, click Run Report.
In the Total Order Qty column, click the 62500 for Decal 1.
A clickthrough report appears. This clickthrough report displays the Purchase Orders for Decal 1. Notice that the clickthrough report shows Order Date, Modified Date, Due Date, Product Name, Order Qty, Unit Price, and Line Total. These fields are determined by model properties also.
On the File menu, click Exit, and then No.
Some items might not be available directly from the database but users might find the information helpful when creating reports. In this case, you can create often used items and include them in the model. In the next lesson, you will create a new field. See Lesson 11: Creating a Calculated Field.