The Map data region uses the following two types of data:
Spatial Data
Spatial data is a set of coordinates that defines a map element. Each map layer must have spatial data of one of the following types - a polygon, a line, or a point.
Spatial data can be either embedded in a map or can be linked to a map layer. The only difference between the two is that while having the spatial data embedded in a map, there is no separate file to locate or to keep track of when you move the report between projects or machines.
ActiveReports provide numerous ways to add spatial data to the map. You can either use the Map Wizard and add data from an or use the Map Layer Data Properties dialog for using advance options. You can also add spatial data from the Properties Window.
To add spatial data using Map Wizard
- From the Visual Studio toolbox, drag and drop a Map control onto the .
- In the Select a Map Template wizard that appears, select From ESRI file.
- In the Open dialog that appears, navigate to the folder that contains the .shp and .dbf files, select the .shp file, use the Map Resolution slider to simplify vector data and click Open.
This option automatically imports the spatial data stored in the shapefile and adds a related layer to the map control.
To add spatial data using the Map Layer Data Properties dialog
The Map Layer Data Properties dialog provide the following advance options to add spatial data. For more information on Map Layer Data Properties dialog, see Map.
-
Embedded : Use this option where you want to add spatial data from an ESRI file along with an additional option of adding custom spatial data fields if required.
To add Spatial data from an ESRI file using the Embedded option
- In the Map Layer Data Properties dialog, on the General page, select the Embedded option and click the Browse button.
- In the Open dialog that appears, navigate to the folder that contains the .shp and .dbf files.
- Select the .shp file, use the Map Resolution slider to simplify vector data and click Open. The fields list gets populated with spatial data fields that are added from the shapefile.
- In Dataset, set the name of the dataset.
- In the Fields list, click the Add (+) button to add a new empty spatial data field.
- With the newly added spatial data field selected in the list, in Field name, enter the name of the field.
- In Field type, set the field type of newly added spatial data field.
- Click OK to close the dialog.
Note : In order to apply the new spatial data field on a layer, you must provide its value for each map layer element like polygons, points or lines in the added map layer Designer Collection Editor dialog.
-
Linked : Use this option when you just want to add spatial data from an without any additional modifications or additions .
To add Spatial data from an ESRI file using the Linked option
- In the Map Layer Data Properties dialog, on the General page, select the Linked option and click the Browse button.
- In the Open dialog that appears, navigate to the folder that contains the .shp and .dbf files.
- Select the .shp file and click Open.
- Click OK to close the dialog.
-
Dataset : Use this option when you have a dataset that stores a spatial data field to provide spatial data to the Map. You can directly use the data fields from the dataset to display data on a map layer without setting the match fields for analytical data. Therefore, it also provides you an additional option of having different dataset for analytical data and spatial data respectively.
To add Spatial data from a Dataset
- In the Map Layer Data Properties dialog, on the General page, select the Dataset option.
- In Dataset, set the name of the dataset.
- In Field name, enter the data field name that contains the spatial data.
Caution: Simply type the name of the dataset field that contains spatial data. For example, enter value as StateName, not as =[StateName].
- Click OK to close the dialog.
-
Analytical : Use this option when you want to use the spatial data field from the same dataset that you may use for adding Analytical data to the layer. For using this option you need to first set the dataset for analytical data and then use the spatial data field from the dataset to provide spatial data to the map layer.
To add spatial data from Analytical data
-
Configure Analytical data for the Map control. See the dropdown section below to learn adding Analytical data.
Note : Once the Analytical data has been set, the Analytical option on the General page of the Map Layer Data Properties dialog becomes active.
- In the Map Layer Data Properties dialog, on the General page, select the Analytical option.
- In Field name, enter the data field name that contains the spatial data.
Caution: In Field name, enter the data field name as =[StateName], not as StateName.
- Click OK to close the dialog.
To add spatial data using Properties Window
These steps assume that you have a Map control containing at least one map data layer placed on the . To learn how to add a layer to the Map control, see Use Layers.
- With the Map control selected, go to the Properties window, click the Layers (Collection) property and then click the ellipsis button that appears.
- In the LayerDesigner Collection Editor that appears, under Members, select the map data layer you want to use and expand the SpatialData property.
- In Type, choose the spatial data source of the layer from the following supported options:
- Click OK to close the dialog.
Analytical Data
Analytical data is the data that you want to visualize on the map, for example, tourist attractions in a city or product sales by region. For analytical data, you can associate it with map elements by indicating match fields in the Match box of the Map Layer Data Properties dialog. You can use one or more fields in the Match box of the Map Layer Data Properties dialog; for each spatial data field you must indicate a unique analytical data field. This data is optional.
You can get analytical data from the following types of data sources.
- Dataset field: A field from a dataset.
- Spatial data source field: A field from the spatial data source. For example, you can often find that an ESRI Shapefile contains both spatial and analytical data. Field names from the spatial data source are marked with the # sign in the drop-down list of fields.
- Embedded data for a map element: After you embed polygons, lines, or points in a report, you can select the data fields for map elements and define custom values.
To add Analytical Data to the Map control
Use the following steps to add analytical data to the map. These steps assume that you have added a page layout template to your report and have a data connection in place. See Adding an ActiveReport to a Project and Connect to a Data Source for further information.
- Add spatial data to the map control. See the dropdown sections above to learn adding spatial data to the map control.
- In the Map Layer Data Properties dialog, go to the Analytical data page.
- Select the dataset that you want to use from the Dataset dropdown list and click the Add (+) button located next to the Match field. This creates an empty match field expression and enables the Spatial and Analytical field properties.
- In the Spatial field and Analytical field options set data fields that contain same data in both Spatial and Analytical databases. This builds the match field expression and relates analytical data to map elements on a map layer.
Note: It is necessary to set match fields if you want to use a spatial data field from analytical data, or if you want to visualize analytical data on the map layer. Match fields enable the report processor to build a relationship between the analytical data and the spatial data.
- Click OK to close the dialog.