.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to pass current user's login name as parameter to a RDL . (SSRS integration with sharepoint)

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :SharePoint
I have a webmethod which has two parameters. One is for year and another is for Currently logged in user. I call this method in RDL file. From RDL File how can we pass Currently logged in user's login name? I tried  with USER!UserID. It is passing the USERID but i need to pass the login name(SPWEB.currentuser.loginname)  

View Complete Post

More Related Resource Links

Parameter value filter based on user in SSRS (SharePoint Integration mode)


Hello..we have a reuirement where we have to filter the parameter value in the drop down based on the user who is accessing the report. We have form and Windows authenication enabled in the SharePoint site (some users will be from inside the network using windows and some will be accessing the site using internet using the Form Authentication).

Please let me know what would be the best way to handle this reuirement? Do we need to create a separate table  and store the User Information along with the parameter values they have access to, pass the userid from Report to db and then fileter the records using this table? OR Can we create a SharePoint List to maintain the user access information and then directly fetch the user information from the list using T-SQL to filter the records?

Please let me know your suggestion...


How to get Email of Current User Data View Web Part Sharepoint 2010 and pass to WebService data sour

I have to pass in the email address of the current user to a web service data source (run time) of a Data View Web Part.

My Question is:

a) How can I get Email address of current user based  in DVWP.
I know we can get the CurrentUser using the CurrentUserName but how do we get the Email for the Current User.

b) After getting the Email how do we pass to the Web Service.

How can I filter a Sharepoint 2007 libarry list based on current user login?


Hi all.

I would like to know how I can filter a SharePoint library list based on current user login.

Suppose I have created the followings:

1) A SharePoint form library containing bunch of uploaded InfoPath form data.

2) The InfoPath form template contains a promoted text field called "TargetUser" to store user domain login (ex: DOMAIN\JOE) and every InfoPath form file in the library has a valid domain name stored in the "TargetUser" field.

I have created a custom view for the form library and would like to filter this view so only items whose "TargetUser" field matches current user's login ID are displayed.

I went to Edit View page to customize the view and tried to use the [Me] function but I got a "Filter value is not a valid text string" message instead when clicking OK. Apparently [Me] returns a Person/Group data type and the filter cannot compare its value to that of "TargetUser".

