"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

July 31, 2011

Maps Example - SQL Server 2008 R2

In this example we will look at SSRS reports using Maps. Beginning Spatial is very good place to get started on learning Spatial Data types and maps. We will look at simple example of consuming below query provided in beginning spatial to consume in report.


DECLARE @table1 TABLE( id CHAR(1), shape geometry );
INSERT INTO @table1 VALUES
('A','POLYGON((0 0, 4 0, 4 1, 0 0))'),
('B','POLYGON((4 2, 3 2, 3 3, 4 2))'),
('C','POLYGON((7 3, 7 1, 8 1, 7 3))'),
('D','POLYGON((8 3, 11 3, 11 5, 8 3))');

SELECT
id,
shape
FROM @table1;


Let's get started

Step 1- Create blank report and add map as shown below


Step 2 - Add Dataset
Step 3 - Add Data Source


Step 4 - Add below query


Step 5 - Ignore Error


Step 6 - Choose Spatial Data

Step 7 - Map visualization option
Step 8 - Choose Dataset to Display

Step 9 - Data visualization and Scheme

Step 10 - Report Preview


Happy Learning!!!

No comments: