I developed SSRS report and integrated with .net. for security purpose i want to restrict some parameters values to users. this restriction is changed by users level. Example if i am a admin user i want to see all values which are passing in parameter1,
if i am a user1 user i want to see only one value in parameter1.
Can any one help me how to set parameters and based on parameter1 how to handle the dependent and dependencies parameters.
"if i am a admin user i want to see all values which are passing in parameter1, if i am a user1 user i want to see only one value in parameter1. " in this
"I want to see all the parameters..." as "i want to display all the paraters..." ..
now in reportviewer control, set the property so that it won't prompt for parameters.
now as per the login show the paraters using asp.net server controls.
now on the button click event, read the values from the asp.net server controls and send it as parameters to the report.
all the best
"Marking as Answer" on right answers helps others
RkChaudary
blog
Thanks for you reply. can u give me a clear picture about your solution. i am didn't get where the global parameter will available,
am i want to change in cube level or in ssrs or in .net. if possible explain me with a sample
I developed SSRS report and integrated with .net. for security purpose i want to restrict some parameters values to users. this restriction is changed by users level. Example if i am a admin user i want to see all values which are passing in parameter1,
if i am a user1 user i want to see only one value in parameter1.
Can any one help me how to set parameters and based on parameter1 how to handle the dependent and dependencies parameters.
Thanks in advance
Regards,
Madhavi
Hi,
the easiest solution for me will be building of 2 reports. One for admin and other for user.
"in my query i want to change the values of the parameter depends on the login.
example: in report - Match parameter contain Match1,Match2.
for ABC user - Match1, for XYZ user - Match2 like this i have saved in database.
if ABC login then Match parameter show only Match1 and if XYZ login then Match parameter show only Match2"
follow cioina's suggestion and as per the logged in user type display the corresponding report.
OR
still if you want go for only one report then,
as per the user login in your website - fill the asp controls with the required data. if logged in as admin then fill match dropdownlist with match1 or user1 then fill dropdown with match2...
in this case you read the data being entered from asp.net server controls and pass them to report service.
bold letters here are just for highlight purpose only
"Marking as Answer" on right answers helps others
RkChaudary
blog
Thanks for your quick response. i almost reached to end solution but with a small change. As per your points =User!UserID retrieves the current system userid. but instead of this i want to retrive the userid from database which is login in asp.net application
and i capturing in session.
I tried in this way
1) Add a new parameter, check the Internal CheckBox, in the default values 'Select Non Queried' and write the expression as =User!UserID
chandumadhav...
Member
316 Points
77 Posts
how to retrive selected parameter label of SSRS using .net
Jan 27, 2009 05:27 AM|LINK
hi
I developed SSRS report and integrated with .net. for security purpose i want to restrict some parameters values to users. this restriction is changed by users level. Example if i am a admin user i want to see all values which are passing in parameter1, if i am a user1 user i want to see only one value in parameter1.
Can any one help me how to set parameters and based on parameter1 how to handle the dependent and dependencies parameters.
Thanks in advance
Regards,
Madhavi
rkchaudary
Contributor
2524 Points
545 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 27, 2009 08:11 AM|LINK
Hi Madhavi,
i am taking that
"if i am a admin user i want to see all values which are passing in parameter1, if i am a user1 user i want to see only one value in parameter1. " in this
"I want to see all the parameters..." as "i want to display all the paraters..." ..
now in reportviewer control, set the property so that it won't prompt for parameters.
now as per the login show the paraters using asp.net server controls.
now on the button click event, read the values from the asp.net server controls and send it as parameters to the report.
all the best
RkChaudary
blog
chandumadhav...
Member
316 Points
77 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 27, 2009 08:52 AM|LINK
hi rkchaudary
thanks for your response. in my query i want to change the values of the parameter depends on the login.
example: in report - Match parameter contain Match1,Match2.
for ABC user - Match1, for XYZ user - Match2 like this i have saved in database.
if ABC login then Match parameter show only Match1 and if XYZ login then Match parameter show only Match2
Hope u understood my query
Regards,
Madhavi
ShilpaReddyA
Participant
1084 Points
137 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 27, 2009 09:38 AM|LINK
Hello,
There is a Global Parameter called 'User!UserID' which will gives the Log in UserName.
Add a Internal Parameter, and set the Default Value for the Parameter as 'User!UserID'.
In your query write a Where Condition like User = @internalparamname
If you have any questions let us know.
Hope this helps
http://www.gmail.com
chandumadhav...
Member
316 Points
77 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 27, 2009 09:52 AM|LINK
Hi Shipa
Thanks for you reply. can u give me a clear picture about your solution. i am didn't get where the global parameter will available, am i want to change in cube level or in ssrs or in .net. if possible explain me with a sample
Waiting for your reply
Regards,
Madhavi
ShilpaReddyA
Participant
1084 Points
137 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 27, 2009 10:58 AM|LINK
Hello,
The Global Parameter is in the Report.
Follow the below steps
1. Add a New Parameter in Report. letssay username
2. Check the 'Internal' CheckBox.
3. In the Default Values 'Select Non queried'' and write the expression as =User!UserID.
Now in your Match Parameter Query, Add a where statement as
SELECT match from table WHERE username(which is the column name in your table) = @Username.
Make sure that change the 'username' parameter is above the 'match' parameter in Report Parameters.
This will give you the match names , with respect to the permissions for the user.
http://www.gmail.com
cioina
Contributor
3728 Points
878 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 27, 2009 12:54 PM|LINK
Hi,
the easiest solution for me will be building of 2 reports. One for admin and other for user.
Alexei Cioina.
My website based on SSRS 2005
rkchaudary
Contributor
2524 Points
545 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 28, 2009 04:13 AM|LINK
Hi Madhavi,
"in my query i want to change the values of the parameter depends on the login.
example: in report - Match parameter contain Match1,Match2.
for ABC user - Match1, for XYZ user - Match2 like this i have saved in database.
if ABC login then Match parameter show only Match1 and if XYZ login then Match parameter show only Match2"
follow cioina's suggestion and as per the logged in user type display the corresponding report.
OR
still if you want go for only one report then,
as per the user login in your website - fill the asp controls with the required data. if logged in as admin then fill match dropdownlist with match1 or user1 then fill dropdown with match2...
in this case you read the data being entered from asp.net server controls and pass them to report service.
bold letters here are just for highlight purpose only
RkChaudary
blog
chandumadhav...
Member
316 Points
77 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 28, 2009 04:59 AM|LINK
Hi Shilpa
Thanks for your quick response. i almost reached to end solution but with a small change. As per your points =User!UserID retrieves the current system userid. but instead of this i want to retrive the userid from database which is login in asp.net application and i capturing in session.
I tried in this way
1) Add a new parameter, check the Internal CheckBox, in the default values 'Select Non Queried' and write the expression as =User!UserID
2) in ASP.NET
ReportParameterInfoCollection rptCollection;
rptCollection = ReportViewer1.ServerReport.GetParameters();
ReportParameter rpUser = new ReportParameter("User");
rpUser.Values.Add("30c1fadc3fc745e5");
ReportViewer1.ServerReport.SetParameters(new ReportParameter[] { rpUser });
But it throws error "The report parameter is read-only and cannot be modified. (rsReadOnlyReportParameter)"
Can u help me how to rectify this error
Regards,
Madhavi
ShilpaReddyA
Participant
1084 Points
137 Posts
Re: how to retrive selected parameter label of SSRS using .net
Jan 28, 2009 08:14 AM|LINK
Hello,
If the UserName is from Db, Then In the Report Parameters, Uncheck the 'Internal' checkbox and check 'Hidden' CheckBox.
Remove the Default Value User!userID. and Check The 'Null' CheckBox under the Default Values.
Hope this will give you the Correct result.
http://www.gmail.com