Start learning with our library of video tutorials taught by experts. Get started

SQL Server Reporting Services in Depth

Using sparklines


From:

SQL Server Reporting Services in Depth

with Simon Allardice

Video: Using sparklines

Once you are familiar with creating charts in Reporting Services it's easy to add sparklines. Sparklines are mini charts, most commonly shown as small line charts, but they can be any small chart. They are intended to show very quick but easy-to-scan visual data. In Reporting Services you can add multiple kinds of sparklines. These can be added on their own. They are sometimes added along with text. Sometimes you'll use several together for a quick comparison, but they are also very commonly used embedded inside a table or a matrix.
Expand all | Collapse all
  1. 12m 6s
    1. Welcome
      1m 9s
    2. What you need to know
      1m 36s
    3. Exploring SQL Server Reporting Services components
      4m 17s
    4. Reviewing SQL Server versions
      5m 4s
  2. 49m 41s
    1. The elements of a report
      3m 10s
    2. Creating a report with Report Builder
      12m 11s
    3. Grouping table regions on a report
      6m 1s
    4. Joining data from multiple tables
      4m 33s
    5. Formatting report elements
      4m 34s
    6. Using functions in a report
      11m 0s
    7. Displaying data in a matrix
      8m 12s
  3. 24m 9s
    1. Filtering data and adding parameters to a report
      5m 35s
    2. Customizing report parameters
      5m 4s
    3. Sorting data in a data region
      4m 7s
    4. Applying interactive sorting
      4m 57s
    5. Creating a drillthrough action to connect reports
      4m 26s
  4. 49m 57s
    1. Introduction to charting in Reporting Services
      4m 16s
    2. Creating a column chart
      8m 35s
    3. Adding a generated average to a chart
      4m 5s
    4. Creating a pie chart
      8m 19s
    5. Using sparklines
      6m 38s
    6. Adding a sparkline to a drilldown matrix
      14m 34s
    7. Adding data bars
      3m 30s
  5. 21m 48s
    1. Adding indicators to a report
      7m 52s
    2. Using and configuring gauges
      5m 30s
    3. Using maps in Reporting Services
      8m 26s
  6. 38m 14s
    1. Creating modular reports with report parts
      4m 36s
    2. Adding and updating report parts
      4m 37s
    3. Using subreports and nested regions
      4m 28s
    4. Configuring headers and footers
      3m 9s
    5. Printing and exporting reports
      3m 45s
    6. Using page breaks
      5m 37s
    7. Creating and using shared data sources
      8m 11s
    8. Creating and using shared data sets
      3m 51s
  7. 27m 20s
    1. Organizing reports in Report Manager
      3m 1s
    2. Adding users and configuring report security
      5m 24s
    3. Configuring subscriptions
      5m 13s
    4. Creating a linked report
      4m 8s
    5. Using Report Designer in SQL Server Data Tools
      9m 34s
  8. 1m 2s
    1. Goodbye
      1m 2s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
SQL Server Reporting Services in Depth
3h 44m Advanced Dec 13, 2012

Viewers: in countries Watching now:

Discover how to create, manage, and deliver interactive reports—not just to print, but to dynamically explore enterprise-level data—with Reporting Services in SQL Server. In this course, author Simon Allardice concentrates on using Report Builder to build and format reports from a variety of data sources, but also shows how to perform basic administration tasks such as granting user access and organizing reports in the Report Manager. Plus, learn how to add interactive sorting and filtering functionality to your reports, and create column and pie charts to better express your data.

Note: These tutorials are applicable to both the 2008 and 2012 versions of SQL Server.

Topics include:
  • Understanding the elements of a report
  • Grouping table regions
  • Joining data from multiple tables
  • Displaying data in a matrix
  • Customizing report parameters
  • Filtering and sorting data
  • Creating charts
  • Adding sparklines and data bars
  • Creating at-a-glance reports with indicators
  • Using Maps in Reporting Services
  • Configuring report security
  • Printing and exporting reports
Subjects:
Developer Databases
Software:
SQL Server
Author:
Simon Allardice

Using sparklines

Once you are familiar with creating charts in Reporting Services it's easy to add sparklines. Sparklines are mini charts, most commonly shown as small line charts, but they can be any small chart. They are intended to show very quick but easy-to-scan visual data. In Reporting Services you can add multiple kinds of sparklines. These can be added on their own. They are sometimes added along with text. Sometimes you'll use several together for a quick comparison, but they are also very commonly used embedded inside a table or a matrix.

These sparklines are shown without titles along the axis or without numbers along the axis, because we are not trying to get an accurate understanding of a particular data point. What they let us do is quickly see, is this flat and steady, is it volatile, is it trending up or is it trending down? So here's how we make them. I am in Report Builder and just to save some time, I've created a blank report with a data source pointing to the regular AdventureWorks database. All I've done apart from that is just change the title.

What I need is some data to work with, so I am going to add a new dataset. I'll call this SalesInfo, because that's what we're going to go for, and jump into the Query Designer. Drilling down into the Sales section, I am going to go into the SalesOrderHeader table, which has got the data that I am most interested in here. And I'll begin by selecting OrderDate and TotalDue. Run this query. That seems about the kind of data that I would expect. Now, I know that I am going to have to change this, because I've got a little bit too much data coming back, but let's just see the idea of creating a sparkline straight away. Click OK, click OK.

I am going to go to the Insert tab of the Ribbon, find the Sparkline option, click that once. Then my crosshairs will change on my mouse so I'll just drag it where I want to position it and let go. I get the window very similar to creating a chart asking what kind of sparkline or what type of sparkline do I want. I am going to select the Line option because I want to show growth or decline over time, and click OK. Just as with a chart, this is showing dummy data right now. There is no connection between this sparkline on my report and the dataset that I've defined here.

What I need to do is bring up the data options, very similar to a chart; in fact, it's really identical to a chart. If I click this again, I can get my Chart Data option. And again, just to show that if you've deselect it, you'll need to click it twice, click once and then again to bring up the Chart Data window, or if it's deselected, you can also right-click, which typically brings it up directly. This is the same Chart Data window that we'd see with a normal chart, because really a sparkline is a chart. So we need something for our values. We need something for our groups.

Typically, with a sparkline you don't have multiple series. That's just way too much data to show in a small amount of space. So the values is our numeric option. What is going up, what's going down? So I am going to select TotalDue, drop it into Values, and then the OrderDate is my groupings and drop that in there. I know I am going to have to change this, but let's just see why. First I run this and officially it works. We are getting a sparkline, but it's not what I was looking for. This looks more like a mini column chart and I was expecting a line chart.

It actually is a line chart. It's just too small to see that it's very volatile. It's going up and down a lot. Because I am just bringing back too many points of data. This is actually several years worth of daily sales, often dozens in a day. And that would be impossible to show on a regular chart, nevermind a sparkline. I need to get a better summary of this data, perhaps totaling sales grouped together by month or quarter. That would be a much better scale of data to show. So back into Design, I am going to drop into the dataset. If I jump into Query Designer I can see that when I run this query I am getting multiple orders for a particular date.

Now, I could start off by at least grouping the dates together, so selecting my TotalDue and saying I wanted to sum that and grouping by the other field, OrderDate. That will now give me one amount per day, but that's still too many data points. I really need to start grouping these together by month. Now, to do that, the best way to do it is to edit this as text. We really can't get that level of detail in the Query Designer visual section. In the SELECT part of the statement I am no longer interested in the OrderDate.

I really just want to know the year and the month, and I am going to get those separately by using the Year and Month functions in my SQL. I will just use a constructed column name so they come back as order year and order month. And below, in the GROUP BY, I want to group them together by year and month. I can't just group together by month, because if I select a month, it'd start combining all the sales for January 2005 and January 2006 and January 2007, so I need the year as well as the month.

Same thing. I am going to add an ORDER BY. I don't technically need to do that, but this will allow me to run this query and get an idea of whether this seems to be what we're looking for. So go ahead and now we are getting the OrderYear, OrderMonth, and the summed- together TotalDue of all those orders. And this will be a much smaller amount of data, much better to represent in a sparkline. So I am going to click OK and click OK. I could edit the existing sparkline, but just to give us some more practice, I am going to delete it and edit again.

Up to the Insert tab. Click once on Sparkline, draw the sparkline that you want, let go. I am going to select the first Line chart option. Click OK. Clicking the sparkline until I get my chart data section up. I am going to open up my dataset. The Values is still going to be the Sum_TotalDue. Do be careful when you are dragging from the report data region into chart data. It's easy to mix up if you drag over the top of another element. It can confuse Report Builder. So I let go in Values, and then in my category groups what I am going to do is first drag over OrderYear and then drag over OrderMonth. So we'll be grouping in two sections, year, and within year, each month, and that should do it.

We go ahead and run this. That looks a lot more realistic. Now, what I am seeing at the end here is that the last months of sale is actually aren't a full month, so it's dropping off very suddenly at the end. If that was an issue I might want to filter the data so we only had complete months, but this looks about right. Now, this is a standalone sparkline. You probably want a text box beside this with some kind of label so people can actually tell what it represents. But it's also very, very common to take these and embed them inside a table or matrix.

Let's see that next.

There are currently no FAQs about SQL Server Reporting Services in Depth.

Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed SQL Server Reporting Services in Depth.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked