Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Static Pick List

Author  Topic 

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-10-08 : 14:25:11
Is it possible to make a pick list and then use it as the parameter? I'm new to reporting services, so hopefully this might be possible.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-08 : 14:26:19
Yes. You need to create another dataset that contains the values for the drop down. Point this dataset at your parameter.

Tara
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-10-08 : 15:05:08
Thank you for replying. Can you go into more detail?

Let me clarify myself here a little bit. I'm trying to create a picklist of menu. So in my report the user can just select one of the item menu and it will trigger that certain query to display information base on that menu. The picklist is not from the database. For example in my picklist I have Customer, Employee, Contact, and Product. If the user selects one of these, it will be use as the parameter for that certain select statements. So let say that if the user wants Employee information, they select the menu Employee and it will display information base on that menu selection.

If I'm not making myself clear, please let me know.

Thanks.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-08 : 15:10:03
Create a new dataset that is:

SELECT 'Customer' AS PickList
UNION ALL
SELECT 'Employee' AS PickList
UNION ALL
SELECT 'Contact' AS PickList
UNION ALL
SELECT 'Product' AS PickList


Go to Report Parameters in Visual Studio. Select your parameter. In the available values section, select From query, then select your new dataset.

Tara
Go to Top of Page

kselvia
Aged Yak Warrior

526 Posts

Posted - 2004-10-08 : 23:47:09
When you create the parameter you can manually enter the list of items instead of retrieving them with a query.

--Ken
I want to die in my sleep like my grandfather, not screaming in terror like his passengers.
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-10-12 : 14:49:17
tdugga,

That is what I need. Thank you so much. Another question pertaining to this thread. Let say I want to trigger a certain query base on what the user pick from the picklist. How would I go about doing this.

Example:

SELECT NAME, CITY, STATE, PHONE
FROM CUSTOMER
WHERE <dataset - (picklist)> = 'Customer'

???? Hope you can help me out with this.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-12 : 15:05:45
I don't understand your query.

Tara
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-10-12 : 15:30:34
My query is using the 'Customer' from the picklist as parameter. So I want to create a SELECT query that will retrieve that information if the user pick the 'Customer' menu from the picklist. In the Where clause, how do I specify it so that it will use the picklist as the Where Clause. The query in the Where Clause is not right because I don't know how to specify this. LEt me know if this makes sense.

Thanks.
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-10-12 : 15:36:43
Maybe this will make sense. I use the verify query and it seems to verify that it's working. Not sure if this will return the result I'm looking for. Will neet to test.

SELECT NAME, ID, CITY, STATE
FROM CUSTOMER
WHERE (@picklist = 'Customer')
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-10-12 : 15:51:34
It works, but the only problem is how to dynamically change the report layout base on what the user has pick. For example if the user choose 'Customer', it will list the ID, Name, City, and State. But let say that if the user selects the 'Employee', it will list ID, Name, Phone, and Salary.

I'm fairly new to Reporting Service and not sure if this is a feature that reporting services can or cannot do. I know that I can use links to jump from one report to the next, but will need to play more with it. Any suggestions?
Go to Top of Page
   

- Advertisement -