Passing Parameters Into A Report
RE: SQL SERVER REPORTING SERVICES 2005 Morning to all, I have a question which I hope somebody out there can help me with. I have a report which uses the following query; select name ,address ,telphone ,fax from people where band in(@band) I know I can add a multi-value parameter to the report to select all required bands, but I do not want to give the user the choice to select said bands for themselves. For example if Jeff is responsible for bands 1 and 2 I would like the query to reflect that without Jeff having to input any information i.e. select name ,address ,telphone ,fax from people where band in(1,2) I have looked into passing parameters via URL, adding and hiding the parameter on the report but can only find very basic stuff like adding &band=1 after Render and am unable to find a way of specifying more than one value. I am open to any suggestions via URL or programmatically as I am calling the report from within a .Net application. Thanking you for your help in advance and for taking the time to read this post. Gary
November 29th, 2010 5:29am

Hi G Whyman, You need to create a table dbo.UserBand linking a user to bands, for example UserID Band Enabled Jeff 1 1 Jeff 2 1 Get a user Login from .NET aaplication and use the following query select name ,address ,telphone ,fax from people where band in(SELECT band from dbo.UserBand WHERE UserID = @User AND Enabled <> 0). Set @User to hidden parameter. Sergei
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2010 6:34am

Hi Sergei, Thanks for the post. I can actually get the bands from the user object and was hoping to pass them straight to the report. Your solution is completely valid but would involve addition admin when new users are created thus I doubt my boss would go for it. Is there no way of passing an IN through the URL or any other way? Thanking you again for the help. Gary
November 29th, 2010 6:51am

You can pass multivalues by constructing a string or expression as shown below and then passing it ="http://<servername>/Reportserver?%2fFolderName%2fReportName&rs:Command=Render&Parameter1=" & Join(Parameters!Parameter1.Value, "&Parameter1=") Have a look at the thread below also (and you will find many related posts also on the right hand side) http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/f14815fe-2c2c-4a36-8db9-93b88eb60142Cheers, Jason P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2010 6:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics