Add Page n of nn, date, current user name to aReport Footer on PDF Report

Hello,
I am very new to using Apex.
I have a SQL Report which I can output to a PDF and works.
I have a header and the contents of the report all appearing in the PDF OK.
I would like to have a footer for each page which has the date & timestamp, current users full name and page n of nn.
Any help would be much appreciated, thanks.

Hello Luis
Thanks for your help.
I have the first part of the current user and the date and time displayed on the bottom of the report.
The complicated bit for me it the page n of n.
I have created the report layout and copied in your code but I get an error that tells me that
the PDF cannot be opened because it is either not supported or damaged .....
Here is the contents of the Page Template:
<?xml version = '1.0' encoding = 'utf-8'?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:variable name="_XDOFOPOS" select="''"/>
<xsl:variable name="_XDOFOPOS2" select="number(1)"/>
<xsl:variable name="_XDOFOTOTAL" select="number(1)"/>
<xsl:variable name="_XDOFOOSTOTAL" select="number(0)"/>
<xsl:attribute-set name="padding">
<xsl:attribute name="padding-bottom">0.25pt</xsl:attribute>
<xsl:attribute name="padding-top">0.25pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text">
<xsl:attribute name="text-align">start</xsl:attribute>
<xsl:attribute name="orphans">2</xsl:attribute>
<xsl:attribute name="start-indent">0.0pt</xsl:attribute>
<xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>
<xsl:attribute name="padding-top">0.0pt</xsl:attribute>
<xsl:attribute name="end-indent">0.0pt</xsl:attribute>
<xsl:attribute name="padding-bottom">0.0pt</xsl:attribute>
<xsl:attribute name="height">0.0pt</xsl:attribute>
<xsl:attribute name="widows">2</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="align-left">
<xsl:attribute name="text-align">left</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="align-center">
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="align-right">
<xsl:attribute name="text-align">right</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="footer">
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:attribute name="start-indent">5.4pt</xsl:attribute>
<xsl:attribute name="end-indent">5.4pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text_2">
<xsl:attribute name="start-indent">5.4pt</xsl:attribute>
<xsl:attribute name="end-indent">23.4pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text_20">
<xsl:attribute name="height">13.872pt</xsl:attribute>
<xsl:attribute name="end-indent">5.4pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text_0">
<xsl:attribute name="end-indent">5.4pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="page-header">
<xsl:attribute name="color">#PAGE_HEADER_FONT_COLOR#</xsl:attribute>
<xsl:attribute name="font-family">#PAGE_HEADER_FONT_FAMILY#</xsl:attribute>
<xsl:attribute name="white-space-collapse">false</xsl:attribute>
<xsl:attribute name="font-size">#PAGE_HEADER_FONT_SIZE#pt</xsl:attribute>
<xsl:attribute name="font-weight">#PAGE_HEADER_FONT_WEIGHT#</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="page-footer">
<xsl:attribute name="color">#PAGE_FOOTER_FONT_COLOR#</xsl:attribute>
<xsl:attribute name="font-family">#PAGE_FOOTER_FONT_FAMILY#</xsl:attribute>
<xsl:attribute name="white-space-collapse">false</xsl:attribute>
<xsl:attribute name="font-size">#PAGE_FOOTER_FONT_SIZE#pt</xsl:attribute>
<xsl:attribute name="font-weight">#PAGE_FOOTER_FONT_WEIGHT#</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body-font">
<xsl:attribute name="height">12.0pt</xsl:attribute>
<xsl:attribute name="font-family">#BODY_FONT_FAMILY#</xsl:attribute>
<xsl:attribute name="white-space-collapse">false</xsl:attribute>
<xsl:attribute name="font-size">#BODY_FONT_SIZE#pt</xsl:attribute>
<xsl:attribute name="font-weight">#BODY_FONT_WEIGHT#</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="page-number">
<xsl:attribute name="height">13.872pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="header-font">
<xsl:attribute name="height">#HEADER_FONT_SIZE#pt</xsl:attribute>
<xsl:attribute name="font-family">#HEADER_FONT_FAMILY#</xsl:attribute>
<xsl:attribute name="white-space-collapse">false</xsl:attribute>
<xsl:attribute name="font-size">#HEADER_FONT_SIZE#pt</xsl:attribute>
<xsl:attribute name="font-weight">#HEADER_FONT_WEIGHT#</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="border">
<xsl:attribute name="border-top">#BORDER_WIDTH#pt solid #BORDER_COLOR#</xsl:attribute>
<xsl:attribute name="border-bottom">#BORDER_WIDTH#pt solid #BORDER_COLOR#</xsl:attribute>
<xsl:attribute name="border-start-width">#BORDER_WIDTH#pt</xsl:attribute>
<xsl:attribute name="border-start-color">#BORDER_COLOR#</xsl:attribute>
<xsl:attribute name="border-start-style">solid</xsl:attribute>
<xsl:attribute name="border-end-width">#BORDER_WIDTH#pt</xsl:attribute>
<xsl:attribute name="border-end-color">#BORDER_COLOR#</xsl:attribute>
<xsl:attribute name="border-end-style">solid</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="cell">
<xsl:attribute name="background-color">#BODY_BG_COLOR#</xsl:attribute>
<xsl:attribute name="color">#BODY_FONT_COLOR#</xsl:attribute>
<xsl:attribute name="padding-start">5.15pt</xsl:attribute>
<xsl:attribute name="vertical-align">top</xsl:attribute>
<xsl:attribute name="padding-top">0.0pt</xsl:attribute>
<xsl:attribute name="padding-end">5.15pt</xsl:attribute>
<xsl:attribute name="number-columns-spanned">1</xsl:attribute>
<xsl:attribute name="height">0.0pt</xsl:attribute>
<xsl:attribute name="padding-bottom">0.0pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="header-color">
<xsl:attribute name="background-color">#HEADER_BG_COLOR#</xsl:attribute>
<xsl:attribute name="color">#HEADER_FONT_COLOR#</xsl:attribute>
</xsl:attribute-set>
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="master0" margin-left="66.6pt" margin-right="66.6pt" page-height="#PAGE_HEIGHT#pt" page-width="#PAGE_WIDTH#pt" margin-top="36.0pt" margin-bottom="36.0pt">
<fo:region-before region-name="region-header" extent="54.0pt"/>
<fo:region-body region-name="region-body" margin-top="54.0pt" margin-bottom="54.0pt"/>
<fo:region-after region-name="region-footer" extent="54.0pt" display-align="after"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="master0">
<xsl:variable name="_PW" select="number(#PAGE_HEIGHT#)"/>
<xsl:variable name="_PH" select="number(#PAGE_WIDTH#)"/>
<xsl:variable name="_ML" select="number(72.0)"/>
<xsl:variable name="_MR" select="number(72.0)"/>
<xsl:variable name="_MT" select="number(90.0)"/>
<xsl:variable name="_MB" select="number(90.0)"/>
<xsl:variable name="_HY" select="number(36.0)"/>
<xsl:variable name="_FY" select="number(36.0)"/>
<xsl:variable name="_SECTION_NAME" select="string('master0')"/>
<fo:static-content flow-name="region-header">
<fo:block xsl:use-attribute-sets="text text_2 text_0 #PAGE_HEADER_ALIGNMENT#">
<fo:inline xsl:use-attribute-sets="page-header">#PAGE_HEADER#</fo:inline>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="region-footer">
<fo:block xsl:use-attribute-sets="text footer">
<fo:inline xsl:use-attribute-sets="body-font page-number">
<fo:page-number/> of <fo:page-number-citation ref-id="last-page"/>
</fo:inline>
<fo:block id="last-page"/>
</fo:flow>
<fo:block xsl:use-attribute-sets="text text_2 #PAGE_FOOTER_ALIGNMENT#">
<fo:inline xsl:use-attribute-sets="page-footer">#PAGE_FOOTER#</fo:inline>
</fo:block>
</fo:static-content>
<fo:flow flow-name="region-body">
<fo:block xsl:use-attribute-sets="padding">
<fo:table start-indent="0.0pt">
<xsl:variable name="_XDOFOPOS2" select="number(1)"/>
<xsl:variable name="_XDOFOTOTAL" select="number(1)"/>
#PRN_TABLE_CELLS#
<fo:table-header>
<fo:table-row>
#PRN_TEMPLATE_HEADER_ROW#
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:for-each select=".//ROW">
<fo:table-row>
#PRN_TEMPLATE_BODY_ROW#
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
<fo:block xsl:use-attribute-sets="text text_2 text_20">
<fo:inline id="{concat('page-total-', $_SECTION_NAME, $_XDOFOPOS)}"/>
<fo:inline id="{concat('page-total', $_XDOFOPOS)}"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>

