Working with Charts in CRM 2011

By | September 21, 2011
Dynamics CRM 2011 provides us the Charts, with the help of the Charts we can Graphically represent the Organization data. We can create the System Charts and User Charts in the CRM. The System Chats can be viewed by the All users of the Organization and the User Charts can only be view by those whom the Chart Assigned or Shared.

We can create the following different form of charts:
• Column
• Bar
• Line
• Pie
• Funnel

To create a chart, specify fields to be displayed on the category and series axes. Normally, the category axis displays data from numeric or non-numeric fields. The series axis displays data from numeric fields.

The Chart Designer supports creating only single-series charts. To create multi-series charts or comparison charts, we need to write the code.

Also we can Export and Import the Charts.

Note: We can create and attach charts to only those record types in Microsoft Dynamics CRM that support the new ribbon interface in the Web application. This is because all of the chart controls are only present in the ribbon interface of Microsoft Dynamics CRM.

We can create the charts from the CRM Views or by the Coding.

Create the Charts through CRM Views: You need to create the CRM view on the required Entity and then create the chart on this. As shown in the below screen shot we have create the view of all opportunity and then create the Sales Pipeline Chart for that view. As shown in the below screenshot.



Now open the Opportunity Entity and Create the Chart as shown in the below screenshot.





Create the Chart by the Coding:

Below we have given that how to create the Sample Chart through Coding.

To create the chart the Main things are the Fetch XML, Data XML and the Presentation XML.

 

Suppose if you need to create the Sales Pipe line funnel then you need to create the following three items.

1.       Fetch XML View: For creating the fetch xml view, you need to create the Saved Query for that as given below.


                           savedquery newSavedQuery = new savedquery();

               newSavedQuery.name = “Sales Pipeline Funnel”;

               newSavedQuery.fetchxml = @”

                                      

                                             output-format=’xml-platform’

                                             mapping=’logical’

                           distinct=’false’>

                                            

              

              

                        

              

              

               

                           

                                     

                       “;

               newSavedQuery.returnedtypecode = EntityName.opportunity.ToString();

               newSavedQuery.layoutxml = @”

               select=’1′ icon=’1′ preview=’1’>

              

                      

                      

                                     

                                      

               

                                “;

               newSavedQuery.querytype = new CrmNumber();

 

newSavedQuery.querytype.Value = SavedQueryType.MainApplicationView;

 

Guid viewId = service.Create(newSavedQuery);

2.       Presentation: Then you need to write the following Presentation for that.

3.       Data Xml: Below we have created the Data XML for that. In the Data XML we need to provide the Presentation and the Fetch XML view Id, as given below.

After doing the above things please call the Publish request, As given below.

   // Execute the request.

 For more details about the Charts you can use the following link.

Also you can refer the CRM 2011 SDK.

Leave a Reply

Your email address will not be published. Required fields are marked *