User based default values for the report parameters
Hi,My client has come with a new requirement that report parameters should be defaulted based on the user login details. Lets say i own few counties and my counter part owns few. If i generate report from my login in report parameter should get defaulted to the counties that I own and it should work in the same way for my counter part too. Has any one tried this ?
May 12th, 2011 12:16am

Hi Karthik, Here is what you can do. Assuming that the data source you are connecting to is a SQL Server database, you could have a second column in your counties table by name of User (anything you desire) and have a user name for every county. This provides us means of identifying which county belongs to which user. (Looking at what you say, you might already have this). Within your SSRS report, you could then declare a parameter by name of @User and set its default to User!UserID; this gives us the user id of the person running the report, at runtime. In your SQL query for your parameter you could then have a SELECT similar to this: SELECT County FROM some_table WHERE some_table.user = @User You can also read a little more on this at the following link: http://blogs.msdn.com/b/tudortr/archive/2004/07/20/189398.aspx Let me know if you need any help or info. regarding the same! HTH Please mark correct answers :)
Free Windows Admin Tool Kit Click here and download it now
May 12th, 2011 1:54am

Hi Karthik, Here is what you can do. Assuming that the data source you are connecting to is a SQL Server database, you could have a second column in your counties table by name of User (anything you desire) and have a user name for every county. This provides us means of identifying which county belongs to which user. (Looking at what you say, you might already have this). Within your SSRS report, you could then declare a parameter by name of @User and set its default to User!UserID; this gives us the user id of the person running the report, at runtime. In your SQL query for your parameter you could then have a SELECT similar to this: SELECT County FROM some_table WHERE some_table.user = @User You can also read a little more on this at the following link: http://blogs.msdn.com/b/tudortr/archive/2004/07/20/189398.aspx Let me know if you need any help or info. regarding the same! HTH Please mark correct answers :)
May 12th, 2011 8:52am

Hi Thanks for the inputs. I beleive i didnt explain my requirement in detail. Default value what they wanna set is not static. They want to default it based on the selection by the user in his previous session. What they are really looking is if he select abc, bcd, cdf and run the report today and close the report. when he comes back on the next day they expect the report to run with the same set of values selected by him on the previous day as default value for the parameters. Also this should be userid specific.
Free Windows Admin Tool Kit Click here and download it now
May 12th, 2011 10:03am

No thoughts on this ?
May 14th, 2011 2:16am

No thoughts on this ?
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2011 2:16am

Hello, This type of functionality is not possible in SSRS. HTH, Ram
May 14th, 2011 2:33am

Hello, This type of functionality is not possible in SSRS. HTH, Ram
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2011 2:33am

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

Other recent topics Other recent topics