Friday, February 1, 2013

SSRS - Working With Map Control (1)

In this article, I will explain how we can use MAP control in SSRS.

MAP controls is new control added in new version of SSRS. You can present maps of the world, country, buildings, areas, roads ... etc.

I'm going to separate this article to multiple parts.

In this part, I'm going to show you how to use SSDT and create new SSRS project. Then, we will move to MAP control and describe its features and usage.

If you download SQL Server 2012, SSDT (SQL Server Data Tools) and Visual Studio 2010 will installed in your machine automatically.
If not installed, you can download it and install it in your machine
through this link: Click Me and for more information about versions and installation read this: Click Me

Now, open SSDT:


From File menu, create new project and set solution name "TestingMaps_SSRS", for example.


Create new report without data source, then drag and drop MAP control from Toolbox menu:


Now see the first window of the configuration:


Let me explain how map works, the first option is default option which shows MAP for USA.
you can select USA by state, USA by state exploded and USA by state inset.
In addition you can select specific state map for USA under States by Country folder.
The different between them is the data. I mean the map, the information of state ...etc.

The second option is ESRI shapefile. its file shows information about selected map.
for example you can download ESRI shapefile for KSA which shows KSA map, administrative areas, area codes, area phone code .... etc.

But the question is, where can I find the ESRI file?
There are a lot of sites provide ESRI files for FREE! and the following some of them:
- www.diva-gis.org
- www.vdstech.com
- www.gadm.org

The last option is from SQL Special Query. which means ESRI file inserted in SQL table.

In this part in may article, we will focus the first option.

Select "USA by state exploded" then press Next button:


In the second screen, you can change map appearance, quality and connect your map with Microsoft Bing Maps:



The third screen shows map visualization. You can select Basic Map, Color Analytical  Map or Bubble Map.

The Basic Map shows map as it is.
Color and Bubble maps should be connected with analysis service or data source to describe more data.
For example, State be Sales, State by Census, State by Customers ... etc.

We will select Basic Map:


The last screen select map theme. there are multiple themes select your favorite one.
There is check box called "Display Labels" check it and select "#STUSPS" from data field drop down list.
The "#STUSPS" will display state name shortcut in the map.
Press Finish and browse the report, you will see the following result:



Finally, you can change MAP TITLE from map properties.