Similar Messages

  • HT4796 How can I take the files that were migrated from my PC to my Mac and add all those files to my current user instead of having 2 users?

    How can I take the files that were migrated from my PC to my Mac and add all those files to my current user instead of having 2 users? Having to log out just to sign in on a different user to access the files is absurd.
    Do I make all the files sharable to all the NOW users on the mac then just delete the files? Or can i erase my account that I made when starting up my new mac and then just use the one with the transferred files?
    I just dont want to have to og in and out of 2 different accounts .. Help please.         
    -Nina

    Sorry. /Users is a folder path. It would be similar to C:\Users (if that exists on Windows).
    So, in the Finder, select Computer from the Go menu.
    You'll see Macintosh HD, double-click that to open it.
    In there you'll see several folders. One is Users. That is where all the user Home folders exist. Select the other account's home folder and go to step 3.
    If you have any more confusion, please stop and ask. We'll get there.
    If you feel more comfortable, you can just log into that other account and move the files into /Users/Shared.
    Then, log into the account you wish to use and copy the files from the Shared folder and paste them into your Home folder, wherever they belong, Documents, Music, Pictures, etc.  That just takes a little more work. Transferring them into Shared, and then copying into your home sets the permissions on the files so that you won't have a problem accessing them later. The steps I provided just prevent you from having to do the double move, since you are not going to use the old account once you are done.
    Quick unix shorthand. If someone gives you a file path that begins with a /, that means the root of the hard drive, ie Macintosh HD (if you haven't renamed it). The path separator in unix is /, not \.
    A path that starts with ~/ means your Home folder, the one inside /Users named with your account name.

  • Filter output data according to portal current user name in omni portlet

    We have created an omniportlet that connects to a database, and retrives some values into a defined HTML layout.
    We want to filter output data according to our portal current user name
    When we try to use portal.wwctx_api.get_user inside of omni portlet select statement fallowing error occurs.
    Error in executing Query : [ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at "PORTAL.WWCTX_SSO", line 1803 ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at "PORTAL.WWCTX_SSO", line 1637 ORA-06502: PL/SQL: numeric or value error ORA-06512: at "PORTAL.WWCTX_SSO", line 1865 ORA-06512: at "PORTAL.WWCTX_API", line 183 ]
    Thanks a lot

    hello
    i think you cannot use the portal built-in packages inside omni portlets. Omni portlets is designed to connect to other data source (not only oracle) and Portal API might not be available at these data sources. Therefore, you should not be using these Packages at all!. i tried very hard, but to no avail.. Omni portlet has its own repository!! if you cannot pass the infomration as a parameter, then find a different approach
    Ammar Sajdi
    Amman - Jordan
    oracle consultant

  • Work Folders Stopped Working - The sync server needs the user's current user name and password

    Our Work Folders deployment has just stopped working.
    Once the user has logged in to ADFS they get the following error message "The sync server needs the user's current user name and password (0x80c80300)"
    At the same time we see the following error in the file servers SyncShare event log:
    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    - <System>
    <Provider Name="Microsoft-Windows-SyncShare" Guid="{9E6153AD-A829-4B70-B997-8E463A7A111C}" />
    <EventID>1013</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2014-12-03T14:48:32.922225100Z" />
    <EventRecordID>1178</EventRecordID>
    <Correlation />
    <Execution ProcessID="1988" ThreadID="2800" />
    <Channel>Microsoft-Windows-SyncShare/Operational</Channel>
    <Computer>fileserver.domain.com</Computer>
    <Security UserID="S-1-5-18" />
    </System>
    - <EventData>
    <Data Name="User">eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6ImVoZWxJMUFwWm9HT2VZdXU5NGZZb21tamUzayJ9.eyJhdWQiOiJodHRwczovL1dpbmRvd3MtU2VydmVyLVdvcmstRm9sZGVycy9WMSIsImlzcyI6Imh0dHA6Ly9hZGZzLmVzaGVyLmFjLnVrL2FkZnMvc2VydmljZXMvdHJ1c3QiLCJpYXQiOjE0MTc2MTgxMTIsImV4cCI6MTQxNzYyMTcxMiwidXBuIjoiRExvdWdobGluQGVzaGVyLmFjLnVrIiwidW5pcXVlX25hbWUiOiJEYW5pZWwgTG91Z2hsaW4iLCJmYW1pbHlfbmFtZSI6IkxvdWdobGluIiwiZ2l2ZW5fbmFtZSI6IkRhbmllbCIsImF1dGhfdGltZSI6IjIwMTQtMTItMDNUMTQ6NDg6MjYuNzU1WiIsImF1dGhtZXRob2QiOiJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YWM6Y2xhc3NlczpQYXNzd29yZFByb3RlY3RlZFRyYW5zcG9ydCIsInZlciI6IjEuMCIsImFwcGlkIjoiMTY4RjNFRTQtNjNGQy00NzIzLUE2MUEtNjQ3M0Y2Q0I1MTVDIn0.eCefzniju5qjqxIDdC2KCefkiNBNoGV-B1zg8EsnygUyV0LilPpANpv5uH75JJ9ekv9BN0vz7m6QezHEN4dYc5Z-6UJCzm7Wz6s1yNqVz-Sq5_wf_RrrHkxntcLXT2LHyyLN6ZxJy8uOF4vLw_fLsDzrNHkpaKUoevLAvNLI503IAiKDijKmQ0Qa2hZGsDT57yhKLGtjMXdqwx6FpFpP6vxA9qoUlR1E-tlt0ezTSD8j36djV9VbFpTlfeiH26D0n92T4exQCJkPdVzR42G7KbYyo9Acu0GGf7dnameWMQV9lT-Jtb7hH9xNReuVSVzqgtstsSDJR0mCsKJfLrdKVw</Data>
    <Data Name="Error">0X80C80021 - ECS_E_SYNC_ADFS_UNAUTHORIZED</Data>
    </EventData>
    </Event>
    I have attempted re creating the setup using several blog posts including:
    http://blogs.technet.com/b/filecab/archive/2014/03/03/deploying-work-folders-with-ad-fs-and-web-application-proxy-wap.aspx.  Including deleting all WAP rules, deleting and recreating the Relaying Party Trust and obtaining new certificates for the file
    server.
    ADFS and WAP are working correctly for our Office 365 federations and on-premise SharePoint, Exchange and other web applications
    If I turn ADFS authentication off on the Work Folders server I can successfully connect and setup work folders on a domain joined computer, however as soon as ADFS authentication is enabled I get the above error. 

    Hi,
    As you expressed, it should be an authentication issue. 
    I assume it will work by selecting Windows Authentication instead of ADFS in step shows in following picture. 
    The article also mentioned that the certificate is needed in following computers.
    The self-signed AD FS certificate will need to be exported and installed on the following machines in the test environment:
    Work Folders
    Web Application Proxy
    Domain joined Windows 8.1 client
    Non-domain joined Windows 8.1 client
    Thus I would like to confirm if certificate is also imported. 
    If you have any feedback on our support, please send to [email protected]

  • How to find current user name on a LAN machine....

    how to find current user name in a remote machine in LAN .
    how to find current user name on a local machine in LAN .

    how to find current user name in a remote machine in
    LAN .Many users may be logged on concurrently on the remote machine.
    how to find current user name on a local machine in
    LAN .The user who is running the code in the process would be obtainable via:
    System.getProperty("some property goes here");
    I leave it to you to look at the API documentation for System.getProperties() to see what property name you would retrieve.

  • When I try to log into the app store to update apps or buy apps the user name that appears is an old one and it will not bring up the current user name/ email how do I stop that so that my current email show up ??

    When I try to log into the app store to update apps or buy apps the user name that appears is an old one and it will not bring up the current user name/ email how do I stop that so that my current email show up ??

    Settings>Store: Tap the AppleID and choose "Sign Out", it will then prompt you to sign in and you can use the new AppleID.
    NOTE: Apps must be updated with the AppleID they were purchased under.
    EE

  • How to find the current User Name and stored in which table

    In which table the current user name (Login) is stored?

    Hi Mohanapriya
    The query provided by Gordon can not run on query generator as the $USER is a runtime variable.
    You need to save it to a query then use it in a FMS(Formatted Search.)
    Just open a form(ex:sales order ), click the field in which you want to show the user name,
    then press ****+F2 or Tools->Search Function->Define,
    Search by Saved query,then assign the save query to the field.
    After that ,you can run the FMS(shift+F2) to get the current user info.
    Regards,
    Syn Qin
    SAP Business One Forums Team

  • Need to print Current user Name in crystal report in B1

    Hi all,
    In Crystal reports there are 2 current user fields
             CurrentCEUserName
    and   CurrentCEUserID
    I have tried to add these fields to the footer of my reports, but no information comes out.
    Is there any way to find out the current user and print their user name on the report?
    Users have 2 id's.  Where can I find this info and add it to the report.
    A) the windows user id if possible
    B) the SAP user id
    Thanks
    Chris

    HI,
    If you want SAP user id ,add OUSR table and pick user id from that table.
    or check http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14295
    Thanks,
    Neetu

  • Caml query - get current user name

    I have an external list via BDC (so cannot change column type, create calculated column or workflow
    ). There is a text column “Supervisor”. I need to create a view that display all items which the value of “Supervisor” = current login user’s display name or login name (windows user name). 
    I tried set up the field on the UI with [Me] function which does not work because “Supervisor” is not an user/group type column. Now I am working on the code. I found the follow caml query on the web that is close to what I need:
    <Eq>
    <FieldRef Name='Supervisor' LookupId='TRUE'/>
    <Value Type='Integer'><UserID/></Value>
    </Eq>
    I know this only work if the ‘Supervisor’ type is “User”. I just wonder if someone know how to replace the <Value> with a text string
    of the current user’s display name or window name? I really appreciate for any help (I have struggled with this issue for a week).
    Forget to mention that I am working on a web part page in SharePoint designer, not in Visual Studio. So I cannot not using spcontext class.

    Thank you again for your response.  For this method, I need need to find a way to get the current user to a variable, the use the varrible in the query. This works for me:
    <ParameterBinding Name="UserID" Location="CAMLVariable;ServerVariable(LOGON_USER)" DefaultValue="CurrentUserName"/>
    <Eq>
    <FieldRef Name="Supervisor"/>
    <Value Type="Text">{UserID}</Value>
                    </Eq>
                    <Eq>
    <FieldRef Name="AttnMonitor"/>
    <Value Type="Text">{UserID}</Value>
                   </Eq>

  • How to get the current user name of the host who is occupying a specific VM?

    I'm developing a winform app with c# code to manage Hyper-V. I need to remind someone if he/she would take a VM which has already been occupied by others.
    Is there any powershell cmd or WMI interface to get the current user of a specific VM?
    Thanks!

    Hiya,
    from cmd there are quser(Query user) and qwinsta(Query Session)
    which should give you that. Don't know how you can incoorperate that in C#, but that should give you something to work with :)
    https://technet.microsoft.com/en-us/library/cc785434.aspx
    https://technet.microsoft.com/en-us/library/cc788125.aspx

  • Using odiRef in ODI package to get current user name for Subject in OdiSendmail Step

    Hi,
    I am trying to do something simple and include the user name in a subject line of an OdiSendMail Step.  In the Expression editor for the Subject I use the following but to no avail.
    Push Data to HFM Started by <%=odiRef.getUser( String )%>
    What amI missing here?  Do I need to replace String with something like "UserName" or is there a different parameter to pass?  I tried Username but it didn't work.  Is this syntax correct or do I have to code it a different way?
    Thanks,
    T.

    Hi
    getUser has a parameter which is the property name to retrieve, you probably want the user name;
    http://docs.oracle.com/cd/E14571_01/integrate.1111/e12645/odiref_reference.htm#autoId70
    Something like....
    <%=odiRef.getUser( "USER_NAME" )%>
    Cheers
    David

  • How to find the Data Entered Date and User Name?

    Dear Team,
    An End User feeds a data wrongly in KP26. I would like to find by whom it was entered and when? i.e, user name and Date of particular entry.
    Regards
    R.Thillai govindrajan

    Hi Thillai,
    I don't think you can find that information now. If you have switched on trace on that user before he changes, you would have got those details in trace file.
    Thanks,
    Siva Kumar

  • How to read a databae table and current user name?

    Hi All,
    We need to add two radio buttons in a standard template.The RBs should be visible to some users and should not be visible to others.For this we need to read a database table in the template , compare the logged in user name with a field of the databse table.
    Something like...
    select single * from ZDBTAB into WA WHERE username = sy-uname.
    IF SY-SUBRC = 0 .
    Radio Button1
    Radio Button2
    ENDIF.
    Please provide the exact ITS code for the same.
    Regards,
    Anubhav

    Hi All,
    We need to add two radio buttons in a standard template.The RBs should be visible to some users and should not be visible to others.For this we need to read a database table in the template , compare the logged in user name with a field of the databse table.
    Something like...
    select single * from ZDBTAB into WA WHERE username = sy-uname.
    IF SY-SUBRC = 0 .
    Radio Button1
    Radio Button2
    ENDIF.
    Please provide the exact ITS code for the same.
    Regards,
    Anubhav

  • How to get the current user name in Provider hosted app using appOnlyAccessToken

    Hi, 
    Please help me, how to get the HostWeb UserName in Provider Hosted App
    i have Provider hosted App, and Anonymous Authentication is enabled on AppWeb, using appOnlyAccessToken
    Below code does not return current user who Log in in hostweb, it is returning
    SharePoint App (app@sharepoint)
    Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
    clientContext.Load(web.CurrentUser);
    clientContext.ExecuteQuery();
    clientContext.Web.CurrentUser.LoginName;
    Below code gives a blank name when Anonymous Authentication is enabled, if Anonymous Authentication is disabled
    app prompts for credentials 
    HttpContext.Current.User.Identity.Name
    Thanks
    Ram

    Hi,
    Since you are using a provider Hosted app if you want to get the current logged in name than do not use AppOnlyAccessToken else use AccessToken which is App + user Context AccessToken.
    then 
    Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
    clientContext.Load(web.CurrentUser);
    clientContext.ExecuteQuery();
    clientContext.Web.CurrentUser.LoginName;will return proper user Name.
    HttpContext.Current.User.Identity.Name will never return the user as this object is related to IIS server of your App Server not sharepoint.you should set this as Anonymous in case of provider hosted app.you can download the below sample which uses the AccessToken which has user name in it.https://code.msdn.microsoft.com/Working-provider-hosted-8fdf2d95
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Agentry - Filter by Current User Name in SQL Step

    I'm currently developing an Agentry application that connects to an Oracle back end.  I would like to filter by the current user's name in a SQL step that connects to the Oracle database.  What's the best way to do this?
    Tags edited by: Michael Appleby

    See:
    http://infocenter.sybase.com/help/index.jsp?docset=/com.sybase.infocenter.pubs.docset-SMP-SDK-3.0.2/doc/html/title.html&docSetID=2021
    <<user.name>>
    Returns the name of the client user. By default this will be the ID entered by the user to log into the client. This value may be overridden.
    <<user.agentryID>>
    Returns the user ID entered to log into the Agentry Client. This value cannot be overriden during synchronization.

