Groups | Blog | Home
all groups > sql server reporting services > september 2007 >

sql server reporting services : input parameter in MS SQL 2005 report


-Hillary
9/28/2007 12:00:00 AM
I am designing a report which need to take parameter input by user when the
report is open. Can anyone please tell me how to do this? Using MS SQL 2005
report. Thanks.

00 Michael Jordan
9/28/2007 12:00:00 AM
No, this is not what I want. I want a pop-up window to ask user to input a
parameter when I am a report and this parameter will filter out the data.
Say, when I run a product sales report, a pop-up window can ask me for which
state and I input California. So the report only shows California sales
report. Please help. Thanks.


[quoted text, click to view]

EMartinez
9/28/2007 2:52:10 AM
[quoted text, click to view]


If I understand your question correctly, you will want to pass this
expression (=User!UserID.ToString) as a parameter (via selecting the
Edit dataset [...] button then the Parameters tab on the Dataset tab)
back to the dataset (that should be tied to a stored procedure or
query) that is sourcing the Report parameter. Hope this helps.

Regards,

Enrique Martinez
Sr. Software Consultant
Bruce L-C [MVP]
9/28/2007 8:36:13 AM
RS has full support for parameters. You open up the report and at the top it
lists the parameters. You can select from a predefined (by you) list, you
can put in a value in a text box, you can select from a calendar control (RS
2005). It also has support for multi-select list boxes (RS 2005).

If you create a query with a parameter RS automatically creates the report
parameter.

For instance, lets say my query is
select * from sometable where somefield = 'blahblah'
change to
select * from sometable where somefield = @BlahType

RS will create a report parameter called BlahType and give a prompt of the
same name. You can change the prompt for the parameter by being in the
layout tab, report menu->Report Parameters.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

EMartinez
9/29/2007 5:09:52 PM
On Sep 28, 8:36 am, "Bruce L-C [MVP]" <bruce_lcNOS...@hotmail.com>
[quoted text, click to view]


Bruce's response should work for your scenario. Just to add to it, you
can source the parameter from a separate dataset than the report uses
from the dataset tab (i.e., a query/stored procedure that returns all
states, etc). Let me know if I can be of further assistance.

Regards,

Enrique Martinez
Sr. Software Consultant
AddThis Social Bookmark Button