welcome to XRM blog

Keep in touch with latest CRM/ERP articles

To remain competitive your organisation must be efficient across the business process spectrum. To do so you need to take sound decisions based on a balance between the cost and risk. To do so you will be heavily dependent on your content management in itself needs...

image
Blog

Fetch XML Reporting in 10 easy steps

By Rajesh on 1/8/2014

We earlier developed reports using MS-SQL Server Reporting Services (SSRS). We define query for the desired output either in SQL Query or Stored Procedure. When we talk about Microsoft CRM 2011 then there are 2 approaches we can follow:

1.SQL Query or Stored Procedure

2.Fetch XML

Now many developers aware of first method but not aware of the latter one. In the latest version of MS CRM - Microsoft CRM 2013 has only Fetch XML Reporting.

We will talk about Fetch XML Reporting in this article.

Fetch XML Reporting is new for the developer who uses SQL Server Reporting Services. Now we take one sample report to display what's new in it and what is way to create Fetch XML Report for MC-CRM 2013.

Step 1 – First open new BIDS Project for reporting.

Step 2 – Add a new report in the project.

Step 3 – Add Datasource. Here, if you notice we have a list of Embedded Connection Type, you have to select Microsoft Dynamics CRM Fetch.


If you didn't found the Fetch XML option, please download from the Microsoft Dynamics CRM 2011 Report Authoring Extension (with SQL Server Data Tools support).

http://www.microsoft.com/en-us/download/details.aspx?id=27823 

Step 4 – Provide connection string where MS-CRM 2013 has been hosted.


Step 5 – Add credentials to access the CRM.


Now datasource has been connected.

NOTE: There is no “Test Connection” button in this Fetch XML Provider. The error will raise when you want to get data from the Data Source.

If credentials are not correct you will get this error.


Step 6 - Create Fetch XML Query

Next, we have to create Fetch XML Query to get the data. Fetch XML is in the form of XML so if you know the exact names of  the Field and Entity then you can write yourself. There is predefined format for writing Fetch XML. We will discuss this in our upcoming blogs.

Another way of getting Fetch XML from the CRM system which is much easier than the previous one. First connect with the online MS-CRM 2013 through browser.


 

After Logged-in, Click on “Advanced Find” appearing below the menu items.


Let say, we want a simple report from Contact Entity displaying Name, Email, State and Mobile fields. Select “Contacts” Entity in the “Look for” Drop-down list. Then click on “Edit Columns” button.


In Edit Columns window, select the needed columns for Report.


There are few columns which will be coming by default, you can remove them and add required columns.

Step 7- Get Fetch XML Query through “Download Fetch XML” button.


This will ask for saving the XML File. Click on “Save” or “Save As”. This will save the file onto your system at the specified location.

If you open this file in web browser, it will look like below image:


This is a basic query and does not contain any condition, join, etc.

Now we have a valid Fetch XML to create a Report.

Step 8 – Add Dataset to report.

Go to Report project, right click on “Datasets” in “Report Data” window, it will display “Add Dataset...”, click on it.


It will display below dialog window:


 

In this window, Select dataset type as “Use a dataset embedded in my report”.

Then, Select Datasource. After that Select Query Type “Text”, paste that Fetch XML inside that textbox.

NOTE: When you copy Fetch XML from the web browser then it will copy all the things as “-” displaying in the beginning. Remove it, otherwise it will cause error.

Now, when you check for the fields under the added dataset then it will show something like the below image:


Step 9 – Add Fields to Report

Now, we have all the things to built a report, just we have to add the fields to report to show.

Dataset will return multiple contacts so will use Table Control from the Report Items to display records.


From the dataset Drag-n-drop fields inside the Data Section of Table Control.












Step 10 – Running Report

After some formatting of Table Header and Report Heading, When you click on Preview, the below report will display.


Report has been Created, now you can Upload it to the Online CRM system.

Fetch XML
Fetch XML Reporting
MS CRM 2013
Author
Blog Calendar
Blog Calendar List
2018 Nov  22  3
2018 Oct  7  3
2018 Sep  13  11
2018 Aug  2  2
2018 Jun  11  1
2018 Jan  41  2
2017 Sep  348  5
2017 Aug  14  1
2017 Jul  15  2
2017 Jun  36  2
2017 May  17  1
2017 Apr  31  2
2017 Mar  104  4
2017 Feb  269  4
2016 Dec  171  3
2016 Nov  265  8
2016 Oct  197  10
2016 Sep  341  6
2016 Aug  38  1
2016 Jun  1580  6
2016 May  102  3
2016 Jan  68  2
2015 Dec  373  6
2015 Nov  3  1
2015 Oct  11  1
2015 Sep  1104  6
2015 Aug  10  1
2015 Jul  101  2
2015 Jun  7  1
2015 May  20  1
2015 Apr  21  2
2015 Mar  67  3
2015 Jan  4997  4
2014 Dec  14  1
2014 Nov  2159  4
2014 Oct  74  2
2014 Sep  95  2
2014 Aug  2847  1
2014 Jul  40  2
2014 Apr  2401  12
2014 Mar  268  19
2014 Feb  216  8
2014 Jan  1490  16
2013 Dec  21  2
2013 Nov  607  2
2013 Oct  239  3
2013 Sep  10  1
2013 Aug  29  3
2013 Jul  202  1
2013 Apr  43  6
2013 Mar  1632  10
2013 Feb  272  4
2013 Jan  244  2
2012 Nov  24  2
2012 Oct  394  10
Tag Cloud
Interested in our services? Still not sure about project details? get a quote