Using the Map Expert

As you explore the charting capabilities, you will discover numerous data visualizations that will enhance the productivity of your reports and business users. Another valuable form of data presentation available in Crystal Reports is geographic mapping. This form of visualization enables the creation of reports that are logically grouped on geographically related information and can communicate meaningful information in a familiar mapping paradigm. When working with geographic data, you can quickly create a map or a map/chart combination on this data using the Map Expert.

graphics/lightbulb_icon.gif

The maps and mapping functionality provided within Crystal Reports are bundled from a third-party company MapInfo. Additional map layers and types can be purchased directly from MapInfo and can be made accessible from Crystal Reports by adding them to the mapping folders under \Program Files\Map Info X. You can order additional mapping information from MapInfo at www.mapinfo.com.


To open the Map Expert, either click on the Map Globe icon located on the Insert toolbar or access the Insert Map option under the Insert menu. Figure 11.9 displays the Map Expert.

Figure 11.9. The Map Expert dialog.

graphics/11fig09.jpg

In the next three sections, you will be introduced to the functionality of the Map Expert and also be escorted through a brief tutorial on the addition of a map to the sample Order Listing report (Chap6.rpt) discussed in Hour 6. (Note that this report is different from the one we have been working on up to this point.) If you have jumped directly to this hour without reading through Hour 6, you can still follow this guided tutorial by quickly creating a new report based on the Xtreme sample data, adding a few columns of data in the detail section, including Order Amount, and grouping the report by Customer Country and then Customer Name.

Map Data Tab

The Map Data tab on the Map Expert enables you to select the specific data that the map will be based on and where it will be placed on the report. Figure 11.9 displays this tab of the Map Expert. The Map Data tab is comprised of three different sections: Placement, Layout, and Data. These sections, and corresponding options, are discussed next.

Map Placement

The Map Placement section is used in an identical manner as the Chart Placement section for charts. It enables the selection of the location of the map on the report and consequently the recurrence of the map throughout the report.

Using the drop-down box, the section of the report that the map is to be located is selected (for example, Group 1, Group 2, and so on). The options available in this drop-down box are limited to the groups previously created in the report in addition to the option to create the graphic only once for the entire report. Using the buttons located beside the drop-down box, the header or footer of the selected report section is selected. By making these selections, you have also determined the chart's recurrence in the report because the chart will repeatedly appear in every section you have specified (for example, for each country in the group based on country).

To begin with a walk through of an example, perform the following steps:

  1. Either open the sample Customer Order Listing Report (Chap6.rpt) from Hour 6 this is the one with groupings on Country and Customer Name or open the report you have just created based on the specifications given earlier (a new report based on the Xtreme sample data a few columns of data in the detail section, including Order Amount, and grouping the report by Customer Country and then Customer Name).

  2. Open the Map Expert.

  3. Select Once Per Report in the Placement drop-down box and select the header as the map's intended location. We will continue with further steps in the next sections.

Map Layout

The Map Layout section specifies the data that the map will use. The actual data is selected in the Map Data section (described next), but the options presented in that section are dependent on the Map Layout button you have selected. Table 11.4 lists the different layout buttons and their typical use.

Table 11.4. Map Expert Layout Buttons and Typical Use

Layout Button

Description and Typical Use

Advanced

Description: This layout button provides complete flexibility in map creation through the provision of control of all mapping options.

Typical Use: Creation of Maps based on summaries not already created in the report or maps based on geographic fields not contained in predefined report groups.

Group

Description: Although this button is presented second, it is the default layout if the involved report has predefined groups and summary fields already created. This layout limits the Map Data Selection options (see next section) to two drop-down boxes specifying the On change Of and Show values and expedites the creation of a map at the cost of some of the flexibility provided by the advanced layout button.

Typical Use: Quick Creation of Maps based on summarized fields already in the report and to be displayed at the Report or existing Group level.

Cross-Tab

Description: This layout button only appears as an option when your current report is a Cross-Tab report.

Typical Use: Creation of a Map based on an existing Cross-Tab in the report.

OLAP

Description: This layout button only appears as an option when your current report is based on an OLAP data source.

Typical Use: Creation of a Map based on an existing OLAP grid in the report.

The Cross-Tab and OLAP layout buttons and their related map creation options are explored in Hours 14 and 20. The next section explores the detailed data options that the Advanced and Group Layout buttons enable.

graphics/alarmclock_icon.gif

If you attempt to create a geographic map based on a non-geographic field, the Map Expert will accept your request and then display a blank map when it cannot resolve the selected field values to geographic entities. Therefore, make sure to select a valid geographic field in the Geographic Field item of the Advanced layout section or the On Change Of field in the Group layout section.


Map Data

As you saw earlier, Figure 11.9 displays the Map Data section with the Group layout button selected. As described in Table 11.4, this layout option is designed to facilitate the quick creation of a map with a minimal amount of user interaction. To accomplish this rapid map creation, two pieces of information are requested through two drop-down boxes.

The first drop-down requests you to select the On Change Of field and the second the Show field. The On Change Of field is used to determine where the selected map will break the report data to be displayed (for example, Country, State, or Province). The Show field specifies the summary field to be displayed for each break of the data.

graphics/bookpencil_icon.gif

