Export (0) Print
Expand All

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

To view report model changes in Report Builder 1.0

  1. Launch Report Builder.

  2. In the Getting Started pane, select the AdventureWorks2008R2 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 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.

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

To view report model changes in Report Builder 3.0

  1. In Report Manager, click Report Builder.

    NoteNote

    You can also use the standalone version of Report Builder 3.0.

  2. In New Report or Dataset dialog box, click Blank Report, and then click Create.

  3. In the Report Data pane, click New, and then click Data Source.

  4. In the Data Sources Properties dialog box, verify that Use a shared connection or report model is selected, and then click Browse.

  5. In the Select Data Source dialog box, in the Name text box, type the URL: http://localhost/reportserver and click Open.

  6. Expand the Models folder, click AdventureWorks2008R2, and then click Open.

  7. Click OK.

    A data source with the default name, DataSource1, is added to the Report Data pane.

    Right click DataSource1.

  8. Verify that the Data source option specifies AdventureWorks2008R2 and click Query Designer.

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

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

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

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

  13. Drag the Product entity to the design area.

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

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

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

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

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

  19. To view your report, click Run.

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

    NoteNote

    You cannot create clickthrough reports using Report Builder 3.0. However, you can create the clickthrough reports in Report Builder 1.0, and then update the report using Report Builder 3.0.

  21. Click the Report Builder button and then click Exit Report Builder.

    You do not need to save the report.

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.

Community Additions

ADD
Show:
© 2014 Microsoft