Support our 100% FREE Projects: Donate Now OR Sponsor Now


  

ssrs create simple parameter

This tutorial explains how to create a simple parameter in SSRS report and use it to filter your data. In this tutorial I will SSRS 2008 R2 and it should be the same in SSRS 2008 and SSRS 2012.

Below you can see the table which shows twelve months average temperature in Majorca. Let's say there is a requirement to show only one month at a time using parameter.

In my design view you can see I already have a dataset and a report table. In order to add a paramater to the report I open "Report Data" pane, right click parameters folder and click add parameter.


Now we need to setup Name (used internally), Prompt (which is what users will see), and Data Type. In this case Name is Month the same for Prompt and data type is Text. Click ok.

NOTE: In this tutorial we won't be discussing importance of data types and other option available but we will write new blog post to cover them.

 

Now that we have created a parameter we need to use it to filter the datase.

NOTE: There are multiple ways to filter data. We use the most common one and add filter to the SQL statement. Very often you might use stored procedures and pass parameters as a stored procedure argument.

To add the filter to our SQL Select we just add the following where clause:

WHERE Month = @Month

@Month is our parameter and will be replaced with whatever we type in the parameter text box when we run the report.

 

 

Let's preview our report.

We can notice Month parameter with empty text box. I will type January. and click view report.

As you can see the report was filtered and I get only one row for January.

NOTE: Very often you will use default values, calendars or drop down boxes as your parameters and I will write some blog posts about it soon.

 

I hope this SSRS tutorial will help you to create a simple parameter.

 

Take care

Katie

Share: Share on FacebookShare on Google PlusTweet it
Comments Add Comment
Name: Qaiser
Comment:

Simple & Nice tutorial


Date Posted: 22/05/2012 7:22:23 AM

Name: ROHIT
Comment:

 how make a parameter to delete  or add the  coloum in the table through ssrs

with regards

rohitsethi123@rediffmail.com


Date Posted: 14/08/2012 11:31:44 AM

Name: sunny
Comment:

hello sir/madam.....

 

i would like to ask that we can update our report at runtime or not....


Date Posted: 04/12/2012 5:31:16 AM

Name: Emil
Comment:

Hi

It depends what you mean by updating your report at runtime. Could you please specify more details?

Regards

Emil


Date Posted: 05/12/2012 7:46:51 PM

Name: SQL
Comment:

Thanks a lot


Date Posted: 19/02/2013 6:46:27 AM

Name: Ankit Gupta
Comment:

Very Nice and simple example thank you so much for such nice posts


Date Posted: 02/03/2013 6:55:05 AM

Name: Pradeep
Comment:

Sir / Madam

Really very good article and easy understanding about report parameters.

Could you please explain how to use aggregate function like sum,count in reports

 


Date Posted: 19/04/2013 7:03:45 AM

Share your thoughts, questions and suggest improvements:
Add Comment

You found us! Below are 50 most popular searched keywords

created at TagCrowd.com

Disclaimer: While every caution has been taken to provide our readers with most accurate information and honest analysis, please use your discretion before taking any decisions based on the information in this blog. Author will not compensate you in any way whatsoever if you ever happen to suffer a loss/inconvenience/damage because of/while making use of information in this blog.