Friday, February 24, 2012

List as report parameter

Any hint how to build a report that prompts user to select multiple values
from a lookup table and uses the multiple values in WHRERE myfield IN
(<user-selected-list>) to select the data?
ThanksReporting Services does not provide this functionality ... supposedly coming
in a future release.
For now, you can just make the parameter a text box so the user can type in
a comma separated list ... then parse the parameter in the filter.
--
Shaun Beane, MCT, MCDBA, MCDST
http://dbageek.blogspot.com
"TheTechie" <TheTechie@.discussions.microsoft.com> wrote in message
news:5398BCA1-4839-46FC-8D40-1C4B81EE8B9E@.microsoft.com...
> Any hint how to build a report that prompts user to select multiple values
> from a lookup table and uses the multiple values in WHRERE myfield IN
> (<user-selected-list>) to select the data?
> Thanks|||Basically you can't - multi value lists are not natively support in the
current version.
You can however roll it yourself, either by dynamically building the sql
string to use JobID In (@.somecommadelimitedlist) or if you have some SQL
skills you can create a function in SQL Server to take a comma separated
list and return a table for use in a query.
Check this out:
http://www.windowsitpro.com/Article/ArticleID/26244/26244.html?Ad=1
--
Mary Bray [SQL Server MVP]
Please reply only to newsgroups
"TheTechie" <TheTechie@.discussions.microsoft.com> wrote in message
news:5398BCA1-4839-46FC-8D40-1C4B81EE8B9E@.microsoft.com...
> Any hint how to build a report that prompts user to select multiple values
> from a lookup table and uses the multiple values in WHRERE myfield IN
> (<user-selected-list>) to select the data?
> Thanks|||Chapter 11 of the book "Hitchhiker's Guide to SQL Server 2000 Reporting
Services" provides a work-round to have a multi-select pick list in the
parameter area.
It is quite well explained, starting out with a comma-separated textbox, but
involves some careful editing...
HTH

No comments:

Post a Comment