default value not working within report
On my reports I have several paratmeters and most of them are tied together, meaning that
parameter 2 is based of the parameter 1 selection
parameter 3 is based off of paratmeter 2
parameter 4 is based off of parameter 3
the issues I'm running into is that, for parameter 2, I want [ALL] to be my default and it's not working, I have the data coming from a query for parameter 2 and [ALL] is not part of the output of the query, could that be the reason?
Example:
parameter 1 options: Ford, Chevy, GMC
parameter 2: is based off of parameter 1, but I want to show [ALL] so they can run a report on all models within the Ford for example, plus show all of the models within the parameter 1 selection.
Any suggestions are appreciated
September 24th, 2012 9:56am
Hi,
Please take a look at this blog post - SSRS parameter default values not working
Hope that helps!
Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2012 4:23pm
Hi There
Thanks for your posting. I think you just need to alter your Model Parameter Dataset and add a union class for you r All models and your query might look like this
Select distinct
modelsID as
modelsID,
modelsDescription as
modelsDescription
FROM
YourTable
Where
Make=@make(-- This I am assuming your parameter which contains(Ford,
Chevy, GMC)
UNION ALL
SELECT NULL
AS modelsID,
'All Models' as
modelsDescription
order by 1
Select distinct
modelsID as modelsID,
modelsDescription as modelsDescription
FROM
YourTable
Where
Make=@make(-- This I am assuming your parameter which contains(Ford, Chevy, GMC)
UNION ALL
SELECT NULL AS modelsID,
'All Models' as modelsDescription
order by 1
and in your parameter
Models
please use this dataset (say Model)
for
getting values. Please make sure to allow null values to this parameter(Model) and go to default values of the Model parameter and put NULL as default value.
When you choose your Make parameter say
Ford,
it will bring all model of ford and add another All models with ID null and by default it will select All model
Now you just need to change your query like this. You could write the query for main dataset like this
AND
modelsID
= ISNULL(@models,
modelsID)
so when the value passed as null it will return all Models
otherwise it will match the Model passed from the parameter
If you have any question please let me know.
Many Thanks
Syed Qazafi Anjum
Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful
September 24th, 2012 4:55pm