Showing posts with label SSRS. Show all posts
Showing posts with label SSRS. Show all posts

Wednesday, 8 May 2019

IntelliSense in SQL Server 2008 R2 Management Studio stops working (most of the time)

After installing Visual Studio 2010 Service Pack 1, the IntelliSense in SQL Server 2008 R2 Management Studio stops working (most of the time).

The fix is to install SQL Server 2008 R2 Service Pack 1.

The fix for this issue was first released in Cumulative Update 7. For more information on Cumulative Update 7  click here.

Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. I recommend installing SQL Server 2008 R2 Service Pack 1 or Service Pack 3.

I hope this was informative. Please feel free to leave comments, if any.

Microsoft Dynamics CRM - Global Option Sets (Picklists)

CRM 2011 was released with many new features. New features were added in the core application, configuration and extending CRM. One of the most appreciated new feature is Global option sets. The other name given to it is Global picklists.

In Dynamics CRM 4.0 there were local option sets. Let's say the requirement is to have a country option set in 10 different entity forms. In order to have the country list, we need the country option set in all the entities and so we need 10 country option sets. All these 10 country option sets had same items in it. If we change the name of a country or add a new country, then we need to make a change at all 10 places. Dynamics CRM 2011 has improved upon this limitation. We can have one global option set for a country. Then each country list in every entity can derive from this "country Global option set". In case any changes are there, it will be done at one place and all derived lists are updated.

I will show how to create and use a global option set. I will create a global option set for the country. I will add few countries and then create a local option set in the entity "Movie". The local option set on the "Movie" form will be derived from this global option set. For the clarity of this demo, I have marked important sections on the screen shots by a green rectangle.

1) I will go to my unmanaged solution "Movies". I am soon planning to write a blog on Unmanaged Solutions.

Click on the component "Option Sets" from the left navigation. This will open the list of all my option sets in this solution. All the option sets added here will be Global option sets. These global option sets are part of the solution "Movies" which later can be deployed from one environment to another as part of a managed solution. Click on New button.

Click New button to Add a new Global Option Set
Click New button to Add a new Global Option Set

2) The new Global option set window opens. "Display name" is the label of this Global option set. "Name" is the unique Schema name and Logical name for this Global option set. Add the countries as options (also called as items in CRM lingo). Each country I add will have a Label and a Value. I suggest to accept the default "Value" assigned by CRM.

New Global Option Set Window
New Global Option Set Window

3) I entered few countries to this Global option set. The Global option set window will look like below. Save and close.

Create a new Global Option Set for Countries
Create a new Global Option Set for Countries

4) I will create a local option set for the entity "Movie". Click on New to create a new field for entity "Movie".

This new option set field for Movie is derived from the Country Global option set. This Movie option set will display all the countries defined in the step above.

New Country field for
New Country field for "Movie" Entity

5) Add the required fields. Pay special attention to the "Type". The Type of this field is "Option Set".
I will select "Yes" to the option of use existing option set.

Select the Country value against the option set. This is where our local field will reference to any Global option set we select.

Leave default value as unassigned. Save and close.

Add this new field on the entity form. I then click on "Publish all Customizations" for my solution. This will publish all the above changes and make the new field available on the form.

Configure the new field as Country Global Option Set
Configure the new field as Country Global Option Set

6) Go to any existing record for the entity. I have opened the Movie record "GoldenEye" and find the Country option list. I can select any country from the list. Any changes to the Global option set will be automatically reflected here and at all the places which refers to it.

Use the new field on the
Use the new field on the "Movie" Entity Form

I hope this blog about CRM 2011 feature of Global Option Sets (Picklists) was informative. Please feel free to leave comments, if any.

Unit Testing for CRM 2011; Plugins, Custom Workflow Activities and Custom .Net Code

Every time we write a plugin and a custom workflow activity, we should make sure it works as desired. The business logic we write within these plugins and custom workflow activities, should accept the business confirmed parameters and should perform the agreed operations.

The above holds true each time we change these plugins and custom workflow activities. Every time we make a change, the plugins and custom workflow activities again need to be tested and verified. Unit testing in Visual Studio 2010 (out of the box) helps us achieve this process. In unit testing we will always need to Mock the CRM contexts and the data.

