This entry was posted on Thursday, June 11th, 2009 at 12:22 pm and is filed under Customizations. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Microsoft CRM 4 Dashboards
Although there are some nice dashboard functionality out there that exists in CRM i really like the animated charting controls by a company named FusionCharts. The charts themselves are flash movies that you can deploy by copying the chart that you want to use into your Visual Studio 2005 project.
In this example i am using c#.net and have created a .net 2.0 project. There are 3 ways that you can utilize the reports. The first is to pull data from an existing .xml file. Another way is that you can load the report through javascript.
The method that i have chose is to utilize the RendorChartHTML control in a c# codebehind file.
First i created the sql query i was going to use and populate a data set, in this case i am creating a monthly service call chart for the existing year.
string connString = @”Persist Security Info=False;Integrated Security=False;Server=(Server Name);initial catalog=STIN;user id=(id);password=(password);”;
string sql = @”SELECT MONTH(entdte) AS ‘Month’, Count(entdte) FROM dbo.svc00200 where Year(entdte) = 2009 GROUP BY YEAR(entdte), MONTH(entdte)ORDER BY YEAR(entdte), MONTH(entdte)”;
SqlConnection conn = new SqlConnection(connString);
Now that is completed i will create an xml string that i can use to pass as an argument to the flash report chart later. This is done with a simple for loop, i will also pass in the values i need in the loop to populate the xml data string.
foreach (DataRow row in dt.Rows){
//Start For Loop
foreach (DataColumn col in dt.Columns)Console.WriteLine(row[col]);
//Add Month to xml String Information strXML += “<set name=’” + row[0].ToString() + “‘ value=’” + row[1].ToString() + “‘ color=’AFD8F8′ />”;
Lastly i will call the RenderChartHML control to load and display the chart on the c#.net page.
return FusionCharts.RenderChartHTML(“FusionCharts/FCF_Column3D.swf”, “”, strXML.ToString(), “MonthlyServiceCalls”, “400″, “300″, false);
And then the chart loads into the page. In my example i have the site loaded out side of an iframe, but if you wish you can easily place it inside of an IFRAME in CRM.
Leave a Reply
You must be logged in to post a comment.