When leveraging the Rapid Map Creation functionality of the Group layout option, it is important to note that you are limited to map creation based on existing summary fields already created in your reports and inserted into existing group sections. For more flexible map creation, use the Advanced layout option described later.


Figure 11.10 displays the Map Data tab with the Advanced layout button selected. The additional options presented here enable greatly improved flexibility in the maps that can be created.

Figure 11.10. The Map Data tab with the Advanced layout button selected.

graphics/11fig10.jpg

The familiar On Change Of field should be recognizable in this new window although it is selected in a more flexible manner using the selection button in the interface. It is selected in exactly the same manner as the Geographic field selection in this interface by selecting any of the fields in the available fields listing and clicking on the selection button.

graphics/bookpencil_icon.gif

It is important to note that the Geographic and On Change Of fields are often the same, but can be set to be different. These are set to different field values when you want to present pie or bar charts on top of the involved map and for each of the different values in the selected Geographic field. An example of this would be presenting a pie chart for each country that highlights the different order amounts by company indicated in the On Change Of field.


After selecting your Geographic and On Change Of fields, a Map Values field must be selected to enable the map's creation. This selection specifies the summary field to be displayed for each break of the data and can come from any field (database, report, formula, and so on) that is listed in the available field's list. To select the Show Value fields, highlight the intended field and use the selection arrow buttons adjacent to the Map Value(s) list box.

graphics/bookpencil_icon.gif

As mentioned previously, you do not need to have had an existing summary on a report to summarize on it using the Advanced Mapping layout options. You can add any field to the Map Values list and then dynamically create a summary by clicking on the Set Summary Operation button. These dynamically created summaries will be automatically created and used by the map.


Continuing with the addition of a map to your sample report, follow these steps:

  1. Ensure that the Advanced layout button from the Layout section is selected.

  2. Select Country for the Geographic field. This indicates that the map will break for every different country. Leave the On Change Of field as Country when this gets populated automatically.

  3. Select Order Amount for the Show field and leave the default Sum as the summary operation. This indicates that the map will reflect this Sum of Orders for each country. Figure 11.10 should reflect the results of these steps in the Map Data tab. We will finish this map creation in the next two sections.

Map Type Tab

The Map Type tab allows you to select from the five different types of maps that are available for presentation. The five map types can be logically broken in to two distinct and separate categories maps that present a summarization based on one or two variables. The Map Type tab with these five map types is depicted in Figure 11.11. All five of the map types are also described in Table 11.5.

Figure 11.11. The Map Expert Map Type tab.

graphics/11fig11.jpg

The first three map types listed base their maps on the summary of the selected Show Value field and for each Geographic field the single fluctuating variable. The last two map types base their maps not only on the changing Geographic field, but also on a second fluctuating variable selected in the On Change Of field. Based on this second variable changing, either bar or pie charts are displayed on top of each of the involved Geographic fields.

Table 11.5 highlights the different map types, as well as a description and an example scenario for each.

Table 11.5. Map Types with Corresponding Sample Reporting Scenario

Map Type

Description

Example Scenario

Ranged

A Ranged map breaks data into specified ranges and displays geographic areas on the map in different colors.

A U.S.-based firm looking for a Sales Map that highlights the states that fall into a specified number of sales/revenue ranges.

Dot Density

A Dot Density map displays a dot for each occurrence of a specified item.

A growing wireless company in Eastern Canada wants to view the density and point location of new customers and map that to ongoing marketing campaigns.

Graduated

A Graduated map displays data that is linked to points rather than precise geographical areas.

An Irish beverage company wants a report on geographically dispersed distributors that proportionately highlights the amount of product being distributed.

Pie Chart

A Pie Chart map displays a pie chart over each geographic area. Each slice of the pie represents an individual summarization relative to the whole for the given geographic area.

An employee head-count report for the United States with a pie chart over each state that highlights the breakdown of the employees by status including salaried, hourly, or temporary.

Bar Chart

A Bar Chart map displays a bar chart over each geographic area. Each bar represents an individual summarizations relative to the other summarizations for the given geographic area.

A Marketing Media report for a U.S.-based company with a bar chart that highlights the amount of advertising and marketing dollars spent in different media in each region: TV, Internet, newspaper, magazine, and so on.

Each Map Type has a small number of associated options that can be set to customize the appearance of that particular map. You are encouraged to explore these options to help you find the maps most useful for your specific design goals.

Map Text Tab

After a map's type and data have been selected, select the Map Text tab. This tab on the Map Expert enables you to specify titles and legend formatting that the map will use when it is placed on the report.

To finish with the addition of a map to your sample report, follow these steps:

  1. On the Map Type tab, select the Ranged Map Type.

  2. On the Map Type tab, select Yellow and Blue as the respective low and high range colors.

  3. Click on the Map Text tab and give your map a title such as CR24 Hour 11 Map.

  4. Click OK, and you will find a geographic map added to your report that should look similar to Figure 11.12.

    Figure 11.12. A sample Customer Orders Report with a geographic map.

    graphics/11fig12.jpg



Sams Teach Yourself Crystal Reports 9 in 24 Hours
Sams Teach Yourself Crystal Reports 9 in 24 Hours
ISBN: B003D7JUVW
EAN: N/A
Year: 2005
Pages: 230

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net