Maybe you are looking for

  • Lightroom watermarks not showing up in Windows explorer.

    Quick question for everybody. I imagine there's an easy solution for it, I just haven't been able to figure it out. The company I work for needs to manage and watermark many different types of photos (perfect for Lightroom.)  The only problem is, whe

  • I am connected to my iMac to recharge iPad but it is saying "Not charging" ! Why and what have I done wrong?

    I am connected to my iMac to recharge iPad but it is saying "Not charging" ! Why and what have I done wrong?

  • What happened to my scanner after CS5 installation

    I can no longer scan into Photoshop since installing CS5. I tried to resolve the problem by I downloading the Photoshop CS5 12.0.2 plug-in and followed the installation instructions on the Adobe website. Drag and drop TWAIN. plugin to Applications\Ad

  • Lightroom and deletions

    I am running Lightroom 4 with Windows 7. My lightroom has been upgraded with each new edition. I have found that I am unable to delete any photos from my hard drive disc for the years (in my case) 2005 to 2010. This is roughly 18,000 photos and I sti

  • What color correction setting is best

    I just bought the Canon Pixma IP4300. I'm using a lot of ink trying to figure this out, so I thought I'd ask in case there was a default. In Advanced>Color Options>Color Correction, the choices are; 1) Driver matching 2) ColorSync 3) None Is one of t