Partilhar via


Lesson 10: Inheriting Properties from Other Entities

New: 5 December 2005

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

  1. In the Tree view, select the Sales Person entity.

  2. In the Properties window, expand the Inheritance property.

  3. Click the InheritsFrom drop-down button, and select Employee.

  4. 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.

  5. 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

  1. Launch Report Builder.

  2. In the Getting Started pane, select the AdventureWorks model, and then click OK.

  3. In the Entities list, select the Sales Person entity.

  4. 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.

  5. In the Entities list, select the Product entity.

  6. 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).

  7. Drag the Product entity to the design area.

  8. In the Entities list, notice that the Product Subcategory and Product Category roles are no longer displayed as roles from the Product entity.

  9. Drag the Product Subcategory field to the left of the Product group in the design area.

  10. In the Entities list, select the Purchase Order Details entity.

  11. Drag the Total Order Qty field to the right of the Name field in the design area.

  12. Drag the Total Rejected Qty field to the right of the Total Order Qty field.

  13. On the Report toolbar, click Run Report.

  14. In the Total Order Qty column, click the 150 for Bearing Ball.

    A clickthrough report appears. This clickthrough report displays the Purchase Orders for Bearing Balls. 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.

  15. On the File menu, click Exit, and then No.

Next Steps

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.

See Also

Tasks

Tutorial: Refining a Report Model in Model Designer

Concepts

Reporting Services Tutorials

Other Resources

Working with Model Designer
Binding Object (Model Designer)

Help and Information

Getting SQL Server 2005 Assistance