October 29, 2013 at 11:17 am
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 comes 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?
Thanks!
October 30, 2013 at 1:58 am
Briceston (10/29/2013)
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 comes 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?
Thanks!
Please post the query for the dataset. If the report executes then the parameters are allowing blanks / nulls. Usually something like :
Select ...
From ....
Where Colour = @Colour
If @Colour allows blanks then only rows with blank '' will match.
Try:
Select ...
From ....
Where Colour = @Colour or @Colour = ''
Fitz
October 31, 2013 at 7:32 am
Mark, thanks for replying. Your example logic below was very helpful. After I introduced into my logic, the report runs fine.
Thanks.
Mark Fitzgerald-331224 (10/30/2013)
Briceston (10/29/2013)
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 comes 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?
Thanks!
Please post the query for the dataset. If the report executes then the parameters are allowing blanks / nulls. Usually something like :
Select ...
From ....
Where Colour = @Colour
If @Colour allows blanks then only rows with blank '' will match.
Try:
Select ...
From ....
Where Colour = @Colour or @Colour = ''
Fitz
October 31, 2013 at 8:18 am
Briceston (10/31/2013)
Mark, thanks for replying. Your example logic below was very helpful. After I introduced into my logic, the report runs fine.Thanks.
Mark Fitzgerald-331224 (10/30/2013)
Briceston (10/29/2013)
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 comes 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?
Thanks!
Please post the query for the dataset. If the report executes then the parameters are allowing blanks / nulls. Usually something like :
Select ...
From ....
Where Colour = @Colour
If @Colour allows blanks then only rows with blank '' will match.
Try:
Select ...
From ....
Where Colour = @Colour or @Colour = ''
Fitz
Hi Briceston and Mark Fitzgerald-331224,
The query Mark Fitzgerald-331224 suggested is an example of what's come to be called a "catch-all query". It can have a serious impact on the database performance. Here's a seminal article on catch-all queries that explains the problem and how to avoid it:
http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/
Jason Wolfkill
October 31, 2013 at 8:28 am
Agreed WolfKillJ. I was providing a quick fix suggestion to the issue and would liked to have seen the dataset query to evaluate other options such as dynamic SQL as suggested in the linked article.
Fitz
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply