Hi!
Is it possible to fill lisboxes dynamically? What I want to do is select a time frame from one listbox, say Year-Month, and pass a fieldname as a value to the query/stored proc that fills the second listbox. I know that it is possible to take a value from one listbox and use it in another one but I can't get this to work.
Thanks in advance!
// Maria
--
Message posted via http://www.sqlmonster.comYes to both questions. First, you are wanting to set the selection for a
parameter to a list. Do the following:
1. create a dataset that you will use that creates the first list.
2. In layout you pick the report menu->report parameters
3. Select available values, from query. You have to set two things: label
and value. Label is what the user sees to select and value is what is
returned as a parameter.
I suggest having a textbox on you form for testing that is set to an
expression that shows the parameter so you can make sure you are getting the
parameters correctly.
4. create a second dataset with a query parameter (a report and query
parameter are two different things but can seem like they are one and the
same because RS creates a report parameter automatically for you). Note, if
you call your query parameter by the same name as the parameter you created
above then they will be mapped to one another, otherwise RS will create
another report parameter. For instance: if you called your report parameter
YearMonth and then your query parameter @.YearMonth (note, case sensitivity
for report paraemeters, match case exactly).
5. Add a second report parameter and have it use as its source the dataset
from 4
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Maria via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:12b79303565b463c838e86b956e656b7@.SQLMonster.com...
> Hi!
> Is it possible to fill lisboxes dynamically? What I want to do is select
a time frame from one listbox, say Year-Month, and pass a fieldname as a
value to the query/stored proc that fills the second listbox. I know that it
is possible to take a value from one listbox and use it in another one but I
can't get this to work.
> Thanks in advance!
> // Maria
> --
> Message posted via http://www.sqlmonster.com|||Thank You, it works perfect! This is really useful for me and the type of reports I'm creating :)
--
Message posted via http://www.sqlmonster.comsql
No comments:
Post a Comment