How to get current user in Exchange 2007 OWA customization page?

Hi,all
I customize an ASPX page(smsconfig.aspx) in Exchange 2007 OWA( this file in ..\Exchange\ClientAccess\OWA\smsconfig.aspx, I don't modify registry.xml & web.config).
My Exchange 2007 OWA has been configurated with Forms-Based Auth.
https://mail.myexchange.com/owa/smsconfig.aspx The page works fine, but it cannot get current logon user with HttpContext.Current.User.Identity or
UserContext.MailboxIdentity or UserContext.LogonIdentity
<%@ Page language="c#" AutoEventWireup="false" Inherits="Microsoft.Exchange.Clients.Owa.Core.OwaPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import namespace="Microsoft.Exchange.Clients"%>
<%@ Import namespace="Microsoft.Exchange.Clients.Owa.Core"%>
<%@ Import namespace="Microsoft.Exchange.Clients.Owa.Premium"%>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Text" %>
<script runat="server">
。。。(my codes in here)
</script>
thanks for your help.
Your Passion.My Potential.

Microsoft.Exchange.Clients.Owa.Core.OwaContext.Current.UserContext.LogonIdentity.PrimarySmtpAddress
Высказанное мною здесь - мои личные взгляды, а не позиции корпорации Microsoft. Вся информация предоставляется "как есть" без каких-либо гарантий.

Similar Messages

  • Urgent : How to get current user id

    Hello,
    fnd_global.user_id returns -1
    fnd_profile.get('user_id',x_user_id) return null
    can anyone help how to get current logged in user to apps.
    Regards,
    Dinesh.

    Hi Dinesh,
    You must also make sure you have initialised the app.
    If you run this from sqlplus then it will return -1.
    If however you run this from within a concurrent program then the user id will be returned.
    Try using this from sqlplus fnd_global.apps_initialize
    Eg.
    begin
    dbms_output.put_line(fnd_global.user_id);
    fnd_global.apps_initialize(user_id => 3551,
    resp_id => 1,
    resp_appl_id => 1);
    dbms_output.put_line(fnd_global.user_id);
    end;
    /

  • How to set Current User in moss 2007 for Authentication....

    Hi Team,
    We have current running website where we have user id to login but now requirement is that user will login with his Email address. Email is stored in active directory, I'm able to login with fba authentication.  
    I'm able to retrieve the user id of current user using Email but
    I am NOT able to set that user id for current user for further authentication using Moss 2007.
    Please find the source code for login and authentication page:
    //---------------------------Login Page--------------------//
        public partial class Login : System.Web.UI.UserControl
            #region Decleration
            string LoginStatus = null;
            string UserCurrent = null;
           static SPUser siteuser;
           // private static string _randomNumbercheck;
            //private static bool IsLoggedin;      
            Random random;
            #endregion       
            #region Page Load
            protected void Page_Load(object sender, EventArgs e)
                this.hplchangepw.Visible = false;
                this.hplmytask.Visible = false;
                string desturl = SPContext.Current.Site.Url;
                if (!IsPostBack)
                    try
                        string str;
     SPWeb web = SPContext.Current.Web;
                             SPUser siteuser = web. .CurrentUser; 
                        //SPUser siteuser = spWeb.EnsureUser(username);
                        str = (siteuser == null ? "" : siteuser.ToString());
                        this.Login.TitleText = "";
                        this.Login.DestinationPageUrl = desturl;
                        //if (HttpContext.Current.Request.UrlReferrer != null)
                        //    if (this.Page.User.Identity.IsAuthenticated && ((Session["test1"].ToString() == _randomNumbercheck) || LoginControl.Class1.IsLoggedIn))
                         if (this.Page.User.Identity.IsAuthenticated)
                               // _randomNumbercheck = "";
                                this.hplregister.Visible = false;
                                this.hplforgetpassw.Visible = false;
                                this.hplchangepw.Visible = true;
                                this.hplmytask.Visible = true;
                                this.Login.Visible = false;
      if (str.StartsWith("fba_"))
                                    string name = str.Split(':').GetValue(1).ToString();
                                    LoginnameLbl.Text = "<b>" + name.ToString() + "</b>,<br><br>Haryana Urban Development Authority Welcomes
    You. <br><br><br><b><i>\"In The Service Of Masses\"</i></b>";
                                else
                                    string name = str.Split('\\').GetValue(1).ToString();
                                    LoginnameLbl.Text = "<b>" + name.ToString() + "</b>,<br><br>Haryana Urban Development Authority Welcomes
    You. <br><br><br><b><i>\"In The Service Of Masses\"</i></b>";
                            else
                                this.hplchangepw.Visible = false;
                                this.hplmytask.Visible = false;
                                this.Login.Visible = true;
                                LoginnameLbl.Text = "";
                                HttpContext.Current.Session.Clear();
                                HttpContext.Current.Session.Abandon();
                    catch (Exception ex)
                        //HttpContext.Current.Session.Clear();
                        //HttpContext.Current.Session.Abandon();
            #endregion
            #region Get Audit Informations
            public void GetUserInfo()
                try
                    string user = Login.UserName;
                    SPSecurity.RunWithElevatedPrivileges(new SPSecurity.CodeToRunElevated(delegate()
                        using (SPSite oSite = new SPSite(SPContext.Current.Site.ID))
                            using (SPWeb web1 = oSite.OpenWeb(SPContext.Current.Web.ID))
                                SPListItem item = null;
                                SPListItemCollection listItems = null;
                                web1.AllowUnsafeUpdates = true;
                                siteuser = web1.EnsureUser(Session["User"].ToString());// spWeb.EnsureUser(login);
                                listItems = web1.Lists["Audit_Trail"].Items;
                                item = listItems.Add();
                                item["User_ID"] = UserCurrent.ToString(); //Request.ServerVariables["AUTH_USER"];
                                string ip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                                if ((ip == null) || (ip == "") || (ip.ToLower() == "unknown"))
                                    ip = Request.ServerVariables["REMOTE_ADDR"];
                                item["IP_Address"] = ip;
                                item["Login_Date"] = System.DateTime.Now;
                                item["Login_Status"] = LoginStatus.ToString();
                                item.Update();
                                web1.AllowUnsafeUpdates = false;
                                web1.Dispose();
                                oSite.Dispose();
                catch (Exception ex)
            #endregion
            #region MD5Encryption
            private string MD5Encryption(string strToEncrypt)
                System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding();
                byte[] bytes = ue.GetBytes(strToEncrypt);
                // encrypt bytes
                System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
                byte[] hashBytes = md5.ComputeHash(bytes);
                // Convert the encrypted bytes back to a string (base 16)
                string hashString = "";
                for (int i = 0; i < hashBytes.Length; i++)
                    hashString += Convert.ToString(hashBytes[i], 16).PadLeft(2, '0');
                return hashString.PadLeft(32, '0');
            #endregion
            #region Generate Random Code
            private string GenerateRandomCode()
                random = new Random();
                string s = "";
                for (int i = 0; i <= 6; i++)
                    s = string.Concat(s, this.random.Next(10).ToString());
               // _randomNumbercheck = s;
                return s;
            #endregion
            #region Generate Random String
            public string GenerateHashKey()
                StringBuilder myStr = new StringBuilder();
                myStr.Append(Request.Browser.Browser);
                myStr.Append(Request.Browser.Platform);
                myStr.Append(Request.Browser.MajorVersion);
                myStr.Append(Request.Browser.MinorVersion);
                myStr.Append(Request.LogonUserIdentity.User.Value);
                SHA1 sha = new SHA1CryptoServiceProvider();
                byte[] hashdata = sha.ComputeHash(Encoding.UTF8.GetBytes(myStr.ToString()));
                return Convert.ToBase64String(hashdata);
            #endregion
            #region Check User Authentication
            protected void Login_Authenticate(object sender, AuthenticateEventArgs e)
                Utility hu=new Utility();
                int CheckValue = 0;
                string user = Login.UserName;
                if(user.Contains("@"))
                    CheckValue=1;
                //Encrypted Password
                string HPassword = hash.Value;
                // Verify that the username/password pair is valid
                SqlConnection con = new SqlConnection();
                SqlCommand cmd = new SqlCommand();
                con.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["FBAPortalConnection"];
                if (con.State == ConnectionState.Closed)
                    con.Open();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "sp_Portal_ValidatePortalUser";
                cmd.Connection = con;
                cmd.Parameters.Add("@ID", SqlDbType.NVarChar, 256).Value = Login.UserName;
                cmd.Parameters.Add("@Password", SqlDbType.NVarChar, 300).Value = HPassword.ToString();
                cmd.Parameters.Add("@CheckVal", SqlDbType.Int).Value = CheckValue;
                cmd.Parameters.Add(new SqlParameter("@P_Return", SqlDbType.NVarChar, 256));
                cmd.Parameters["@P_Return"].Direction = ParameterDirection.Output;
                cmd.ExecuteNonQuery();
                string CurrentUserName = cmd.Parameters["@P_Return"].Value.ToString();
                cmd.Dispose();
                con.Close();
                //int x = hu.ValidatePortalUser(Login.UserName, HPassword.ToString(), CheckValue);
                if (CurrentUserName != "0")
                    Page.Session["User"] = CurrentUserName;
                    string UserName = Session["User"].ToString();
                    UserCurrent = UserName;
                    LoginStatus = "Successfull";
                    GetUserInfo();
                    e.Authenticated = true;
                    //Session["CustomAuthKey"] = MD5Encryption(Request.ServerVariables["Remote_Addr"] + Request.ServerVariables["Http_Cookie"] + Request.ServerVariables["Auth_User"]);
                    Session["CustomAuthKey"] = MD5Encryption(Request.ServerVariables["Remote_Addr"] + Request.ServerVariables["Http_Cookie"] + UserCurrent.ToString());
                    FormsAuthenticationTicket tkt;
                    String cookiestr;
                    HttpCookie ck;
                    tkt = new FormsAuthenticationTicket(1, UserName, DateTime.Now, DateTime.Now.AddMinutes(15), false, GenerateHashKey());
                    cookiestr = FormsAuthentication.Encrypt(tkt);
                    ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
                    ck.Path = FormsAuthentication.FormsCookiePath;
                    Response.Cookies.Add(ck);
                else
                    // Username/password are not valid...
                    Login.FailureText = "Invalid Username / password";
                    e.Authenticated = false;
            #endregion
            #region Login Error
            protected void Login_LoginError(object sender, EventArgs e)
                // Determine why the user could not login
                Login.FailureText = "Your login attempt was not successful. Please try again.";
                // Does there exist a User account for this user
                MembershipUser usrInfo = Membership.GetUser(Login.UserName);
                if (usrInfo != null)
                    // Is this user locked out?
                    if (usrInfo.IsLockedOut)
                        Login.FailureText = "Your account has been locked out because of too many invalid login attempts. Please contact the administrator to have your account unlocked.";
                    else if (!usrInfo.IsApproved)
                        Login.FailureText = "Your account has not yet been approved. You cannot login until an administrator has approved your account.";
                    else
                        Login.FailureText = "Invalid UserName / Password";
                        UserCurrent = usrInfo.UserName;
                        LoginStatus = "UnSucessfull";
                        GetUserInfo();
                else
                    Login.FailureText = "Invalid UserName / Password";
            #endregion
            #region Logged In
            protected void Login_LoggedIn(object sender, EventArgs e)
                string UserName = Session["User"].ToString();           
                LoginControl.Class1.IsLoggedIn = true;
                //If User Email is [email protected] it will be invalid. Prompt the user to update the email id. 
                LoginControl.Utility hu = new LoginControl.Utility();
                DataSet dsuser = hu.getUserDetails(UserName);
                string email;
                if (dsuser.Tables[0].Rows.Count > 0)
                    email = dsuser.Tables[0].Rows[0]["Email"].ToString();
                    if (email.Equals("[email protected]"))
                        Response.Redirect("/Pages/UserUpdates.aspx", true);
                    else
            #endregion
    //-------------------------------- Authentication code----------------------------//
      private void authenticateuser()
                try
                    if (SPContext.Current.Web.CurrentUser != null)
                        using (SPSite spSite = new SPSite(SPContext.Current.Site.Url))
                            using (SPWeb spWep = spSite.OpenWeb())
                                Utility hu = new Utility();
    _userid = spWep.CurrentUser.Name;
                                DataSet ds = new DataSet();
                                ds = hu.GetPlotid(_userid);
                                if (ds.Tables[0].Rows.Count > 0)
                                    _plotid = ds.Tables[0].Rows[0]["plotid"].ToString();
                                else
                                    if (!SPContext.Current.Web.UserIsSiteAdmin && !SPContext.Current.Web.UserIsWebAdmin)
                                        if (!SPContext.Current.Web.IsCurrentUserMemberOfGroup(SPContext.Current.Web.Groups["Allottee"].ID))
                                            SPUtility.HandleAccessDenied(new Exception("You do not have access to this page"));
                    else
                    { SPUtility.HandleAccessDenied(new Exception("Please login")); }
                catch (Exception ex)
                    //  lblMessage.Text = "Error:" + ex.Message;
                    ShowMessage("Following error has occured while executing the desried event :- " + ex.Message);
    Mohan Prakash

    1. Current work flow :-In web site the user have to register themselves in the web site and enters his details along with user id, password and email id. Once user
    is registered then he will login with his user id and password. The user id is picked from login control and that set in “SPWeb.CurrentUser” as user id and system uses "Membership.ValidateUser" method to Authenticate user for login. 
    2. New Requirement: we would like to facilitate the user to login with Email id as well as user id. 
    Problem: 
    We replaced "Membership.ValidateUser" method to our own method to Authenticate user with email id/user id and password. 
    When user is login with user id and password it is working successfully but in the case of email id and password –“the email id is picked from user control and set as
    "HttpContext.Current.User.Identity.Name" but we are not getting “SPWeb.CurrentUser” and it shows null value.” 
    We are able to get user id from database using email id of user. Please help us how we can set user id in "SPContext.Current.Web.CurrentUser".
    Mohan Prakash

  • How to get Current User Group NAME

    I am using the com.sun.security.auth.module.NTSystem to obtain information on the current user logged into the NT System. This class gives me the user name, all the group SIDs associated with the current user and also the current user's primary group SID.
    But I am not able to retrieve the group Name based on these SIDs.
    Please tell me how to find out the Group Name such as "Workgroup" etc. instead of Group SID.
    This is very urgent. So please help me.
    Thanks in advance!!!

    I'm having the same problem.
    If you found a solution could you post it here.
    Thanks.

  • How to Get current username in custom SharePoint 2010 master page

    Hi,
    How can I get current logged-in username in SharePoint 2010 custom master page?
    Regards,
    Amit

    You can use the SPContext.Web.CurrentUser object to get at the information you're looking for. This can be accessed either via client-side JavaScript or server-side ASP.NET code.
    Getting the logged in user's login and name via JavaScript:
    <script>
    ExecuteOrDelayUntilScriptLoaded(function(){
    var clientContext = SP.ClientContext.get_current();
    var CurrentUser = clientContext.get_web().get_currentUser();
    clientContext.load(CurrentUser);
    clientContext.executeQueryAsync(Function.createDelegate(this,function(){
    // User's Name
    alert(CurrentUser.get_title());
    // User's Login
    alert(CurrentUser.get_loginName());
    }),Function.createDelegate(this,function(sender,args){alert(args.get_message())}));
    },"SP.JS");
    </script>
    And of course, it's even easier via server-side C#:
    <script runat="server">
    String username = SPContext.Current.Web.CurrentUser.Name;
    String userlogin = SPContext.Current.Web.CurrentUser.LoginName;
    </script>
    I hope that helps!

  • How to get Current User from edir C#

    Hi
    1) Using C# Ldap Library, How can I get the current logged in User name
    2) If I have a user name in the following format : User.Ou.Ou.O
    How can I convert that format into a DN and then find the user in
    the tree ?
    Thanks
    KaranMahant
    KaranMahant's Profile: http://forums.novell.com/member.php?userid=64239
    View this thread: http://forums.novell.com/showthread.php?t=386653

    KaranMahant;1857953 Wrote:
    > Hi
    >
    > 1) Using C# Ldap Library, How can I get the current logged in User name
    > ?
    >
    > You can use the 'getbinddn' extension facility to do this (in case you
    > use eDirectory as the server). Check the following sample:
    > http://forgeftp.novell.com/ldapcshar...s/GetBindDN.cs
    >
    > 2) If I have a user name in the following format : User.Ou.Ou.O
    > How can I convert that format into a DN and then find the user in
    > the tree ?
    >
    > There is no helper APIs available in the C# LDAP SDK to convert the
    > dotted format to ',' separated ones. If you are astarter, LDAP expects
    > the data to be in ',' separated format as:
    >
    > cn=user,ou=test,o=org.
    >
    > Thanks
    -WITH REGARDS,-
    *-Palaniappan N-*
    palaniappan1's Profile: http://forums.novell.com/member.php?userid=12325
    View this thread: http://forums.novell.com/showthread.php?t=386653

  • How to get current user for WS

    Hello
    I've created Web Service from Stateless Session Bean with Basic Authentification & Support Logon Ticket features.
    I need to determine current logged user in bean methods.
    UMFactory.getAuthenticator().getLoggedInUser() method requires Request & Response.
    WDClientUser.getCurrentUser() throws NullPointerException when i try call it.

    Hi Aliaksandr,
    try this,
    WDClientUser.forceLoggedInClientUser().getSAPUser().
    getUniqueName();
    In order to the User ID, you have to run your WD application in the Portal.
    Hope it helps,
    - Teecheu

  • How to get Current Log in BO user name in data access driver

    In universe, to get the current log in user is via @Variable('BOUSER').
    Right now, I need to be able to get the user name in the data access driver. I am writing a customized data access driver because we need to patch some where clause on the the query generated by the universe based on the logged-in user info. I only think of using end_sql parameter or adding an universe level filter to patch the @Variable('BOUSER') to the query, which would not work if user want to use customized query.
    Can anyone tell me how to get currentBO user name from connection server ? or how @Variable('BOUSER') is translated into the logged-in user name in the universe?

    Shweta,
    The link you provided was the Auditor guide for BO 6.x, I'm not sure it that is going to help Karen or not.
    Karen,
    There is function called connection
    (usage:  =connection([Query Name]), where [Query Name]
    denotes the name of the tab for the query under Edit Query)
    Here is some of the output from connection:
    4;ODBC18;MS SQL Server 2000166; VERSION=7; USER=xxxxx;
    PASSWORD=; DBTYPE=Relational; DATABASE=xxx_xxxx;
    ODBC_USER=xxxxxx; ODBC_PASSWORD=; BO_DSN=xxxx_xxxx;
    BO_DRV_CONNECT_MODE=0; 224; VERSION=6; Name=xxxxx; Shared=4;
    LoginTimeout=600; Timeout=600; Pool Time=60; Array Fetch Size=10;
    Array Bind Size=5; RecommendedLenTransfert=1000; Password_Encryption=x;
    AliasTable=; MeasureDimension=; Hint=; ConnectInit=; ArrayFetch=1;
    I'm not sure if this info helps out either, being that connection provides info on a post-processing basis and it sounds like you need to get out ahead of the SQL generation.  The @variable('bouser') would seem like the place to be, however, in allowing custom SQL to take place you loose the bouser due to an individual could customize the SQL to the point that it gets unwantingly yanked out.  The end_sql might be your answer...
    Thanks,
    John

  • How to get current logged-in user name in data access driver or in universe

    In universe, to get the current log in user is via @Variable('BOUSER').
    Right now, I need to be able to get the user name in the data access driver. I am writing a customized data access driver because we need to patch some where clause on the the query generated by the universe based on the logged-in user info. I only think of using end_sql parameter or adding an universe level filter to patch the @Variable('BOUSER') to the query, which would not work if user want to use customized query.
    Can anyone tell me how to get currentBO user name from connection server ? or how @Variable('BOUSER') is translated into the logged-in user name in the universe?

    I do not know your EJB Service. But you should pass the credentials of the current logged on portal user to your service. That's not by default I think.
    I had a similar problem with CAF developed webservices. I had to turn on permission checks in my web service and passed the credentials via logon ticket.
    Regards, Bernd

  • Migrating Users from Exchange 2007 to Exchange 2013 Without redirection through exchange 2013.

    We have all our users and mailboxes on Exchange 2007 and I have introduced two Exchange 2013 servers in my organization and both have mailbox and CAS server installed on them. 
    With Exchange 2007 server, I had not modified any of the internal and external url/uri and had stayed with the defaults.
    For migration most of the documents are suggesting of changing the default internal URL and Auto Discover Service internal URI values.
    In my case, I want to migrate all the users and mailbox (everything that is on Exchange 2007) form 2007 to 2013 and decommission exchange 2007 completely from our organization.
    I am in the phase of transferring users from Exchange 2007 to Exchange 2013 and do not want to change any settings on the existing 2007 servers.
    I have created new dns entry mailx.abc.com with two IPs of both exchange 2013 and changed the Outlook Anywhere internal URL on both Exchange 2013 server to mailx.abc.com.
    So by doing these, I think all existing clients will still connect to exchange 2007 and after moving their mailbox they will be connect to exchange 2013.
    In short I am not redirecting or using 2013 as proxy for 2007 clients and clients whose mailbox is on exchange 2013 will directly connect to 2013 server.
    Questions are, Is this the right way to migrate all the users to Exchange 2013?
    Will it affect the operation of existing Exchange 2007 server?

    Read the below blog on Client Connectivity in Exchange co-existence. There can't be better blog than this on this topic.
    http://blogs.technet.com/b/exchange/archive/2014/03/12/client-connectivity-in-an-exchange-2013-coexistence-environment.aspx
    Clients connect to Exchange from Internal-Outlook, External-Outlook, Web & Active Sync.
    For Internal the configuration that you have mentioned should work as clients would get Autodiscover information from Active Directory (SCP) and get connected to right server.
    However, for external connectivity it makes sense to use External URL on Exchange 2013 servers (keep the Exchange exposed to Internet), configure legacy URL for exchange 2007 and use Exchange 2013 external URL for mailboxes that are Exchange 2007 and Exchange
    2013 for standardization.
    Refer article for configuring URLs -
    http://silbers.net/blog/2014/01/22/exchange-20072013-coexistence-urls/
    - Sarvesh Goel - Enterprise Messaging Administrator

  • How to get Active users list in Essbase 6.5.6

    Hi Gurus,
    How to get Active users list in Essbase 6.5.6 version
    I dont find any Esscmd to find active users list....
    i used LISTLOGINS command in ESSCMD but its not helping me out....
    pls suggest me some approach to find active users list.
    Thanks in advance....

    Hi  ,
    Display sessions will give only active users details which are currently connected to the ESSBASE .
    if you need this list ? or  you need the  total list of   security  active users list ?
    if you need the currently connected to the ESSBASE
    if you check  one server  At a time  or you can check the application level also
    1)server level
    display  session all;
    2)application level
    display session on application  'application name ';
    go for the  run command ---> essmsh----->  login;----->enter user name ----> enter password----->enter host (like server name )  then you need to you   above  1 &2  commands
    Thanks,
    suresh

  • How to get current rowindex of clicked object in cr2008 preview control

    hi
    i want to get selected raw data when user click on crystal report 2008 preview control.
    i can achieve using following code for particular row no.
    Dim repReport as new ReportDocument
    repReport.Rows(RowIndex).Item(ColumnIndex)
    how to get current rowindex ? 
    Thanks
    Sanjiv Sharma

    Only way I can think of is to use the rowset controller from the InProc RAS SDK. Here is a snippet of a sample code on how to:
    //Load the report
    if (clientDoc != null) {
    //create metadata structure
    RowsetMetaData rowSetMetaData = new RowsetMetaData();  rowSetMetaData.setDataFields
    (clientDoc.getDataDefinition().getResultFields());
           Fields fields = rowSetMetaData.getDataFields();
           String colName,colTypeName;
           int colType, len;
           Field field;
           HashMap colNames = new HashMap();
           HashMap colTypes = new HashMap();
           for (int i = 0; i < fields.size(); i++) {
                   field = (Field) fields.get(i);
                   colName =field.getDisplayName(FieldDisplayNameType.description, Locale
    .ENGLISH);
                   colNames.put("COL"+i,colName);
           colType = getColTypeFromVariant(field.getType().toVariantTypeString());
           len=field.getLength();
                  //Placeholder
            //add column metadata to data structure or XML
            Object colValue;
            int rowCount=0;
            if (getMaxRows() != 0) {
                   RowsetCursor rowsetCursor = clientDoc.getRowsetController(). createCursor
    (null, rowSetMetaData);
                  //Setting the batch size to make sure that you get back all the
                  //rows by setting the batch size.
                        clientDoc.getRowsetController().setRowsetBatchSize (rowsetCursor
    .getRowset().getTotalRecordCount());
               //Getting the Results back starting from the first row
               RowsetCursor resultCursor = clientDoc.getRowsetController(). createCursor(null,
    rowSetMetaData);
               resultCursor.moveTo(0);
                  while (!resultCursor.isEOF()) {
                      for (int i = 0; i < fields.size(); i++) {
                               colName=(String)colNames.get("COL"+i);
                               colTypeName=(String)colTypes.get("COL"+i);
    colValue=record.getValue(i);
                                //Placeholder
    //add row data to data structure or XML
    resultCursor.moveNext();
    For more details, consult the Report Application Server .NET SDK Developer Guide
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to get Current row of ViewObject in the DoDML methode

    Hi all
    I have two ViewObject EmplyesView and DeptView
    How to get Current row of ViewObject DeptView in the DoDML methode of EmplyesView

    OK, we can play this game on and on...
    I'll ask for a use case (http://en.wikipedia.org/wiki/Use_case) and you don't give any info we don't already know. After an other 10 posts we probably know what you real problem is and can give you the advice which you could have gotten in the fist place.
    So please take some time and describe the problem as if you would ask your mother for help. Tell us how the data model is build and how the VO are related. Is there any input from an user involved? Which information from the other view do you need? How do you get to the doDML method? Is there a button in the ui involved?
    Timo

  • How to get current IUser (com.sapportals.portal.security.usermanagement)

    Hi,
    does anybody know how to get IUser for the current user?
    I know how to get current IUser from com.sap.security.api package:
    IWDClientUser wdcu = WDClientUser.getCurrentUser();
    IUser sapUser = wdcu.getSAPUser();
    but I need to have IUser from com.sapportals.portal.security.usermanagement package.
    Regards,
    Ladislav

    Ladislav,
    Try this:
    Get the IUser uisng the API com.sap.security.api.IUser and store it in a variable, say <i>sapUser</i>.
    Then,
    // Convert the logged in user to old EP5 usermanagement API
    com.sapportals.portal.security.usermanagement.IUser user = null;
    try
         com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
    catch (UserManagementException e)
         e.printStackTrace();
    Bala

  • How to get current assigned participant id?

    Hi mates,
    This might be a basic questions, but useful for me :)
    How to get current assigned participant id from screenflow? Or How to pass it as an argument from interactive activity?
    Below is what I tried.
    Participant.id or Instance.participant.id - returns login user id
    Thanks

    Hi,
    Please correct me if I understood wrong.
    You want to know whether an instance is assigned or not and if assigned then you want to fetch the assigned participant id.
    If this is your requirement then please find the code below and make the necessary changes into it.
    Write the following code in screen flow automatic activity but before that you need to pass the instanceid as argument to the screen flow.
    In the process as well as screen flow layer make an instance variable instanceid as Int.
    Then make an argument variable instanceidArg as Int in both the screenflow and process layer and map accordingly so that it will take the instanceid from process layer to the screen flow layer.
    Assign instanceid = id.number; in process layer automatic activity but before the global interactive activity where you have maped the screen flow.
    Write the following code in screen flow automatic activity.
    logMessage("============= instanceid ==============" + instanceid); //instanceid is the id of the instance that you have passed from process layer.
    ProcessService ps;
    InstanceFilter instF = InstanceFilter();
    ps.connectTo(url : Fuego.Server.directoryURL, user : "<userid>", password : "<password>"); //In studio the userid and password will be same
    logMessage("Connected");
    instF.create(processService : ps);
    instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS);
    //<ProessId Name> is the id of the process where you want to know the assighed participant id
    instF.addAttributeTo(variable : VarDefinition.processid, comparator : Comparison.CONTAINS, value : "/" + "<ProessId>");
    instF.addAttributeTo(variable : VarDefinition.INSTANCE_NUMBER, comparator : Comparison.IS, value : Int(instanceid));
    Fuego.Papi.Instance[] instances = getInstancesByFilter(ps, filter : instF);
    foreach (instance in instances) {
    logMessage("Assigned ?: " + instance.participantId.empty);
    logMessage("instance.participantId: " + instance.participantId);
    ps.disconnectFrom();
    Bibhu

Maybe you are looking for

  • I can no longer print from Firefox

    I was in Yahoo mail. I was getting ready to print. The print dialog was open already. Then I got some kind of notice from Firefox that it needed to restart to install an update. No problem I thought, the updates have always had no problem. Since I al

  • BPM with multiple Receives

    I have an input from a File1 and this will be received in the BPM and then the input will be sent Synchronously to get a Response Back. Only after I receive the First HTTP response, I need to Receive another File say File2 in BPM. How to achieve the

  • Increment a number column when a specific field is update

    Hi, I'm working on SharePoint and i'm looking for a solution to have a field which is incremented when a specific field is edited. Example : i have a date field, with 16/07/2014 when i create an element. I edit this element and change this date field

  • IBook puts itself to sleep and/or shuts down

    My gf's iBook G4 (14-inch Early 2004) puts itself to sleep at random. No amount of pressing keys will wake it up, only pressing and holding the power button to shut it off completely, then rebooting, will get it back. Sometimes it shuts itself off co

  • About SAP BW 3.5 and SAP Enterprise Portal Integrating

    I feature in the preview through BW webtemplate to preserve the iview feature, the system shows errors: Portal Runtime Error An exception occurred while processing a request for : iView : N/A Component Name : N/A Cannot retrieve system 'BWDCLNT100' f