Creating Report: Using the Table Wizard
Resources:
- http://msdn.microsoft.com/en-us/sql10r2byfbi-trainingcourse_sql10r2byfbi10-hol-01_topic2.aspx
Exercise 1: Creating a Report Using the Table Wizard
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.
The finished report will resemble the following.
Figure 1
Previewing the Sales by State report
Task 1 – Launching Report Builder
In this task, you will open Report Manager to launch Report Builder.
- Open Internet Explorer from Start | All Programs | Internet Explorer.
- In the Internet Explorer window, in the URL box, enter http://<servername>/Reports, and then pressEnter.Note:You will need to substitute <servername> for the name of the machine that hosts Reporting Services.
- To launch Report Builder, on the Report Manager toolbar, click Report Builder.Figure 1
Launching Report Builder - 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.Figure 2
Installing Report Builder
Task 2 – Creating a Report Using the Table Wizard
In this task, you will use the Table Wizard to create the report. This will involve 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.
- When Report Builder launches, to create a new table report, in the Getting Started window, click Table or Matrix Wizard.Figure 3
Launching the Table or Matrix Wizard - 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.
- To browse to a published shared dataset, in the Choose a Connection to a Data Source step, clickBrowse.
- In the Select Data Source window, double-click the Data Sources folder, select theAdventureWorksDW2008R2 data source, and then click Open.
- In the New Table or Matrix window, click Next.
- In the Design a Query step, in the Database View pane, expand the Views folder, and then check thevReportSalesByState view.
- In the Selected Fields pane, notice that all the view columns become fields.
- To preview the data, click Run Query.Figure 4
Previewing the data - 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.
- In the Selected Fields list, ensure that the CalendarQuarterKey is selected, and then in the Applied Filterspane, click Add Filter.Figure 5
Adding the CalendarQuarterKey field as a filter - In the Applied Filters list, click inside the CalendarQuarterKey filter value, and enter 20082,and then pressEnter.
- To create a report parameter for the filter, check the Parameter checkbox.Figure 6
Configuring the CalendarQuarterKey filter - Click Next.
- 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.
- Drag the selected fields into the Row Groups box.
- From the Available Fields list, drag the Sales field into the Values box.
- Verify that the field arrangement looks like the following.Figure 7
Verifying the field arrangement - Click Next.
- In the Choose the Layout step, in the Options, select the Stepped, Subtotal Above option, and then clickNext.
- In the Choose a Style step, review the available styles, and then click Finish.
- In Report Builder, if necessary, maximize the window.
- To save the report, click the top left corner button (for the purpose of this lab, it will be referred to as theReport Builder button), and then select Save.Figure 8
Saving the report - In the Save as Report window, double-click the Sales Reports folder.
- In the Name box, replace the text with Sales by State, and then click Save.
Task 3 – Developing the Table Report Layout
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.
- To add a header to the report, on the Insert ribbon tab, inside the Header & Footer group, click Header, and then select Add Header.
- 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.
- 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.
- While the report title textbox is selected, on the Home ribbon tab, inside the Border group, select the bottom border.Figure 9
Formatting the textbox bottom border - To select the table, click anywhere inside it to reveal the column and row guides, and then click the top left corner.Figure 10
Selecting the table - Click and drag the four-headed arrow to reposition the table to the top left corner of the body of the report.
- 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.
- To select all of the second column’s textboxes, select the second column guide.Figure 11
Selecting all of the second column’s textboxes - To right-align the textboxes, on the Home ribbon tab, inside the Paragraph group, click the Right align button.Figure 12
Clicking the Right Align button - To format the Sales values, select the first [Sum(Sales)] textbox.
- On the Home ribbon tab, inside the Number group, in the dropdown list, select Number.
- Repeat the last two steps to format the other two sales textboxes.
- To preview the report, on the Home ribbon tab, click Run (located on the far left).
- 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.
- Expand Australia to reveal the states of Australia.
- To save the report, click the Report Builder button, and the select Save.
Task 4 – Configuring the Report Parameter
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.
- To return to design mode, on the Run ribbon tab, click Design (located on the far left).
- 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.
- In the Dataset Properties window, in the Name box, replace the text with dsCalendarQuarter.
- In the Query Type options, select Stored Procedure.
- In the Select or Enter Stored Procedure Name dropdown list, select theuspReportParam_CalendarQuarterKey stored procedure, and then click OK.
- In the Report Data pane, notice the addition of the dataset and that it contains two fields:CalendarQuarterKey and CalendarQuarterLabel.
- To configure the report parameter, in the Report Data pane, expand the Parameters folder, right-click theCalendarQuarterKey report parameter, and then select Parameter Properties.
- In the Report Parameter Properties window, in the Prompt box, replace the text with Quarter.
- Select the Available Values page.
- Select the Get Values From a Query option, and then configure the following properties.PropertyValueDatasetdsCalendarQuarterValue FieldCalendarQuarterKeyLabel FieldCalendarQuarterLabelFigure 13
Configuring the report parameter available values - Select the Default Values page.
- Select the Get Values From a Query option, and then configure the following properties.PropertyValueDatasetdsCalendarQuarterValue FieldCalendarQuarterKeyFigure 14
Configuring the report parameter default valueNote:This configuration will ensure that the first row retrieved from the dataset becomes the report parameter’s default value. - Click OK.
- To add the parameter selection to the report header, in the Report Data pane, drag theCalendarQuarterKey report parameter and drop it into the report header, directly beneath the report title.
- 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.
- To configure the textbox expression, right-click inside the report parameter textbox, and then selectExpression.Figure 15
Configuring the textbox expression - In the Expression window, modify the expression by replacing the Value property with the Label property, and then click OK.Visual Basic
=Parameters!CalendarQuarterKey.Label
- To preview the report, on the Home ribbon tab, click Run.
- In the Quarter parameter dropdown list, select CY2008 Q1, and then click View Report (located at the far right).
- Notice that the report header displays the parameter selection.
- To save the report, click the Report Builder button, and the select Save.
Task 5 – Publishing Report Parts
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.
- To return to design mode, on the Run ribbon tab, click Design.
- To publish the report parts, click the Report Builder button, and the select Publish Report Parts.
- In the Publish Report Parts window, select the Review and Modify Report Parts Before Publishing.Figure 16
Publishing report parts - To select and configure the report parts to publish, in the Report Parts group, notice that theCalendarQuarterKey report parameter is already checked.
- Uncheck the Tablix1 report part.
- In the Datasets group, check the DataSet1 dataset.
- Click the word DataSet1, and then modify the text to SalesByState.
- To expand the dataset details, click the arrow to the left of the SalesByState dataset.Figure 17
Configuring the SalesByState dataset - To configure a different location to store the dataset, click the Browse button.Figure 18
Clicking the Browse button - In the Select Folder window, click the Up One Level button.Figure 19
Clicking the Up One Level button - Select the Datasets folder, and then click OK.
- Verify that your configuration looks like the following.Figure 20
Reviewing the Publish Report Parts configuration - To publish the selected parts to the report server, click Publish.
- Click Close.
- In the Report Data pane, notice that DataSet1 icon now includes an arrow which signifies that it references a shared dataset.Figure 21
Reviewing the shared dataset icon - To save the report, click the Report Builder button, and the select Save.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home