“Moq” mocking library can help in writing unit tests for CRM 2011 plugins and custom workflow activities, by mocking the CRM context and makes it easier to pass parameters and define the results.

Moq (pronounced “Mock-you” or just “Mock”) is the only mocking library for .NET developed from scratch to take full advantage of .NET 3.5 (i.e. Linq expression trees) and C# 3.0 features (i.e. lambda expressions) that make it the most productive, type-safe and refactoring-friendly mocking library available. And it supports mocking interfaces as well as classes. Its API is extremely simple and straightforward, and doesn’t require any prior knowledge or experience with mocking concepts.

The below screen shot shows the skeleton of how the MOQ can help us in Mocking (the CRM 2011 context). After Mocking, we can unit test by changing input parameters as we do with any other .Net unit testing.

MOQ: Mocking the CRM 2011 Context for Unit Testing in Visual Studio 2010
MOQ: Mocking the CRM 2011 Context for Unit Testing in Visual Studio 2010

I hope this was informative. Please feel free to leave comments, if any.

Sunday, 10 December 2017

Adding and Updating Security Roles to a Migrated Business Process Flow

There is still an issue in case you want to "Enable Security Roles" for a migrated Business Process Flow in Dynamics 365 Version 9.

When you do a migration from a lower version of Dynamics CRM to Dynamics 365 and as part of the migration are existing custom business processes. If you open one of these business processes and select "Enable Security Roles", there are no options to either "Enable for everyone" or "Enable only for the selected security roles". 

"Enable Security Roles" Option for Migrated Business Process

In Dynamics 365 for new Business Process Flows and existing system Business Process Flows, there are no issues. You can find options "Enable for everyone" and "Enable only for the selected security roles". 

"Enable Security Roles" Option for Existing Business Process

The solution is to directly open "enable security roles" windows for a migrated business processes using a URL.

The format of the URL for a Business Process in my Dynamics 365 V9.0 environment would be:

https://ashishm1974.crm.dynamics.com/tools/dialogs/RoleAssignment.aspx?dType=1&oid=%7b6E9A821B-3CBC-4F04-9619-F2B723FE4880%7d

This will directly open the window to enable security roles for a business process. Replace the URL and Business Process GUID as in your Dynamics 365 environment.


Friday, 1 December 2017

Use of Option Set Vs Two Options in a Business Process Flow

Business processes within Dynamics 365 streamlines and creates a visualization of information flow through various stages. Each stage combine "data steps" to reach a business decision to either move forward or backward.

The data steps in a business process stage are fields used to capture information. Option sets and two options can be used as data steps. 

Two option should only be used if a data step is not required in a business process stage. The problem with two options is that they cannot have "unassigned value" as a default. Therefore even if a two option is marked as required on a business process stage, one can still move to next stage based on the default selected.

1) I have created 2 fields on Opportunity. These will be used as data steps to capture whether due diligence is done. 
One field is an option set with two values "Yes" and "No". The default value is unassigned.

Option Set Field

Second field is a two options with values "Yes" and "No". Default value is "No". The issue here is that the default value can only be selected as "Yes" or "No".

Two Options Field

2) Both these fields are displayed as data steps on the Opportunity Business Process "Qualify" stage.

Business Process on Opportunity


3) Open a new Opportunity, enter a "Topic" and "Save". This will create a new opportunity in "Qualify" stage. As seen the two fields are displayed as data steps in "Qualify". The top field is an option set and bottom field is a two option.

Testing these Fields


4) The both are required but only option set field will force a user to select a value (if nothing is selected) when moving to next stage. 

Option set can have an unassigned value as a default. Therefore always use option set over two options whenever it is required to capture data on a business process stage

Monday, 18 March 2013

Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online - Image (PNG, JPG, GIF, ICO) Web Resources

Web resources are a great step forward and were introduced in Microsoft Dynamics CRM version 2011.

Web resources are a great way to act as a container. Web resource can store a piece of JScript code, image, etc.

Web resources are virtual files which are always stored in the Dynamics CRM 2011 database. This is beneficial as we don't have to worry about the physical files and their locations.

Web resources have a unique path and can be accessed through that URL. This is beneficial as we can use the URL in our code.

There are the following kinds of web resources:
  • JScript
  • XML
  • XSL
  • Image (types are ICO, PNG, JPG, GIF)
  • HTML
  • CSS
  • Data
  • Silverlight

