Reflecting back on the sample reports used in Hours 5 and 7, you might find that there are opportunities for enhancement through the addition of meaningful charts. As reviewed in Hour 6 with groupings, it is quite easy to summarize the data we collect for a report into meaningful categories or groups. Hour 6 reviews some examples of grouping based on fields such as country and customer name. By hiding or suppressing the detail sections of reports, you learned how to bring the meaningful summarizations around these types of groups to the forefront. (Do you remember how to hide/suppress the detail sections? Hint: use the right-click menu.) To further bring this aggregated data to the business user's attention, you can create a chart on this grouped data using the Chart Expert. To open the Chart Expert, either click on the Chart icon located on the Insert Toolbar or select the Insert Chart option under the main Insert menu. Figure 11.1 displays the Chart Expert. Figure 11.1. Chart Expert dialog.After you've accessed the Chart Expert, several steps are required to actually complete the chart. These are reviewed in the next five sections. Chart Type TabThe Chart Expert consists of five different tabs. The initial display tab on the Chart Expert is the Chart Type tab, as seen in Figure 11.1. On this tab, the type of graphic or chart is selected. In Crystal Reports version 9, there are more than 40 different basic chart types to select from. In addition to the classic bar, line, pie, and area charts, new chart types in version 9 are listed in Table 11.1.
These charts have been added to further expand the visualization capabilities of Crystal Reports and enrich the presentation of your reports. Let's explore enhancing the Sample Customer Order Listing (Chap5.rpt) report from Hour 5 by adding a chart to it that highlights the Company's Top 10 Customers in the following steps:
Notice that the Axes and Options tabs appear when this check box is not clicked and disappear when it is selected. These tabs are discussed later in this section. Figure 11.2 displays the result of these six steps. We will continue creating this chart in the next four sections. Figure 11.2. The Chart Type tab on the Chart Selection dialog for the Sample Customer Order Listing report.Table 11.2 highlights some common reports, their contained graphics, and the benefit that is realized by using them.
Chart Data TabAfter a chart type has been selected in the Chart Type tab, click on the Chart Data tab. The Chart Data tab enables the selection of the specific data that the chart will be based on and the chart's location on the report. Figure 11.3 displays one view of the second tab of the Chart Expert. This view might vary depending on the different Chart Type options you have selected. The Chart Data tab is comprised of three different sections: Placement, Layout, and Data. These sections and corresponding options are discussed next. Figure 11.3. The Chart Data tab of the Chart Expert.Chart PlacementThe Chart Placement section is used to select the location of the chart on the report and, subsequently, the recurrence of the chart throughout the report. Using the drop-down box, the section of the report that the chart 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 radio buttons located beside the drop-down box, the header or footer of the selected report section can be selected. By making these selections, you also specify the chart's recurrence in the report because the chart will repeatedly appear in every section you have specified. For example, if a chart was placed on a report for each country group, a separate chart would appear on the report for each country in the report.) To continue with the addition of a bar chart to the sample report, you will need to
Chart LayoutThe Chart Layout section specifies the data selection options that the selected chart will provide to the report designer. The actual data is selected in the Chart Data section. Note that the options presented in that section are dependent on the specific Chart Layout button you have selected. Table 11.3 lists the different layout buttons and their typical use.
The Cross-Tab and OLAP layout buttons, and their related chart creation options, are explored in Hours 14, "Using Cross-Tabs for Summarized Reporting," and 20, "Reporting against OLAP Data," because they relate to very specific report types. The next section explores the detailed data options that the Advanced and Grouping Layouts buttons enable. Chart DataFigure 11.3 displays the Chart Data section with the Group layout button selected. As previously described, this layout option is designed to facilitate the quick creation of a chart with a minimal amount of effort. To accomplish this rapid chart creation, two pieces of information are requested through two drop-down boxes On Change Of (Grouping item) and Show (field to be shown in the chart) selections. The On Change Of field is used to determine where the selected chart will break the report data to be displayed. The Show field specifies the summary field to be displayed for each break of the data. Continuing with the addition of a bar chart to the sample report, you will need to follow these steps:
Figure 11.4 displays the Chart tab with the Advanced Layout button selected. The additional options presented here enable greatly improved flexibility in the charts that can be created. Figure 11.4. The Chart Data tab with the Advanced Layout button selected.The On Change Of and Show fields should be recognizable in this new window although they are selected in a much more flexible manner (see the right side of the Chart Data section beside the Available fields listing). The On Change Of field is now only one selection option (among three) in its own drop-down box. If you need to create a chart based on changing a specific field (as we did with the standard group layout), select the On Change Of charting option and then specify the field or fields to break the chart sections on by selecting any of the fields in the available fields listing. Unlike the drop-down box under the Group layout, you can select any of the available report fields in this interface, dynamically order them with the Order button or restrict their display on the report to a specified Top or Bottom N with the Top N button. You can also dynamically select multiple fields for the chart to break on, and none of the selected fields need already be on the report or have summary fields previously existing on the report for them. The remaining two options in the On Change Of drop-down box are For Each Record and For All Records. These two options enable charts to be created either against all data in a report or for each detailed record in a report.
When selecting any of these options, you subsequently need to select a Show Value(s) field to enable the chart'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 Show Value(s) list box.
Chart Text TabOnce a chart type and data have been specified, select the Chart Text tab. This tab on the Chart Expert enables the specification of titles and title formatting that the chart will use when it is placed on the report. Figure 11.5 displays the Chart Text tab of the Chart Expert. Figure 11.5. The Chart Text tab of the Chart Expert.Continuing with the bar chart addition to the sample report, follow these steps:
Chart Axes TabThe fourth tab in the chart expert, the Chart Axes tab, only appears if the Automatically Select Chart Options check box has been de-selected on the Chart Type tab. It can then be selected by clicking on it. The Axes Tab enables you to customize chart gridlines, data value scales, data value ranges, and data value divisions. Figure 11.6 displays the Chart Axes tab of the Chart Expert for a bar chart. Figure 11.6. The Chart Axes tab of the Chart Expert.
Continuing with the addition of a bar chart to the sample report, try the following step: Select the Major Gridlines check box for the data axis. This will facilitate the reading of the bar charts. We will finish off this bar chart creation in the next section.
Chart Options TabThe Chart Options tab in the Chart Expert only appears if the Automatically Select Chart Options check box has been de-selected on the Chart Type tab. The Chart Options tab enables you to customize chart coloring, data-point labeling, legend placement, legend format options, and several other chart type specific formatting options. Figure 11.7 displays the Chart Options tab of the Chart Expert for a bar chart. Figure 11.7. The Chart Options tab of the Chart Expert.To complete the last customizations on the bar chart being added to your working sample report, follow these steps:
If you find your chart is slightly different in appearance or imperfect, that is okay. You have plenty of powerful fine-tuning tools at your disposal, and they will be partially explored at the end of this hour. |