Report Paramters | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Report Paramters

Hi, Sorry guys but I’m new to this! I’m trying to add a select on my report i.e. select a company name from the drop down box and then run the report to show only the details for that company but once I added a report parameter it shows the drop down list but no matter what it always returns ALL the data! What am I doing wrong? what else do I need to do to make this work? Thanks!
In your data definition section (excuse me Im at home and I dont have RS loaded so I cant see exactly what the tab is called) – you need to refer to your parameter ie
select field1, field2, field3, field4, ….. fieldn
from mytable where comanyname = @ParamCompanyName Graham
Thanks Graham, I’ve already managed to get that far but that will only provide a text box to allow you to TYPE the name of the company name (selection criteria) I won’t to be able to select the company from the drop down box and then view the report against the selection criteria from the drop down box. I’m sure it’s simple! but I can’t for the life of me work out how to do it! I can manage to get the drop down box to display with the company names but as soon as I select a company name and click view report it returns all the companies and not the selection! If I use the: "select field1, field2, field3, field4, ….. fieldn
from mytable where comanyname = @ParamCompanyName" it does perform the correct select but of course this way requires a typed name NOT a selected name.
The problem seems to be as soon as I select Availible values: from query as apposed to non queried it doesn’t acutally do the select it returns everything! and of course I’m sure you need to have the from query option activated in the report parameters dialog box. any more ideas on why that little bit doesn’t work?
Darranp Have you got the dropdown box for selecting company names!? If not, its very simple to get. Goto reports from main menu and click report parameters. There you can assign values[type/getvalues by query] for company names in "Availbale values" table. Which has Label/Value colums. This may solve your problem.

applearner I’m doing all this and the drop down box appears and when I select a company name and view it returns ALL the data and not just the data for that company! Any other ideas anyone?
You can add HyperLink to Combo Items and like it to self page. If need you can trans para to another dataset with your choice on Combo
I can’t figure your problem I had used both based and non-query based list for selection and successfully did "comanyname = @ParamCompanyName" (with and without default value. May be you should check the parameter mapping in the data source properties and ensure that the sql parameter is mapped to report parameter. Bhaskar Babu
Please look at the Reporting Services Demo in microsoft site
URL for the demo is mms://
i’m too facing a similiar problem..
I am to let a user select start and end date then load respective reports..
ANyone know how to?
As mentioned above, change your select query to: select field1, field2, field3, field4, ….. fieldn
from mytable where comanyname = @EndDate RS will automatically generate an input text box called enddate for the user to enter.