The 3 most widely used types are JScript, HTML and Image. Read my blog for more information on Script (JScript) Web Resources.

In this blog I will show how to create and use an image web resource.

Image web resources are the container for the images in ICO, PNG, JPG or GIF format. Image web resources can be used for:
  • Custom Entity Icons
  • Display images on the Entity Forms
  • Icons for Custom Ribbon Buttons
  • Icons for Site Map
In this blog I will create an Image web resource to store a JPG image. I will include this image on an entity form.

1) I have an entity called "Movies". I have few movie records.

"Movies" Entity and Records
"Movies" Entity and Records

2) In the movie entity record, I want to place an image on top of the form. This image will be the same for every movie entity record. Below I have shown the area where I would be displaying the image.

Movie Record "Pirates of the Caribbean: On Stranger Tides"
Movie Record "Pirates of the Caribbean: On Stranger Tides"
3) I have an image which I would like to display on every form.

Image Displayed on Every Movie Form
Image to be Displayed on Every Movie Form
4) I will create a web resource. I will go to my "Movies" solution.

"Movies" Solution
"Movies" Solution
5) I will go to the "Web Resources" component inside the solution. 

"Web Resource" component inside the Solution
"Web Resources" component inside the Solution "Movies"
6) I will create a new web resource called "Movies Header Image". I have selected the "Type" as "JPG format". This means this web resource is of type image and format is JPG. Click "Save".

Movies Header Image Web Resource
Movies Header Image Web Resource
7) The web resource is created. There is a unique URL created for this web resource. This means the image can be accessed through this web resource URL.

By creating an image web resource, we are making sure that this image is available to Dynamics CRM 2011 for use.

The URL created here is:
http://crm2011:5555/AshishMahajan/WebResources/new_Movies.HeaderImage.

Movies Header Image Web Resource Created
Movies Header Image Web Resource Created
8) Publish this web resource. We need to publish the web resource to make it available. After publishing I can start using the web resource in my "Movies" entity form.

Publish Web Resource
Publish Web Resource
9) I will go to "Movies" entity form and insert this web resource. The "Movies" entity is under the Entities component in the solution.

Movie Entity in the Solution
Movie Entity in the Solution
10) Open the main information form for the "Movies" entity.

Open the Main Information Form for the "Movies" Entity
Open the Main Information Form for the "Movies" Entity
11) Click on the "Insert" tab on the form. Here we have the option to add a "Web Resource". Click on the ribbon button "Web Resource".

Insert Web Resource
Insert Web Resource
12) I have entered the following properties for this web resource. I have selected the image web resource; I created above in the field "Web resource". Click "OK".

Web Resource Properties
Web Resource Properties
13) This will place a control at the end of the section (which is selected).

Web Resource Control Created
Web Resource Control Created
14) Since I want to display this control on the top, so I will drag it to the top of "Movie Name" field.

Go to "Home" tab. Click "Save and Close".

Drag the Web Resource Control to the Top of Movie Name Field
Drag the Web Resource Control to the Top of Movie Name Field
15) Publish changes to the "Movie" entity.

Publish the Movie Entity
Publish the Movie Entity
16) The web resource will be displayed on all the "Movie" entity records. Below, shown, are 3 movie record examples displaying this image.

Movie - Pirates of the Caribbean On Stranger Tides
Movie - Pirates of the Caribbean On Stranger Tides
Movie - Skyfall
Movie - Skyfall
Movie - The World Is Not Enough
Movie - The World Is Not Enough
I have used this blog to create and display an image web resource on an entity form. You can very well display it as a custom ribbon button icon or a site map icon or a custom entity icon.


I hope this blog about 'Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online - Image (PNG, JPG, GIF, ICO) Web Resources' was informative. Please feel free to leave your comments.

Sunday, 17 March 2013

Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online - Supported and Un-Supported Code, Customizations and Extensions

Microsoft Dynamics CRM 2011 is a robust application. It is a highly customizable xRM platform which can be used as a non-CRM application.

Dynamics CRM 2011 can be customised and extended in many ways:
  • Customizing Site Map 
  • Changing Icons
  • Customizing Ribbon Buttons
  • JScript Web Resources
  • Other Web Resources (HTML, CSS, XML, Image, Silverlight, etc.)
  • Plugins
  • Workflows
  • Dialogs
  • Custom Workflow Activities
  • SSRS Reports
  • Integration with other applications through tools like Scribe, etc.

When customising and extending Dynamics CRM 2011, always write supported code. Supported code is the code which falls between the boundaries of Dynamics CRM platform. Meaning the code is well integrated into the Dynamics CRM architecture and is easily upgradeable.

On the other hand unsupported code or unsupported customisations fall outside of what should be done in Microsoft Dynamics CRM 2011. It is not that the unsupported code will not work or not produce the desired results. The unsupported code if written correctly will do the job, but is not supported by Microsoft. In simple words Microsoft takes no responsibility for your unsupported code.

The problems with unsupported code or unsupported customizations are:
  • Future service updates or rollups for Dynamics CRM 2011 can reverse your changes. In worst case scenario the installation of the service update or rollup will fail. 
For example, if you change manually any of the core Dynamics CRM files to change the look and feel of CRM. Next time when you try to install the service update or rollup, the installation might overwrite those core files. This will remove your changes and you will have to make those changes again.
  • When you try to upgrade to the next version of Microsoft Dynamics CRM, this could lead to many issues. Upgrade from current to future versions will be seamless if your CRM 2011 has all the supported customisations. In case of unsupported customisations, there could be errors as that piece of code could no longer be executed in CRM's programming model.
  • If you are a large IT consultancy firm and are involved with your customer for their critical enterprise level Dynamics CRM project. This project involves more than a year of development. Before go-live your customer calls another company for final auditing of this project. If those company's consultants pin-point that there are unsupported code and customisations, this could be a major source of embarrassment for your organisation.
  • There is no Microsoft support for unsupported code and unsupported customisations in Dynamics CRM.

Few Examples of Unsupported Customisations

  • Document Object Model (DOM): Referencing Document Object Model (DOM) objects in HTML in JScript is not supported. Always use the new CRM 2011 XRM Page programming model. The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. 

You can read more about JScript development and the cheat sheet in one of my blog.

  • SSRS Reports: SSRS reports in Dynamics CRM 2011 should always be either Fetch XML based or filtered views based. SSRS reports based on SQL which accesses non-filtered views are unsupported.
In Dynamics CRM database there are always 2 types of views "filtered" and "non-filtered". Non-filtered view is named, based, on the entity's name. For example, "select * from account" will get me all records. "account" here is a view which will combine tables like  "AccountExtensionBase", "AccountBase" and other related tables. "account" view is a non-filtered view which never has security inbuilt into its script. On the other hand if I use "select * from FilteredAccount", I will get only the records to which I have access. Use of filtered views is supported over the use of non-filtered views.
  • Direct Database Table Modifications: Direct database table modifications, through code, are unsupported. For example, in a plugin if I have code which changes the status of an entity record through a SQL script, this is unsupported. Always use CRM 2011 web services to make changes to any entity fields.
  • CRM 2011 SDK: The best reference for always writing supported code is the CRM 2011 SDK. 
SDK has articles and examples on how to extend and customise CRM. If it's not there in SDK, then it is likely to be unsupported.
  • Ribbon: You can always extend Ribbon XML and customise by adding you own buttons. Ribbon buttons defined for system entities are already there when CRM 2011 is installed. You can hide or disable them. You can also use CRM 2011 Ribbon commands. Reuse of CRM 2011 Ribbon JavaScript functions is unsupported. Reason being these functions can be overwritten during upgrade or get deprecated.
  • Database Schema Changes: Physical changes to the CRM 2011 database schema are unsupported. This could lead to severe performance issues or even CRM 2011 being unavailable.
The only supported changes are adding new or updating existing indexes.
  • Help Content: Changes to the help content for CRM 2011 application is not supported for on-premises.
  • Core CRM Files: Changes to Core CRM files in its installation directory is unsupported.
  • CRM 2011 IIS Website: Making changes within the CRM 2011 IIS website like adding another website is unsupported.
I hope this blog about 'Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online - Supported and Un-Supported Code, Customizations and Extensions' was informative. Please feel free to leave your comments.

Thursday, 14 March 2013

Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online - Get the Form Control ID

