I'm assuming you don't want to use a multi-value parameter here, you only want users to run against all builds or just one, not a selection of builds. Otherwise you'd just use a standard multi-value parameter.
One way to do this is to return an extra row for all builds in your parameter dataset, e.g. something like:
select buildId as null, build = 'All'
union all
select buildId = build, build
from builds
I'm returning two columns here so we can pass a NULL value parameter but still have a user-friendly description to display in the report.
Set this up as your parameter dataset. In the report code you can then use the parameter to do something like:
select *
from builds
where (@build is null or @build = build)
Which will return all builds when @build
is null and a specified build if @build
is not null.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…