Lesson 4: Adding Column and Databar Charts (SSRS)
In this lesson, you will learn to add report items to the Employee_Sales_Summary_2008R2 report that help answer the following question for an AdventureWorks salesperson:
- How do the sales for each product category for this month compare to seasonal sales in previous years?
You will add a column chart to and databar chart to visualize data from the EmpSalesMonth2008R2 dataset.
What You Will Learn
In this lesson you will do the following tasks:
Display sales for each category for one month for each of several years on a column chart and also in a table with a databar chart.
Place both charts as peers on the report design surface to control where the charts appear on the rendered report.
Estimated time to complete this tutorial: 20 minutes.
For information about requirements, see Prerequisites for AdventureWorks 2008R2 Sample Reports (SSRS).
This lesson assumes that you have completed Creating the Report Server Project and the AdventureWorks2008R2_Base Report (SSRS) to create the report project, shared data source, and shared datasets, and Lesson 3: Adding a Matrix, Variables, and Indicators as KPIs (SSRS).
Review the tips about viewing the hierarchical relationships among report items by using Document Outline pane. For more information, see Report Design Tips (Report Builder 3.0 and SSRS).
To open the project and report
In Business Intelligence Development Studio, open the report server project AdventureWorks 2008R2 Sample Reports that you created in the previous lesson.
Open the Employee_Sales_Summary_2008R2 report.
To add and configure a column chart
Add a Column chart to the report under the rectangle named rectCharts.
From the Report Data pane, from the dataset EmpSalesMonth2008R2, do the following:
Drag Sales to Values.
Drag Category to Category Groups.
Drag Year to Series Groups.
In the Properties pane, set Bookmark to CategoriesColumnChart.
To configure the chart title and axis
In Title Properties, replace the chart title with the following expression: =Parameters!ReportMonth.Label & " Sales Comparison"
Change the Vertical Axis Title to In Thousands.
Open the Vertical Axis Properties.
On the General page, in Scale options, select Enable scale breaks.
On the Number page, format the values as Currency.
Set Decimal places to 0.
Select Use 1000 separator.
Select Show values in, and click Thousands.
In the Properties pane, verify that Chart Axis properties are displayed.
Expand ScaleBreakStyle, and set BorderColor to Silver.
Delete the Horizontal Axis Title.
Open the Horizontal Axis Properties. On the Labels page, select Disable auto-fit and set Label rotation angle (degrees) to 45.
Move the legend to below the horizontal axis.
To add a matrix with a databar
Add a matrix next to the column chart. Use snaplines to align the top of the matrix and the chart.
From the Report Data pane, from the dataset EmpSalesMonth2008R2, drag Category to Rows.
Right-click in the Data cell, click Insert, click Data Bar, and then click Stacked Bar.
In the Chart Data pane, do the following:
In the Values pane, click Add field (+), and then click Sales.
In the Series Groups pane, click Add field (+), and then click Year.
In the matrix, in Columns, create a Placeholder named Title and set its value to =Parameters!ReportMonth.Label & " Sales Comparison for Each Year".
Expand the width of the column that contains the data bar.
Select the matrix and in the Properties pane, set Bookmark to MatrixwithNestedDatabarChart.
Format the matrix as needed.
Add a Rectangle Container for the Matrix
Add a rectangle container for the matrix and the text that explains the purpose of the matrix.
To add a rectangle container
In the report Body, insert a Rectangle named rectSeasonalSales.
To the rectangle, add a text box with the following text: Compare seasonal sales for [@ReportMonth.Label\] for each category.
Format as needed.
Drag the chart to the rectangle. The rectangle expands as needed.
Drag the matrix with the databar chart to the rectangle and position it next to the column chart.
Move this rectangle below the existing rectangles, and use snaplines to align the sides of the rectangle and its report items to the other report items on the page.
To add a link from text to a bookmark
Select the text in the text box tbScenarioText.
With the mouse, highlight the word column.
Right-click and open the Text Properties dialog box.
On the Font page, set Color to Blue and Effects to Underline.
On the Action page, click Go to bookmark.
In Select bookmark, type CategoriesColumnChart.
Repeat steps 3 through 5 for the word databar.
In Select bookmark, type MatrixwithNestedDatabarChart.
To preview and verify the report
Preview the report.
Verify the following:
The column chart and the databar display the same information.
In the scenario text, the column link jumps to the page that contains the column chart.
In the scenario text, the databar link jumps to the page that contains the databar chart.
Deploy the report.
You have completed building this report. To build other AdventureWorks sample reports, see Tutorials: Creating AdventureWorks 2008R2 Sample Reports (SSRS).