Title:       CRM Customization - Add Custom Report to CRM Reports - Change Reports Grid in CRM
Author:      Greg Dubinovskiy 
Email:       siccolo_mobile_management@yahoo.com
Environment: Microsoft CRM
Keywords:    Microsoft CRM, CRM Customization, CRM Reports, Custom Reports in CRM, CRM Customization Tools, Crystal Reports, grid_data_reports.aspx 
Level:       Intermediate
Description: CRM Customization - Add Custom Report to CRM Reports - Change Reports Grid in CRM (grid_data_reports.aspx)
Section      Miscellaneous
SubSection   General

Siccolo Development Articles - MS CRM Customization - Add Custom Report to MS CRM Reports - Change Reports Grid in MS CRM - grid_data_reports.aspx
Google

Introduction

The article presented bellow, shows how to add a custom report page to CRM - add a link to custom report to Reports Grid in CRM.
(see other Siccolo articles about working with CRM:
CRM Customization - Import CRM Leads from Excel via Email and CRM Customization - How to Qualify Leads in CRM - Set Lead State and Status in CRM ) Customizing CRM is not hard at all, thanks to semi-open web interface. This article shows how to add your own custom report to CRM. No, not using Crystal Reports.
Quickly customize Microsoft CRM - CRM Reports - so that you capture and manage the exact data you need to increase sales and service effectiveness. Customize the Microsoft CRM user interface - Learn how to customize the Microsoft CRM user interface by creating and modifying forms, views, and previews. Microsoft CRM allows system integrators to create a highly customized and integrated application. In addition, the solution supports flexible options that enable users to focus only on the features they need to perform the tasks their jobs require.

Add Custom Report to CRM - create a link to a custom report in Reports grid in CRM




1. Create your own custom report page
For example, I'm using ASP/HTML to create something like this:




2. Add a link to CRM Reports grid
in Microsoft CRM, in [your CRM server]\c$\Inetpub\wwwroot\_grid folder, open grid_data_reports.aspx file.
<body>

<% 
	crmGrid.RenderData(Response.Output);
	RenderContextMenu();
%>

	<% if (Request.QueryString["ReportAreaID"]=="19")
	{
		%>

		<table width="100%" 
			cellspacing="0" 
			cellpadding="1" 
			class="gridData" 
			onclick="handleClick();" 
			ondblclick="handleDblClick();" >

		<col width="29"><col><col width="100">
		
		<tr reportid="99999">
		<td>
		<img src='/_imgs/ico/18_addTeam.gif' border=0>
		</td>

		<td>
		Commissions Report
		</td>
		<td>Custom</td>
		</tr>
		</table>

	<%
	}
	%>


So, the above code will display a link to your CRM Custom Report. Next, we need to handle link selection.
3. Custom Report Selection - Open Custom Report from CRM Reports Grid
In the same file, in Microsoft CRM, in [your CRM server]\c$\Inetpub\wwwroot\_grid folder, grid_data_reports.aspx file, find Javascript function handleDblClick() function
<%script language="JavaScript">

	...
	...

	function handleDblClick()
	{
		...
	}
	...
	...
<%/script>
Notice, that in the previous section, I assigned "magic" 99999 number to my custom CRM report. To open this Custom CRM report:
<script language="JavaScript">

	...

	function handleDblClick()
	{
		var oTR = event.srcElement;

		// Find the TR that contains the cell that was clicked on
		while (oTR.tagName != "TR")
		{
			oTR = oTR.parentElement;
			if (oTR == null) return; 	// ignore the dragged cursor command
		}

		if (  oTR.reportid == 99999)
		{

			window.open("[path to your CRM custom report here!]", 
						"commissions_report", 
						"width=700,height=500,resizable=yes,status=no,toolbar=no,menubar=yes,location=no,scrollbars=yes");
			return
		}
		...
		//else - open CRM report, as usual:
		window.open("/reports/viewer/html/viewer.aspx?id=" + oTR.reportid, null, "resizable=yes,status=no,toolbar=no,menubar=no,location=no");
	}

	...
</script>

And that's it. We just developed our own CRM customization. As you can see Microsoft CRM Customization can be done with various tools.
Article keywords: Microsoft CRM customization, CRM Management, CRM Reports, grid_data_reports.aspx

Back To Articles Page

Free Mobile Management For SQL Server(s!) - Siccolo - SQL Management ToolQuestions? Suggestions? Concerns? - email me to siccolo_mobile_management@yahoo.com    Greg Dubinovsky 2007
or share your thoughts at Siccolo Blog

Web being sponsor - Mid-Atlantic Processing. Well being sponsor - Clarity MediSpa. Hairless sponsor - Clarity MediSpa Laser Hair Removal.
Siccolo - SQL Server Management Tool For Mobile Devices is packed with built-in functionality and tools. Siccolo delivers a rich set of management tools for both DBAs and sys admins. SQL Server management has always been an area of DBA concern. The new Management Tool For Mobile Devices - Siccolo - has simple "Enterprise Manager" and the "Query Analyzer". Siccolo is a management tool for the MS SQL Server with administration capabilities and a database query tool. The administration features provide users the ability to browse database structures. An integrated query tool allows users to quickly create, edit and execute SQL queries and scripts. Siccolo also provides an export tool to allow users to easily save and email execution results. Siccolo helps database professionals save time and increase their productivity by utilizing a more efficient approach to database management - use their Windows Mobile empowered device while sipping margarita on the beach For increased security, Siccolo is configured to run under SSL with IIS authentication.