I tried using text functions (ex: TEXT([Me],"") hoping to extract default string value from [Me]. The filter accepts the parameter without any error but the resulting fitlered list does not display any items at all.

I have googled this subject for hours but I have not found any solution.

It would be greatly appreciated if anyone can help me t

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

create current user filter in sharepoint designer or wss3

hi, how can i create a current user filter in sharepoint designer?

SharePoint 2010 AD FS 2.0 Integration - login works then fails, looping back to the adfs server

Hello, I setup SharePoint 2010 Claims auth with AD FS 2.0 following this post: http://blogs.technet.com/b/speschka/archive/2010/07/30/configuring-sharepoint-2010-and-adfs-v2-end-to-end.aspx.  I have no access to the ADFS server, but I think they followed the steps as outlined.  If I do an iisreset (or just recycle the app pool of the SharePoint site) I can login successfully using the remote credentials.  Also I can under security in SharePoint search for and find users and roles from the remote ADFS server. If I close my browser, open a new browser and go to the site I am prompted to login again (this is fine).  I do, using the same credentials, and the login fails because I am redirected between the SP and ADFS servers until the ADFS server stops the redirecting.  I have been doing some digging and I found this post: http://blogs.technet.com/b/speschka/archive/2010/08/09/setting-the-login-token-expiration-correctly-for-sharepoint-2010-saml-claims-users.aspx, which describes the situation I have in point # 3 at the bottom.  I have tried setting the token time out as low as 1 second but this hasn't helped. I have also, just to see, tried setting all the other lifetime settings to 1 second - but no luck.  Because the initial login works I think the setup is correct, but something is maintaining some state that is causing the loop

how to get current logged in user in sharepoint

hi im trying to get current logged in user from sharepoint site. All im getting is domain/administrator. I tried following. SPUser and delegation with elevated privilege. they are also not working for me. following is the code im working. spsite site = new spsite("some site")  spweb web = site.openweb() then im using spuser object to get the user. i went to the following link but it seems that guy was also not able to do this.... http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/4101e616-db5d-4504-ad16-169ff62269fb/   any idea... thanks Aqi

Pass parameter to Hidden Field in SSRS Report

Hi, I have Two Columns in a Table Say As Table1 Column1 = Text Column2= id My SSrs Report has two parameter values as Column1 and Column2. Column2 should be hidden SELECT DISTINCT COlumn1 FROM Table1. i have passed this query dataset to Column1 parameter. Now My requirement is that, when ever column1 drop is selected. the hidden field column2 should fecth the corresponding ID. this column2 has Storeprocedure which will Display the Output when View Report button is clicked Thanks, Saraswathy

Check user and pass at login

Hello!I use a class method that looks something like this to check for user and pass at login:public static bool checkUser(string conn, string user, string pass) { SqlConnection conn = new SqlConnection(conn); string sql = "SELECT User, Pass FROM TableUser WHERE User = @user AND Pass = @pass"; SqlDataAdapter da = new SqlDataAdapter(sql, conn); SqlParameter daUser = da.SelectCommand.Parameters.Add("@user", SqlDbType.NVarChar); SqlParameter daPass = da.SelectCommand.Parameters.Add("@pass", SqlDbType.NVarChar); daUser.Value = user; daPass.Value = pass; conn.Open(); DataSet ds1 = new DataSet(); da.Fill(ds1, "tbl"); int i = ds1.Tables["tbl"].Rows.Count; conn.Close(); if (i == 1) return true; else return false; }...and I just wanted to ask, if there is a shorter/faster way (the user table is on an SQL Server? Also is this way secure?Note: I set the collation for the password field on the SQL Server to be case sensitive so I don't have to account for it in the code.Thx!M

How to get current user in an action of a workflow (without .NET coding) in SharePoint Designer


Does somebody know how to get current user (logon user) in an action of a workflow definition from the Sharepoint Designer 2007. I know how to do it by using .NET coding, but it requires to upload a dll to the bin directory of the application which is not an option due to my company Sharepoint policies.

FBA login fail with correct user and pass



I have developed a custom login page for FBA in Sharepoint 2010. When I use the correct user and pass I get "Object reference not set to an instance of an object" message error and in the Event Viewer I have "An exception occurred when trying to issue security token". However when I use an incorrect user and pass the token is always NULL. It seems that method I use in the login button click event code which is shown below recognize the user and pass as valid but cannot issue the security token. Could you please help?

userProviderName = "SQL-MembershipProvider";
roleProviderName = "SQL-RoleManager";

 SecurityToken tk = SPSecurityContext.SecurityTokenForFormsAuthentication(
                    new Uri(SPContext.Current.Web.Url), userProviderName, roleProviderName,
                    txtUserId.Text, txtPassword.Text);
if (tk != null)
            lblMessage.Text = "token no es nullo";
            lblMessage.Text = 

retrieve username from login control to pass it on as a parameter for poplulation of dropdown box.


Hi guys,

Would appreciate some help with this.

after a successful login I'd like to retrieve the users' name via C# and pass the name on as a parameter to populate a dropdown box or a grid view on the redirected page.

To authenticate a user I use the asp.net login control and I saw that I have access to several properties and methods but can't see text or value to just get the name back and pass it on for further processing.

Am I thinking wrong here?

Any hint on how to accomplish this is much appreciated.



how to get current logged in user for sharepoint site


Hi ,

im not able to get the current logged in user for sharepoint site.

for example--if i logged in with "abc" in my system and  logged in with "pqr" on sharepoint site.
then "oWeb.CurrentUser " return the "abc" .
 but as per me..i want pqr--bez im logged in to share point site with "pqr" user.

Can I pass a user's active directory group as a parameter to reporting services?


Hi there,

I am wondering if I can pass a user's active directory group as a parameter to reporting services? If so, how can I do that (e.g. where can I get that group from?)?

Is there something as User.UserID for active directory groups?

Many Thanks and best wishes



Adding Current Windows User to Database Encounters Existing User with Same Login


In VS2008 in debug mode, I am using SMO to programatically change the users and permissions on a database. Windows authentication alone is being used. I need to limit access to a administrators group and the current user for whom the database has been dynamically created during the first run of the application within their current Windows environment on the machine. I have no problems creating and assigning the administrators group, but when I try to create the user using the environment's UserDomainName and UserName variables (which would be my creditals) I encounter an inner exception "The login already has an account under a different user name". Before doing running the app, I manually have checked the local server for user and logins with my credentials and programatically looked at each login but have not found any matching credentials. 

Insights and suggestions appreciated.


SharePoint 2010 Security (Prompts for Login) Issue with SSRS report with Out of Box Web Part


Hi All,

I have a SSRS Customized Report (.RDL). I have a web part with association on one of the report. When I try visit the page I am prompted for credenatial.

My Data Source Properties are as per below

Use this user and Password

  user name: domain\myadminuser


Selected: use as win auth

Selected: Impersonate


How Can I get rid of prompt?






SharePoint 2010 Security (Prompts for Login) Issue with SSRS report with Out of Box Web Part


Hi All,

I have a SSRS Customized Report (.RDL). I have a web part with association on one of the report. When I try visit the page I am prompted for credenatial.

My Data Source Properties are as per below

Use this user and Password

  user name: domain\myadminuser


Selected: use as win auth

Selected: Impersonate


How Can I get rid of prompt?





ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend