Lesson 8: Specifying Default Detail Attributes

Default detail attributes are the fields that identify a unique instance of the entity plus other fields that Report Builder users might find useful when creating their reports. When the user drags an entity to the design area, the default detail attributes appear. For example, when the Product entity is added to the design area, the following fields appear: Name, Product Number, Weight, Size, Color, and Standard Cost. Name uniquely identifies each instance of product but Product Number, Weight, Size, Color, and Standard Cost are additional fields about the product that a user might want to see when creating reports about products. Identifying attributes are the one or two fields that identify each instance of the entity as a unique item. For example, the Name field uniquely identifies each product.

In this lesson, you will specify the default detail attributes for an entity, and then you will redeploy the model and see the report model changes in Report Builder.

To specify default detail attributes

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

  2. In the Properties window, select DefaultDetailAttributes.

  3. To edit the property, click the ellipsis () button.

  4. In the Members list of the AttributeReference Collection Editor dialog box, select Commission Pct, and then click Remove.

  5. Click Add.

    The Default Detail Attributes dialog box appears.

  6. In the Entities list, select the Employee entity and then select the Contact entity.

  7. In the Fields list, select First Name, Middle Name, and Last Name, and then click OK.

  8. Click OK again.

    In the Properties window, note that the DefaultDetailAttributes property indicates that there are four attributes. When the user adds the Sales Person entity to their report, the sales person's National ID Number, and first, middle and last names are added.

  9. On the File menu, click Save All.

To deploy the report model

  • On the Build menu, click Deploy AdventureWorks2008R2 Model.

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. To see the Product Details folder, scroll down the list of entities.

    This folder was created in Lesson 3.

  4. To see the contents of the Product Details folder, click Product Details.

    The entities in this folder were added to the folder in Lesson 3.

  5. In the Entities list, find the Sales Orders and Sales entities.

    These entities were renamed in Lesson 4.

  6. Select the Sales Orders entity, and then drag the Sum Total Due field to the design area.

    This field was renamed in Lesson 4 and formatted in Lesson 7.

  7. Drag the Sales Person entity to left of the Sum Total Due field.

    Notice that the National ID Number, First Name, Middle Name, and Last Name fields are added to the report. These are the default detail attributes that you added to the entity in this lesson. This is the same report that you created earlier except that now your new model changes are displayed.

  8. To view the results of your report, click Run Report.

  9. To return to the design area, click Design Report.

  10. On the File menu, click New.

  11. When the Getting Started pane appears, select the AdventureWorks2008R2 model and then click OK.

  12. When prompted to save your report, click No.

    You do not need to save this report for future tutorial lessons.

  13. In the Entities list, navigate to the Product entity.

  14. Drag the Product entity to the design area.

    In the Entities list, notice that the Product Subcategory entity is listed below the Product entity.

  15. Select the Product Subcategory entity.

    Note the fields within this entity. Also, notice that the Product Category entity is listed below the Product Subcategory entity.

  16. Next, select the Product Category entity.

    Note the fields within this entity.

These entities have only one useful field associated with them: their respective Name attributes. It would be helpful to see these fields as attributes of the Product entity rather than have to navigate to each of them individually.

To use the model in the ClickOnce version of Report Builder 3.0

  1. In Report Manager, click Report Builder.

    Note

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

  2. In the Getting Started 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: https://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. To see the Product Details folder, scroll down the list of entities.

    This folder was created in Lesson 3.

  10. To see the contents of the Product Details folder, click Product Details.

    The entities in this folder were added to the folder in Lesson 3.

  11. In the Entities list, find the Sales Orders and Sales entities.

    These entities were renamed in Lesson 4.

  12. Select the Sales Orders entity, and then drag the Sum Total Due field to the design area.

    This field was renamed in Lesson 4 and formatted in Lesson 7.

  13. Drag the Sales Person entity to left of the Sum Total Due field.

    Notice that the National ID Number, First Name, Middle Name, and Last Name fields are added to the report. These are the default detail attributes that you added to the entity in this lesson. This is the same report that you created earlier except that now your new model changes are displayed.

  14. To view your report, click Run.

  15. In the Entities list, navigate to the Product entity.

  16. Drag the Product entity to the design area.

    In the Entities list, notice that the Product Subcategory entity is listed below the Product entity.

  17. Select the Product Subcategory entity.

    Note the fields within this entity. Also, notice that the Product Category entity is listed below the Product Subcategory entity.

  18. Next, select the Product Category entity.

    Note the fields within this entity.

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

    You do not need to save the report.

These entities have only one useful field associated with them: their respective Name attributes. It would be helpful to see these fields as attributes of the Product entity rather than have to navigate to each of them individually.

Next Steps

In the next lesson, you will change the properties of an entity so that it is a lookup entity for another entity. See Lesson 9: Specifying a Lookup Entity.