Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs

Create SSRS Report using Stored Procedure

by suresh

In this article, we will show you how to create an SSRS Report using Stored Procedure with an example. It’s one of the frequently asked questions by SSRS followers. To demonstrate the same, we are going to create a Stored procedure on the Adventure Works DW database.

The below screenshot shows the data that we are going to use in this SSRS stored procedure:

TIP: If you want to create a custom Stored Procedure, visit the SQL Stored Procedure article in SQL Server.

Create SSRS Report using Stored Procedure 1

Now, Let me write SQL query to create a Stored Procedure on Adventure Works DW:

USE [AdventureWorksDW2014]
GO

IF OBJECT_ID ( 'SP_ProductSales', 'P' ) IS NOT NULL   
    DROP PROCEDURE SP_ProductSales;  
GO
 
CREATE PROCEDURE [dbo].[SP_ProductSales]
AS
BEGIN
      SET NOCOUNT ON;
	  SELECT Prod.Color, 
             Prod.EnglishProductName AS ProductName, 
             Fact.SalesAmount,
	         Fact.OrderQuantity, 
             Fact.TotalProductCost, 
             Fact.TaxAmt
       FROM DimProduct AS Prod 
         INNER JOIN FactInternetSales AS Fact 
            ON Prod.ProductKey = Fact.ProductKey 
END
GO

OUTPUT

Create SSRS Report using Stored Procedure 2

Create SSRS Report using Stored Procedure

In this example, we are going to create a 3D Clustered Column Chart to display the step by step approach to create an SSRS Report using Stored Procedure. The below screenshot will show you the Data Source and Dataset we are going to use for this SSRS Clustered Column Chart Report.

Here, we have to change the Query type from Text (which is the default) to the Stored procedure.

Create SSRS Report using Stored Procedure 3

Next, Please select the required stored procedure name from the available list. From the below screenshot, you can see that we are choosing the stored procedure that we created earlier.

Create SSRS Report using Stored Procedure 4

Lastly, please navigate to the Fields tab, and check whether we got all the fields from our stored procedure or not. Here you can add Calculated Fields also.

Create SSRS Report using Stored Procedure 5

In the SSRS report design, we can add a Clustered Column chart by dragging the Chart property from the SSRS Toolbox to Design space. Or right-click on the report designer to open the context menu. From the context menu, please select the Insert -> Chart option.

Create SSRS Report using Stored Procedure 6

Once you select the Chart option, a new window called Select Chart Type will be opened to select the required chart from the available once. For this example, we are selecting 3D Clustered Column Chart.

Create SSRS Report using Stored Procedure 7

Once you click on the Ok button, the 3D Clustered Column chart will display in the design region with dummy data.

Create SSRS Report using Stored Procedure 8

Clicking on the space around the Clustered Column Chart will open the Chart Data window.

In this example, we will create a Clustered Column chart for the Total Product Cost and Sales Amount. So, Drag and drop them from dataset to chart data values and Product Color in the category group.

I suggest you to refer to Create Column Chart in SSRS article to understand the creation of Clustered Column chart

Create SSRS Report using Stored Procedure 9

Click on the Preview button to see the report preview.

Create SSRS Report using Stored Procedure 10

From the above screenshot, we created a 3D Clustered Column report using the SP_ProductSales stored procedure in SSRS. Let me Format the chart a bit for a classy look.

Remember, we already explained the Formatting options in the Formatting Column Chart article. So, Please refer to the article to understand the steps.

Create SSRS Report using Stored Procedure 11

Placed Under: SSRS

  • Learn SSRS in 28 Days
  • Create New SSRS Project
  • Create a New SSRS Report
  • SSRS Query Designer
  • SSRS Shared Data Source
  • SSRS Shared Dataset
  • SSRS Embedded Dataset
  • SSRS Embedded Data Source
  • SSRS Lookup – combine datasets
  • SSRS Report Items
  • SSRS Table Report
  • SSRS Table using report wizard
  • Format SSRS Table Report
  • SSRS Matrix Report
  • SSRS Matrix with report wizard
  • Display Image in SSRS Report
  • Add Rectangle to SSRS Report
  • Add TextBox to SSRS Report
  • Create a SSRS List Report
  • Grouping in SSRS Matrix Reports
  • Grouping in SSRS Table Reports
  • Create SSRS Report using Views
  • SSRS report with store procedure
  • Add Total and Subtotal to Report
  • Add Headers & Footers to Report
  • SSRS Global References
  • Export Report to PDF, XML, Excel, Word
  • Format SSRS Table Report
  • Format Textbox Fonts & Bg Color
  • Format Numbers in SSRS Report
  • Format SSRS Report Date, Time
  • Add Row Numbers to Report
  • Headers Visible While Scrolling
  • Repeat Headers on Each Page
  • SSRS Sorting
  • SSRS Interactive Sort
  • Filters at Dataset Level in SSRS
  • Filters at Tablix Level in SSRS
  • Page Breaks in SSRS Report
  • Custom Code in SSRS Report
  • SSRS Calculated Fields
  • SSRS Dashboard Reports
  • SSRS Document Map
  • SSRS Drill Through Reports
  • SSRS Drill Down Reports
  • SSRS Drill Down Matrix Report
  • SSRS Go To URL Action
  • SSRS Subreports
  • SSRS Report Parameters
  • SSRS Cascading Parameters
  • SSRS Multiple Parameters
  • SSRS Multi Value Parameter
  • SSRS Drop Down List Parameters
  • SSRS Charts
  • SSRS Area Chart
  • SSRS Bubble Chart
  • SSRS Column Chart
  • Format SSRS Column Chart
  • SSRS Data Bars
  • Data Bars in SSRS Matrix Reports
  • Format SSRS Data Bars
  • SSRS Funnel Chart
  • SSRS Linear Gauges
  • SSRS Radial Gauges
  • Format SSRS Gauges
  • SSRS Indicators
  • Format SSRS Indicators
  • SSRS Line Chart
  • SSRS Pie Chart
  • Format SSRS Pie Chart
  • SSRS Pyramid Chart
  • SSRS Range Chart
  • SSRS Radar Chart
  • SSRS Scatter Plot
  • SSRS Sparkline
  • SSRS Stacked Bar Chart
  • SSRS Configuration Manager
  • Change Report Manager Title
  • SSRS Deploying Reports in BIDS
  • Deploy using Report Manager
  • SSRS Report Manager Shared DataSource
  • SSRS Cached Reports
  • SSRS Linked Reports
  • SSRS Report Parts
  • SSRS Report Snapshot
  • SSRS Report History Snapshot
  • SSRS Report Subscription
  • SSRS Security
  • Upload File to Report Manager
  • Install SSRS Report builder
  • Report Builder – Create a Report
  • Report Builder – Create a Dataset
  • Report Builder- Create Bar chart
  • Report Builder – Create Pie Chart
  • Report Builder – Create report without wizard

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy