How to get current user’s full name on Dynamics 365 SSRS report using Fetch XML

I wanted to get the current user’s name on the SSRS report.

Pre-requisites:

  • Setting up environment
    • Visual Studio 2015 with Update 3
    • SQL Server Data Tools
    • Dynamics 365 Report Authoring Extension (latest version)
  • Report Configuration
    • Defining Dynamics 365 data source
    • Setting up Data Sets for the report
      • Configuring Fetch XML Query for the report

I followed below steps, to get the current user’s name on the report – once above was done:

  1. Created a new Data Set “NewDataSet”  for the Dynamics 365 data source “DataSourceABC”
  2. Created a fresh query to get the full name of the user (below query)
  3. Then you can print user’s name by using a text box and a place holder expression

User is the current user, running the report.

Fetch XML Query to get current user full name:

<fetch version=”1.0″ output-format=”xml-platform”
mapping=”logical” distinct=”false”>
<entity name=”systemuser”>
<attribute name=”fullname” />
<attribute name=”systemuserid” />
<order attribute=”fullname” descending=”false” />
<filter type=”and”>
<condition attribute=”systemuserid”
operator=”eq-userid” />
</filter>
</entity>
</fetch>

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.