CRM Online Reporting with FetchXML (How to Use FetchXML Data in the Report)

By Eric Newell | December 10, 2012

Crm online reporting with fetchxml (how to use fetchxml data in the report)

CRM Online Reporting with FetchXML Series
Intro: Intro to Series
Part I: How to Set up a Data Source to Access CRM Data in SQL Reporting Services
Part II: How to Use FetchXML Data in the Report
Part IIa: CRM FetchXML Operators
Part III: Handy SQL Reporting Services Functions for CRM Online Reports

Getting FetchXML out of CRM may seem like a daunting task at first, but it’s actually pretty easy if you take advantage of the Download Fetch XML command in the Advanced Find window.  In this example, I used the out-of-the-box Accounts view for No Campaign Activities in the Last 3 Months:

CRM Online Reporting with FetchXML (How to Use FetchXML Data in the Report)

This will actually show you the xml that you can use in your report and modify as necessary.

Fetch XML Results

So the first thing to do is to create an Advanced Find query as close as possible to the report you want to run.  Then it makes it easy to modify the filter and add parameters to the conditions.  You can always add attributes in FetchXML, but it’s easier to just add that column in the Advanced Find window.

Adding Parameters to a Fetch Based Report

Part of the big benefit of using SQL Reporting Services to create reports is the ability to combine datasets in these reports.  In my report example, I am primarily reporting on appointment data, but I want to select one or more project tasks to the report.  The project task list becomes a parameter selection for the main appointment report, so I need the value field from the project task selection to put into the FetchXML query for appointments.

The following FetchXML shows how to insert the parameter “ProjectTask” to the value attribute of the condition element:

<condition attribute=”regardingobjectid” value=”@ProjectTask” uitype=”new_projecttask” operator=”in”/>

The default FetchXML in this case included an attribute called uiname, but I removed that because it’s not necessary to make the connection between the two entities.  It also had an operator of “eq” but I changed it to “in”.  This allows me to multi-select parameter values when running the query.  With “eq”, I’d only be able to choose one selection from the drop-down list generated by my other dataset.

There is much more that could be explored here, but these were my two big discoveries that made the process easier, so I hope they are helpful to you in your creation of CRM Online reports.

Help with CRM 2

Related Posts

Recommended Reading:

Managing Your Business Through Uncertain Times Using Dynamics 365 Finance and Operations

  Dynamics 365 Finance and Operations (F&O) can help you make informed decisions on how to move your business forward. […]

Read the Article
5.13.22 Power Platform

Using Power BI Object Level Security

  The following article will demonstrate how to use Power BI Object Level Security to disable column data based on […]

Read the Article
5.12.22 Dynamics CRM

How to Use the Stoneridge Support Portal

Stoneridge Software’s support portal is an intuitive and useful function that makes it easy for you to access resources to […]

Read the Article
5.6.22 Dynamics GP

Dynamics GP Transaction Removal: Purchase Orders

  Are you having performance issues with Purchase Orders?  Do you find that there are old Purchase Orders on your […]

Read the Article
5.5.22 Dynamics GP

The Real Story about the Long-Term Future of Dynamics GP Support

I’ve seen a number of people put forward comment that Dynamics GP is going away and you have to get […]

Read the Article

New Features in Dynamics 365 Business Central 2022 Wave 1 Release – Financial Enhancements

The Dynamics 365 Businses Central 2022 Wave 1 Release has a lot of new and exciting features to help your […]

Read the Article
4.29.22 Dynamics GP

Dynamics GP Transaction Removals: Bank Reconciliation

  This is part 2 of a 3 part series on Dynamics GP Transaction Removals. These quick tips will hopefully […]

Read the Article
4.28.22 Dynamics GP

Uncommonly Used Features – Integrate Purchasing and Payables to Fixed Assets in Dynamics GP

Being able to integrate Purchasing and Payables to Fixed Assets in Dynamics GP will help you create visibility for your […]

Read the Article

New Features in the Dynamics 365 Business Central 2022 Wave 1 Release – Ease-of-Use Features

  There are many new features in the Dynamics 365 Business Central 2022 Wave 1 Release to get excited about! […]

Read the Article

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X