O'Reilly logo

SQL Server 2012 Reporting Services Blueprints by Mickey Stuewe, Marlon Ribunal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a drillthrough or linked report

Let's create our third report and call it SalesTerritoryReport. Use the template we created in the previous chapter.

Find the SQL script called uspSalesPersonSalesByYear.sql and execute it to create a stored procedure called dbo.uspSalesPersonSalesByYear. This stored procedure has one parameter, that is, @SalesTerritory.

As you might have noticed, the query returns sales total for years 2005, 2006, 2007, and 2008 by territory, using the PIVOT function in T-SQL.

Again, let's keep this simple:

  1. Drag a table object into the body of our report. We only need five columns for this report.

    Note

    The report designer added an ID prefix to our year columns (for example, ID2005) because field names must start with a letter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required