Show HTML Webresources in Charts within Microsoft Dynamics 365/CRM

By | March 17, 2017

Introduction:

For a long time now, perhaps from version 2011 of Microsoft Dynamics CRM, we could design charts and these charts are displayed as a contextual pane beside the views that display the requested charts using the data currently being displayed in the View.

It is only recently that we discovered a hidden gem, the ability to use the Chart Area and Charts to display custom web resources. And that also means we can display HTML web resources as Charts :)

How to display web resources in Charts?

Charts have traditionally been visualized to be graphic visualization to support Bar graphs, columns graphs, and the likes. The Chart is represented in an XML format and it is possible to export the chart XML, edit is outside of CRM and import it back. This has been used as an accepted way, especially to represent data in a specific format that is not possible through the Chart designer UI made available in CRM.

Chart XML structure to support custom visualizations:

Steps to add your own visualization:

1. One of the ways to create web resource visualization is to create an XML file in the following format.

The usual chart XML parameters

 that were used in traditional charts to represent the chart layout and data series can be used to pass any custom parameters that may be required by the web resource being displayed in the chart.

2. Use Import Chart button as shown in the below screenshot to import the visualization;

HTML Webresources in Charts within Microsoft Dynamics CRM

3. If you want to programmatically create it, savedqueryvisualization is the entity that stores the details of the chart.

 When it executes successfully, it creates the Charts Record as shown in the below screenshot;

HTML Webresources in Charts within Microsoft Dynamics CRM

4. When you open the Account entity home page grid and select any view and then select the chart that we have created, it will display the HTML web resource with all accounts plotted on Map;

HTML Webresources in Charts within Microsoft Dynamics CRM/365

Note: The webresource will receive the selected chart id and view id as a query string parameter that can be parsed to execute the view and read the records that need to be processed by the HTML web resource for visualization. 

Conclusion:

Use the web resource visualization to display custom content in the context of the view.

Resources:

The following links from the SDK helped us to get this working!

https://msdn.microsoft.com/en-us/library/gg328492.aspx

InoLink: QuickBooks integration with Dynamics CRM / Dynamics 365

Leave a Reply