Microsoft Dynamics CRM 2011 is a web application. It is setup as a web application in IIS. It can be browsed through the clients such as a web browser or Microsoft Outlook. Previously Dynamics CRM could only be accessed through a single web browser Internet Explorer. The latest release of Microsoft Dynamics CRM called Update Rollup (UR) 12 delivered multi-browser support. The Dynamics CRM 2011 access in Microsoft Outlook is also through Internet Explorer. If you open the records in Microsoft Outlook, they actually open in the Internet Explorer browser window.

In this blog I will show how to get the ID of any Microsoft Dynamics CRM 2011 form controls in Internet Explorer.

There are many occasions where one would need the ID of a control on a Dynamics CRM 2011 form. Like in my case I want to change the images on the form based on the record selected. I have an entity called "Movies". For every movie record there is a "JPG" web resource storing the movie poster image. I want to dynamically display the related image for a movie record.

"Movie" Entity Records
Below are the 3 "Movie" records and the dynamically displayed images (related to the movie).

"Movie" Record Skyfall

"Movie" Record Casino Royale

"Movie" Record GoldenEye
The image, on a CRM 2011 form, is displayed as an inserted web resource control.

"Movies" Entity Form Design Showing the Web Resource Control
This web resource displays an image by default. The same image will be displayed for all movies. In order to dynamically change this image I need to write a JScript web resource. The JScript code displays the image web resource and is dynamically selected based on the "Movie" record name.

JScript Code
As seen above the web resource is selected based on the movie record name. There is an Image Web Resource for every movie and is named after the record name. In Jscript to code the display of the Image Web Resource in the image control, I need the ID of this image control. In the JScript code, above, the ID used is "WebResource_Movie_Images".

I can find the ID of any Microsoft Dynamics CRM 2011 control from the Internet Explorer "F12 Developer Tools". Internet Explorer Developer Tools (formerly known as Internet Explorer Developer Toolbar), is a component of Internet Explorer that aids in design and debugging of web pages. 

Open any "Movie" form. Let's say I have opened the "Movies" entity record GoldenEye. Press F12 on the keyboard to open the tools. Or else select the "F12 Developer Tools" option from the Internet Explorer right hand side "Tools" menu.

Internet Explorer "Tools" Menu
The Internet Explorer window, below, will now display the "F12 Developer Tools".

Internet Explorer Window Displaying the F12 Developer Tools
I want to find out the ID for the image control. Click the arrow button "Select Element By Click".

Select Element By Click
Select the element (control) on the form whose ID you want. In this case I want the ID of the Image so that I can use that in JScript code. Take the mouse cursor on the image and click once. This will open the HTML for the page on left hand side. On right hand side it displays the CSS for the page. The HTML tag for the image is selected and highlighted in blue.

Select The Image Element (Control)
From this highlighted HTML tag (of Image) in blue, we can get the ID. As seen below, the ID is "WebResource_Movie_Images". This is the same ID which is used in the JScript above.

Selected Image HTML Tag and The ID

In this way we can use the Internet Explorer "F12 Developer Tools". Using this tool we can find out the ID of the Dynamics CRM 2011 form controls. These ID can be used in the JScript as I have done above.

A piece of advice: Before using the control and the ID in JScript code, always check whether the code is supported or unsupported. Unsupported code is the one which doesn't conform to the CRM 2011 platform coding principles. If you write unsupported code, there could be problems in installing future service packs or upgrading to the new Dynamics CRM release.

I hope this blog about 'Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online - Get the Form Control ID' was informative. Please feel free to leave your comments.

Thursday, 21 February 2013

Ashish, congratulations! You have one of the top 1% most viewed LinkedIn profiles for 2012.

I just received an email from LinkedIn:

"Ashish, congratulations! You have one of the top 1% most viewed LinkedIn profiles for 2012"


It is good to know that my LinkedIn profile is in top 1% most viewed profiles for 2012.

Click here to view my LinkedIn profile.


My LinkedIn profile is in top 1% most viewed profiles for 2012
My LinkedIn profile is in top 1% most viewed profiles for 2012

Please feel free to leave your comments.

Tuesday, 28 February 2012

Microsoft Dynamics CRM 2011 - SSRS Multi-Series Chart and Display in Dashboard

