Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Fetching xml for ssrs report ms crm

(0) ShareShare
ReportReport
Posted on by 95

Hi guys,

I have an issue while doing ssrs report. my scenario is i need to create a ssrs report based on the hierarchy of users in ms crm

Example: if a user is created an account he will become owner for the account, for that owner there will be one manager and for that manager there will be another manager like that i need to fetch xml by matching the related levels. please help he out.

I am using below fetch xml but i am able to retreive the data upto one manager level

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="account" enableprefiltering="1">
<attribute name="name" />
<attribute name="telephone1" />
<attribute name="primarycontactid" />
<attribute name="parentaccountid" />
<attribute name="new_mainbusiness" />
<attribute name="new_customercode" />
<attribute name="new_city" />
<attribute name="ownerid" />
<attribute name="accountid" />
<attribute name="new_country" />
<attribute name="new_state" />
<attribute name="address1_postalcode" />
<attribute name="address1_line3" />
<attribute name="address1_line2" />
<attribute name="address1_line1" />
<link-entity name="systemuser" from="systemuserid" to="owninguser" visible="false" link-type="outer" alias="systemuser">
<attribute name="parentsystemuserid" />
<attribute name="createdby" />
</link-entity>
</entity>
</fetch>

  

*This post is locked for comments

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: Fetching xml for ssrs report ms crm

    Hi,

    Have you experienced to use subreport? The concept would be like below. but you have to use matrix in order to show in horizontal line.

    Demo

    below is the hierarchical structure i configured.

    36755.14.PNG

    below is the fetchxml, i am using ken chang as filter, and result it show me diana chang and xxx Asia. Which is correct.

    36755.14.PNG

    So, by using the above video technique, show sub report in main report. You are able to complete your report. Remember you have to use matrix in order to show in horizontal line in subreport.

    Good luck and have fun.

  • Mahesh1431 Profile Picture
    95 on at
    RE: Fetching xml for ssrs report ms crm

    88253.Screenshot_5F00_1.png

    Please see the above image(ssrs report) in that in first column i am storing the value of the user who created an account in ms crm.

    >In the second column i am storing the value of the manager who is manager for the first column person in above table .(Hierarchy)

    > In the third column i am storing the value of another manager who is manager for the second column person in above table.(Hierarchy) 

    Hope you understood my scenario. now my problem is i am able to store the values of users(managers) upto second column. but i am unable to fetch data for third column. third column manager should come automatically popup based on the second column user

    please help me out from this

    Thanks 

  • Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: Fetching xml for ssrs report ms crm

    Hi,

    can you show us how you want the data to be displayed?

  • Mahesh1431 Profile Picture
    95 on at
    RE: Fetching xml for ssrs report ms crm

    Thanks wei.. but in my scenerio in my ssrs report i have 3 rows in that each row will holds the data in hierarchy.

    for example if user creates an account he will become the owner of the account, that user will have another manager , that manager will have another manager like this i would like to get fetch xml is it possible?

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: Fetching xml for ssrs report ms crm

    Hi,

    did you enable the hierachy setting in CRM?  if yes, you can easily achieve that using below operator.

    [View:https://nishantrana.me/2018/11/22/above-and-under-operator-to-query-hierarchical-data-in-dynamics-365/]

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans