Building and Sharing Your First Report Builder 30 Report

19
Building and Sharing Your First Report Builder 3.0 Reports

description

Building and Sharing Your First Report Builder 30 Report

Transcript of Building and Sharing Your First Report Builder 30 Report

  • Building and Sharing Your First

    Report Builder 3.0 Reports

  • Building and Sharing Your First Report Builder 3.0 Reports

    Table of Contents

    Building and Sharing Your First Report Builder 3.0 Reports..................................................... 1

    Exercise 1 Creating a Report Using the Table Wizard .................................................................................................... 2

    Exercise 2 Creating a Report Using the Map Wizard ................................................................................................... 12

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 1 of 17

    Building and Sharing Your First Report Builder 3.0 Reports

    Objectives After completing this lab, you will be better able to:

    Create a report using the Table Wizard

    Publish report parts

    Create a report using the Map Wizard

    Introduce report parts into a report

    Scenario This lab will author two reports using Report Builder 3.0. In the first exercise, you will create a report by using the Table Wizard. You will then create and configure a report parameter for this report. Next, you will publish the report parameter and main dataset as report parts.

    In the second exercise, you will create a report by using the Map Wizard. The map analytic data will reference the shared dataset published in the first exercise. You will then introduce the report parameter published in the first exercise.

    Estimated Time to Complete This Lab

    30 Minutes

    Computers used in this Lab VEGAS

    The password for the Administrator account on all computers in this lab is: Password;1

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 2 of 17

    Exercise 1 Creating a Report Using the Table Wizard

    Scenario In this exercise, you will commence by launching Report Builder, and then create a report using the Table Wizard. Having developed the report layout, including the configuration of a report parameter, you will publish the report parameter and main dataset for use by the report authored in Exercise 2.

    Tasks Detailed Steps

    Complete the following tasks on:

    VEGAS

    1. Launching Report Builder

    Note: In this task, you will open Report Manager to launch Report Builder.

    a. Launch the Configuration Wizard for this lab by double-clicking the Dependencies.dep file located under the C:\LabFiles\Labs\SQL10R2BYFBI10-HOL-01\Source\Setup folder of this lab. Install any pre-requisites that are missing (rescanning if necessary) and complete the wizard.

    Note: If your setup fails, please restart the VEGAS Virtual Machine by hitting Start | Restart, give it a few minutes to restart on the backend then connect to the lab again, then repeat the step above.

    b. Open Internet Explorer from Start | All Programs | Internet Explorer.

    c. In the Internet Explorer window, in the URL box, enter http://localhost/Reports, and then press Enter.

    d. To launch Report Builder, on the Report Manager toolbar, click Report Builder.

    e. If Report Builder has not already been installed, you will be prompted to download and install the application. When prompted to run the application, click Run.

    2. Creating a Report Note: In this task, you will use the Table Wizard to create the report. This will involve

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 3 of 17

    Tasks Detailed Steps

    Using the Table Wizard

    the creation of a dataset, and arranging the dataset fields to produce the table design. The dataset will be configured to support a parameter that will enable users to request the report for a specific calendar quarter.

    a. When Report Builder launches, to create a new table report, in the Getting Started window, click Table or Matrix Wizard.

    b. In the New Table or Matrix window, in the Choose a Dataset step, ensure the Create a Dataset option is selected (located at the bottom of the window), and then click Next.

    c. To browse to a published shared dataset, in the Choose a Connection to a Data Source step, click Browse.

    d. In the Select Data Source window, double-click the Data Sources folder, select the AdventureWorksDW2008R2 data source, and then click Open.

    e. In the New Table or Matrix window, click Next.

    f. In the Design a Query step, in the Database View pane, expand the Views folder, and then check the vReportSalesByState view.

    g. In the Selected Fields pane, notice that all the view columns become fields.

    h. To preview the data, click Run Query.

    i. Notice that the CalendarQuarterKey field values are expressed as integers combining the calendar year and quarter. For example, 20053 represents the third quarter of calendar year 2005.

    j. In the Selected Fields list, ensure that the CalendarQuarterKey is selected, and then in the Applied Filters pane, click Add Filter.

    k. In the Applied Filters list, click inside the CalendarQuarterKey filter value, and enter 20082, and then press Enter.

    l. To create a report parameter for the filter, check the Parameter checkbox.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 4 of 17

    Tasks Detailed Steps

    m. Click Next.

    n. In the Arrange Fields step, in the Available Fields list, select the Country field, and then while pressing the Control key, select the State field also.

    o. Drag the selected fields into the Row Groups box.

    p. From the Available Fields list, drag the Sales field into the Values box.

    q. Verify that the field arrangement looks like the following.

    r. Click Next.

    s. In the Choose the Layout step, in the Options, select the Stepped, Subtotal Above option, and then click Next.

    t. In the Choose a Style step, review the available styles, and then click Finish.

    u. In Report Builder, if necessary, maximize the window.

    v. To save the report, click the top left corner button (for the purpose of this lab, it will be referred to as the Report Builder button), and then select Save.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 5 of 17

    Tasks Detailed Steps

    w. In the Save as Report window, double-click the Sales Reports folder.

    x. In the Name box, replace the text with Sales by State, and then click Save.

    3. Developing the Table Report Layout

    Note: In this task, you will format the report layout that will involve adding a report header, configuring the title textbox, and formatting the table, its columns and number value formats.

    a. To add a header to the report, on the Insert ribbon tab, inside the Header & Footer group, click Header, and then select Add Header.

    b. Select the title textbox (the text in the title textbox reads Click to Add Title), and then drag it into the top left corner of the report header.

    c. In the Report Data pane (located on the left), expand the Built-in Fields folder, and then drag the Report Name field into the title textbox.

    Note: The last step has assigned an expression that will dynamically assign the name of the report to the textbox.

    d. While the report title textbox is selected, on the Home ribbon tab, inside the Border group, select the bottom border.

    e. To select the table, click anywhere inside it to reveal the column and row guides, and then click the top left corner.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 6 of 17

    Tasks Detailed Steps

    f. Click and drag the four-headed arrow to reposition the table to the top left corner of the body of the report.

    g. To widen the first column, click anywhere inside the table to reveal the column and row guides, and then drag the right edge of the first column guide to widen the column to approximately twice its original size.

    h. To select all of the second columns textboxes, select the second column guide.

    i. To right-align the textboxes, on the Home ribbon tab, inside the Paragraph group, click the Right align button.

    j. To format the Sales values, select the first [Sum(Sales)] textbox.

    k. On the Home ribbon tab, inside the Number group, in the dropdown list, select Number.

    l. Repeat the last two steps to format the other two sales textboxes.

    m. To preview the report, on the Home ribbon tab, click Run (located on the far left).

    n. Notice the report parameter and its default value requesting data for the second calendar quarter of 2008.

    Note: You will configure this report parameter to prompt a user-friendly name, and present a list of available values in the next task.

    o. Expand Australia to reveal the states of Australia.

    p. To save the report, click the Report Builder button, and the select Save.

    4. Configuring the Report Parameter

    Note: In this task, you will develop the Quarter report parameter to prompt the user with available values and default to the first of those values. You will also extend that layout of the report to display the parameter selection in the header of the report.

    a. To return to design mode, on the Run ribbon tab, click Design (located on the far left).

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 7 of 17

    Tasks Detailed Steps

    b. To add a dataset to provide available values for the report parameter, in the Report Data pane, expand the Data Sources folder, right-click the AdventureWorksDW2008R2 data source, and then select Add Dataset.

    c. In the Dataset Properties window, in the Name box, replace the text with dsCalendarQuarter.

    d. In the Query Type options, select Stored Procedure.

    e. In the Select or Enter Stored Procedure Name dropdown list, select the uspReportParam_CalendarQuarterKey stored procedure, and then click OK.

    f. In the Report Data pane, notice the addition of the dataset and that it contains two fields: CalendarQuarterKey and CalendarQuarterLabel.

    g. To configure the report parameter, in the Report Data pane, expand the Parameters folder, right-click the CalendarQuarterKey report parameter, and then select Parameter Properties.

    h. In the Report Parameter Properties window, in the Prompt box, replace the text with Quarter.

    i. Select the Available Values page.

    j. Select the Get Values From a Query option, and then configure the following properties.

    Property Value

    Dataset dsCalendarQuarter

    Value Field CalendarQuarterKey

    Label Field CalendarQuarterLabel

    k. Select the Default Values page.

    l. Select the Get Values From a Query option, and then configure the following properties.

    Property Value

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 8 of 17

    Tasks Detailed Steps

    Dataset dsCalendarQuarter

    Value Field CalendarQuarterKey

    Note: This configuration will ensure that the first row retrieved from the dataset becomes the report parameters default value.

    m. Click OK.

    n. To add the parameter selection to the report header, in the Report Data pane, drag the CalendarQuarterKey report parameter and drop it into the report header, directly beneath the report title.

    o. Click and drag the four-headed arrow of the textbox to reposition it directly beneath the report title and aligned to the very left of the report title textbox.

    p. To configure the textbox expression, right-click inside the report parameter textbox, and then select Expression.

    q. In the Expression window, modify the expression by replacing the Value property with the Label property, and then click OK.

    =Parameters!CalendarQuarterKey.Label

    r. To preview the report, on the Home ribbon tab, click Run.

    s. In the Quarter parameter dropdown list, select CY2008 Q1, and then click View

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 9 of 17

    Tasks Detailed Steps

    Report (located at the far right).

    t. Notice that the report header displays the parameter selection.

    u. To save the report, click the Report Builder button, and the select Save.

    5. Publishing Report Parts

    Note: In this task, you will publish the CalendarQuarterKey report parameter and the dataset used by the table. In the next exercise, you will create a new report that will use both of these shared components.

    a. To return to design mode, on the Run ribbon tab, click Design.

    b. To publish the report parts, click the Report Builder button, and the select Publish Report Parts.

    c. In the Publish Report Parts window, select the Review and Modify Report Parts Before Publishing.

    d. To select and configure the report parts to publish, in the Report Parts group, notice that the CalendarQuarterKey report parameter is already checked.

    e. Uncheck the Tablix1 report part.

    f. In the Datasets group, check the DataSet1 dataset.

    g. Click the word DataSet1, and then modify the text to SalesByState.

    h. To expand the dataset details, click the arrow to the left of the SalesByState dataset.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 10 of 17

    Tasks Detailed Steps

    i. To configure a different location to store the dataset, click the Browse button.

    j. In the Select Folder window, click the Up One Level button.

    k. Select the Datasets folder, and then click OK.

    l. Verify that your configuration looks like the following.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 11 of 17

    Tasks Detailed Steps

    m. To publish the selected parts to the report server, click Publish.

    n. Click Close.

    o. In the Report Data pane, notice that DataSet1 icon now includes an arrow which signifies that it references a shared dataset.

    p. To save the report, click the Report Builder button, and the select Save.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 12 of 17

    Exercise 2 Creating a Report Using the Map Wizard

    Scenario In this exercise, you will create a report using the Map Wizard. Having developed the report layout, you will include the two components published in Exercise 1.

    Tasks Detailed Steps

    Complete the following tasks on:

    VEGAS

    1. Creating a Report Using the Map Wizard

    Note: In this task, you will use the Map Wizard to create the report. This will involve the use of the SalesByState shared dataset published in Exercise 1.

    a. Click the Report Builder button, and then select New.

    b. In the Getting Started window, click Map Wizard.

    c. In the New Map window, in the Choose a Source of Spatial Data step, notice that the Map Gallery option is selected, then in the Map Gallery, select USA by State Inset, and then click Next.

    d. In the Choose Spatial Data and Map View Options, notice the options to zoom in and out, and to add a Bing Maps layer, and then click Next.

    e. In the Choose Map Visualization step, select the Color Analytical Map option, and then click Next.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 13 of 17

    Tasks Detailed Steps

    f. In the Choose the Analytical Dataset step, to source the shared dataset created in the previous exercise, select the Choose an Existing Dataset in this Report or a Shared Dataset.

    g. Click Browse.

    h. In the Select Dataset window, double-click the Datasets folder, select the SalesByState dataset, and then click Open.

    i. In the New Map window, click Next.

    j. In the Specify the Match Fields for Spatial and Analytical Data step, check the STUSPS spatial dataset field, then in the corresponding Analytical Dataset Fields dropdown list, select the StateCode field, and then click Next.

    k. In the Choose Color Theme and Data Visualization step, configure the following properties.

    Property Value

    Field to Visualize [Sum(Sales)]

    Color Rule Light-Dark

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 14 of 17

    Tasks Detailed Steps

    l. Click Finish.

    m. To preview the report, on the Home ribbon tab, click Run.

    n. Notice the report parameter name is not particularly user friendly, and it is presently set to pass NULL.

    o. Uncheck the NULL checkbox, then in the Calendar Quarter Key parameter box, enter 20082, and then click View Report.

    p. To save the report, click the Report Builder button, and the select Save.

    q. In the Save as Report window, in the Name box, replace the text with US Sales by State, and then click Save.

    2. Introducing a Report Part

    Note: In this task, you will introduce the CalendarQuarterKey report parameter published in the previous exercise.

    a. To return to design mode, on the Run ribbon tab, click Design.

    b. In the Report Data pane, expand the Datasets folder.

    c. Notice the SalesByState shared dataset.

    d. In the Report Data pane, expand the Parameters folder.

    e. Right-click the CalendarQuarterKey report parameter, and then select Delete.

    f. When prompted to delete the report parameter, click OK.

    g. To introduce the published report parameter, on the Insert ribbon tab, click Report Parts (located on the far left).

    h. In the Report Part Gallery (which opens on the right side), click the Search button.

    i. Select the CalendarQuarterKey report part, and then notice the properties for the report part displayed at the bottom of the Report Part Gallery.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 15 of 17

    Tasks Detailed Steps

    j. To introduce the report part into the report design, double-click it.

    k. In the Report Data pane, verify that the CalendarQuarterKey report parameter has been added.

    l. Notice also that the dsCalendarQuarter dataset has been added to support the available values of the report parameter.

    m. To remove the textbox added to the report design (in the middle of the map) when adding the report parameter, select the textbox, and then press Delete.

    n. To hide the Report Part Gallery, on the Insert ribbon tab, click Report Parts.

    3. Developing the Map Report Layout

    Note: In this task, you will format the map report layout that will involve defining the map title and legend title, removing the color and distance scales, and introducing a tooltip expression for each polygon (US state) in the map.

    a. Right-click the Map Title text, and then select Title Properties.

    b. In the Map Title Properties window, to the right of the Title Text box, click the function button.

    c. In the Expression window, in the expression box, remove the entire expression text.

    d. In the Category list, select Built-in Fields.

    e. To add the report name to the expression, in the Item list, double-click the

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 16 of 17

    Tasks Detailed Steps

    ReportName field.

    f. Complete the expression to look like the following.

    =Globals!ReportName & " " &

    g. Position the cursor at the very end of the expression, and ensure there is a space after the last ampersand (&).

    h. In the Category list, select Parameters.

    i. In the Values list, double-click the CalendarQuarterKey parameter.

    j. Modify the expression by replacing the Value property with the Label property.

    k. Verify that the completed expression looks like the following.

    =Globals!ReportName & " " & Parameters!CalendarQuarterKey.Label

    l. Click OK.

    m. In the Map Title Properties window, click OK.

    n. To rename the legend title, right-click the Title text in the legend, and then select Legend Title Properties.

    o. In the Map Legend Title Properties window, in the Legend Title Text box, replace the text with Sales, and then click OK.

    p. To remove the color scale, select the scale, and then press the Delete key.

    q. To remove the distance scale, select the scale, and then press the Delete key.

    r. To configure the polygon properties, click inside the map at least twice to open the Map Layers window, which is located on the right of the report design (you may have to scroll to the right to see it).

    s. Right-click the polygon layer, and then select Polygon Properties.

  • Building and Sharing Your First Report Builder 3.0 Reports

    Page 17 of 17

    Tasks Detailed Steps

    t. In the Map Polygon Properties window, to the right of the Tooltip dropdown list, click the function button.

    u. In the Expression window, enter the following expression, and then click OK.

    =Fields!State.Value & vbCrLf & "Sales: " & CInt(Fields!Sales.Value).ToString("N0")

    Note: This expression concatenates the value of the State field with a carriage return and line feed, and then concatenates this with the value of the Sales field converted to an integer and formatted as a numeric with zero decimal places (N0).

    v. In the Map Polygon Properties window, click OK.

    w. To preview the report, on the Home ribbon tab, click Run.

    x. Hover over several shaded states to review the tooltip.

    y. In the Quarter parameter dropdown list, select CY2008 Q1, and then click View Report.

    z. To save the report, click the Report Builder button, and the select Save.

    4. Finishing Up Note: In this task, you will finish up by closing all applications.

    a. Click the Report Builder button, and then click Exit Report Builder