One of the helpful additions to new CRM 2011 features is Dashboards. In dashboards, charts can give us concise view and an accurate idea of the information we are looking for. If we can always get access to the information easily and whenever needed, then getting to a calculated decision becomes easy.

I remember, in one of my previous projects, client wanted me to have a similar dashboard experience. The problem was Microsoft Dynamics CRM version 4.0. Back then dashboards were not out of the box. So I had to write a custom made solution which was a combination of out of the box entities, plugins, silverlight and custom workflow activities. Not anymore. Dashboards are built into CRM 2011 framework.

My blog on CRM 2011 Dashboards will be coming soon!!!

I will demo how to create a multi series column chart in SQL Server Reporting Services (SSRS). I will also show how to add & display this chart on a custom CRM 2011 dashboard.

1) First I will create a multi series SSRS chart in Visual Studio report project. Then I will display this chart in a custom CRM 2011 dashboard.

The chart will compare the total cost of production for movies and the revenue for these movies for each genre. This chart will compare cost and revenue for the movie genres of Horror, Thriller and Family.

CRM 2011 when released did not have the capability of multi series charts. This capability or enhancement was added as part of  Microsoft Dynamics CRM November 2011 service update. The chart wizard now supports the ability to specify multiple data series when designing charts.

Movie Records (used as data in SSRS Multi Series Column Chart) 

2) I have opened a movie record. This record has 2 fields "Cost of Production" and "Revenue". Both these fields are in millions (let's say currency is AUD - Australian Dollars).

Fields "Cost of Production" and "Revenue" will be used in Multi Series Column Chart

3) I will create this multi series chart outside the CRM 2011 environment. I will create this chart as part of a Visual Studio report project or SSRS project or Business Intelligence project. Open Visual Studio 2008.

Note: Even though we use Visual Studio version 2010 for CRM 2011 development, but this version cannot be used for reports development. Microsoft SQL Server 2008 or 2008 R2 installs the report project templates in Visual Studio version 2008 (instead of Visual Studio 2010). Visual Studio 2010 only supports developing local reports (.rdlc).

Visual Studio to Create a Report Project

4) Create a report server project. Name the project "MovieReports". Define the location for the project.

Create a Report Project

5) After the report project is created, add a new report. Name this report "CostVsRevenue". The report is an .rdl file. I can use this file in 2 ways. Later I can import this file in Microsoft Dynamics CRM 2011 or I can deploy it to a reporting server. For our demo, I will deploy this report file to SQL Server 2008 R2 Reporting Server and use the URL address for dashboard display.

Create a New Report

6) In this new report, add a data source. Data source is a connection string embedded inside the report. This connection string connects the report data to a SQL Server database.

Add a Data Source

7) Click Edit button on the data source window. This will open another window to select a SQL Server and a database.

Data Source Window

8) In this window select a SQL Server which hosts your CRM 2011 database. I have selected the default Windows Authentication. Select the MS CRM 2011 database. Click OK button.

Create a Data Connection

9) The connection string is created. I have named my data source "Movies". Click OK button.

Data Connection String as Data Source

10) Add a new dataset. Dataset is a TSQL query connecting back to the database and getting results. Dataset will feed the data to our multi series column chart.

Add a Dataset

11) I have named my dataset "CostVsRevenueSQL". Now I will create and test my TSQL query in SQL Server R2 Management Studio.

Define a TSQL Statement

12) Open the SQL Server R2 Management Studio. Below is the query which I have created and tested. This query returns the SUM of cost and revenue. It is grouped by movie genre.

Create and Test the TSQL Statement

13) I will now embed my TSQL statement in the dataset "Query" field. I have selected "Movies" as my data source which I created above (STEP - 7).

Save the Dataset

14) The new dataset appears under the Datasets folder.

Dataset Added

15) I am all set to insert my chart, as I have my data ready. Take your mouse anywhere on the report's design surface and right click your mouse. Select Insert and then select Chart. This will bring the chart window.

Add a Multi Series Column Chart

16) There are many types of charts like Column, Line, Shape, Bar, Area, Range, Scatter and Polar. I have selected the first Column type chart which can handle a multi series display. My demo also applies to many other types of charts. You can use my demo in the same way with other charts.

Select a Chart

17) This will create a chart skeleton on my report. Now I can start binding data to the chart and I can customize chart as per business requirements. 

The Multi Series Column Chart Added

