SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SSRS Parameter help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Briceston
Yak Posting Veteran

54 Posts

Posted - 10/29/2013 :  12:53:29  Show Profile  Reply with Quote
Hi,

I have a SSRS report with four parameters,and I want to be able to enter information for two of the parameters and run the report opposed to all four of them. However, when I select allow blanks and only select the parameters that I want to run the report by, the report come back blank

Essentially, I want to be able to the run report by different parameters without having to enter information for all parameters at the same time.

What is the correct way of going about this?

Edited by - Briceston on 10/29/2013 12:54:09

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 10/29/2013 :  13:56:39  Show Profile  Reply with Quote
you need write logic in your backend query to bypass filtering in case parameter value passed is blank.
ie WHERE clause will look like


..
WHERE(Field1 = @Param1 OR @Param1 = '')
AND (Field2 = @Param2 OR @Param2 = '')
AND (Field3 = @Param3 OR @Param3 = '')
AND (Field4 = @Param4 OR @Param4 = '')


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Briceston
Yak Posting Veteran

54 Posts

Posted - 10/29/2013 :  15:02:45  Show Profile  Reply with Quote
Thanks a lot! Your insight worked great once I made the neccessary adjustments in my logic. Once deployed I assume it should still work correctly as it now?

Thanks again for the help.

quote:
Originally posted by visakh16

you need write logic in your backend query to bypass filtering in case parameter value passed is blank.
ie WHERE clause will look like


..
WHERE(Field1 = @Param1 OR @Param1 = '')
AND (Field2 = @Param2 OR @Param2 = '')
AND (Field3 = @Param3 OR @Param3 = '')
AND (Field4 = @Param4 OR @Param4 = '')


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000