Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
578 views
in Technique[技术] by (71.8m points)

sql server - How do I allow a drop-down list parameter in SSRS to have a default value of "-- All -- "?

I have a drop-down list that gets populated based on a stored-procedure - that parts works fine.

enter image description here

It gets populated dynamically, based on whatever the "Survey ID" is

But I don't want it to say <Select a Value> , rather it should say " -- All -- " , because that is how the report works.

So far I tried to create a dummy-dataset that returns Null and the label of "all" but it didn't work. Maybe I did that wrong? I used this:

select distinct  Name, ID  from LK_TargetTypes
where Name like '%pizza'
union select '-- All --', null ;

So LK_TargetTypes is some irrelevant table. I want to merge that with the other DDL-values.

Here's another picture:

enter image description here

Any tips appreciated thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You are doing it right by returning the -- All -- option as part of the dataset that the query is based on.

You are getting the <Select a Value> message because, well, you haven't selected a value. What you need to do is assign the default value of -- All -- to this parameter. Open the parameter settings and click on the Default Values tab and enter the default value, which in this case is Null for -- All --.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...