18) Select and click over on the top right hand corner which has "Series 1" and "Series 2" displayed. This will bring the "Chart Data" window. Add values. Do this by clicking the green plus sign at the right corner. This will bring all the fields from the query.

Since we are comparing cost and revenue, I will select options "Cost_of_Production" and "Revenue". This will add these fields as values. Cost and revenue will be part of "Y-Axis" on the column chart.

Add the Numerical Financial Data Values

19) Now I will add the "Group By" data which will form part of "X-Axis" on the column chart. We are only interested in cost and revenue for movie genres, so we select movie genre.

Add the Movie Genre as a Category Group

20) Our final chart data selected looks like below.

Chart Values and Category Groups

21) I renamed the title, X-Axis and Y-Axis displays for my chart. I gave more meaningful names for what it represents.

Add and Modify Chart and Axis Label

22) I will go to Preview tab and run my report.

The report is running and displaying data as required. It is called as multi series column chart as we have 2 columns side by side displaying 2 different value types.

Cost Vs Revenue Chart Output for all the Movie Genres

23) Take your mouse over the project name in Solution Explorer in Visual Studio 2008. Right click the project name and select properties. This will bring the properties window as shown below. I have added the values as per my scenario. These values will be used to deploy my report to the required folder inside reporting server as per what I need.

Report Project's Deployment Settings

24) I will now deploy my report. Select the report and right click and select "Deploy". This will deploy my report on the reporting server. I can access my report through a browser.

Deploy the Chart

25) Open Internet Explorer. I will go to my reports area and which is "http://crm2011/reportserver". Then as per the project settings I had given above (STEP-23), I can see my report under the folder structure "/MyHome_MSCRM/CustomReports/MovieReports".

Test the Chart from the Reports Server in a Browser (Internet Explorer)

26) Click the report to run in Internet Explorer. The report runs fine. Copy the URL address of this report which is required to display report in the CRM 2011 Dashboard IFrame.

Run the Chart and Get the URL Address

27) I will open CRM 2011 in the browser (Internet Explorer). I will go to my unmanaged solution where I need this new dashboard added. I will go to Dashboards section and click on New.

Create a new Dashboard in Movies (Unmanaged Solution)

28) This brings "Select Dashboard Layout" window. I will select the dashboard of type "3-Column Focused Dashboard". This is helpful in case our dashboard component display is large in height and width.

In my case I would like to display the chart in a bigger cell.

Add a 3-Column Focused Dashboard

29) Selecting the type will open the new dashboard in edit mode. I will add my SSRS chart to the first cell. The best option is to add an IFrame to the first cell and then display the chart in this IFrame. Click on "Select Iframe" option.

In First Column Insert an IFrame

30) The IFrame window opens. I have named my IFrame as "CostVsRevenue". The URL address which I had copied in STEP-26, I will paste it in IFrame URL.

Pay special attention to 3 check boxes. I haven't selected "Pass record object-type code and unique identifier as parameters" check box. I have not selected "Display label on the Dashboard" check box. I have also not selected "Restrict cross-frame scripting" check box.

Define IFrame Properties

31) The IFrame "CostVsRevenue" gets created. I have named my dashboard "Movies". I will "Save and Close" my dashboard. 

Save and Close the Dashboard

32) I will publish my changes by clicking "Publish All Customizations". This will make my dashboard available. This dashboard will be visible through the CRM "Dashboards" navigation in the "Workplace" area.

Publish the Dashboard

33)  I will go to "Dashboards" (left hand side navigation) under Workplace.

CRM Dashboard Section

34) I will go to "Dashboard" (right hand side) select list. I will select my newly created dashboard "Movies".

Select "Movies" Dashboard

35) Here it is, my multi series column chart displayed beautifully in the dashboard.

"Multi Series Column SSRS Chart" Displayed in a Custom CRM 2011 Dashboard

As we saw above, multi series charts are very helpful and powerful. Microsoft Dynamics CRM 2011 brings to us extensive charting and dashboard capabilities, helping the users to analyse their data quickly and effectively. The chart control is rendered as a single image.

Multi series charts help us compare and analyse 2 different values for the same type.

I hope this blog about 'SSRS Multi-Series Chart and Display in Dashboard' was informative. Please feel free to leave your comments.