Using the Chart Expert

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.

graphics/11fig01.jpg

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 Tab

The 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.

Table 11.1. New Chart Types in Crystal Reports Version 9

New Chart Type

Chart Type Description

Gantt Chart

A Gantt chart is a project-focused horizontal bar chart used to provide a graphical illustration of a project schedule. The horizontal axis shows a time span, whereas the vertical axis lists project tasks or events. Horizontal bars on the chart represent event sequences and time spans for each task on the vertical axis.

Gauge(s)

A Gauge chart presents data using a speedometer visual and is often used to measure percentage completed against target type metrics.

Numeric Axis

A Numeric Axis chart is a bar, line, or area chart that uses a numeric field or a date/time field as its On change Of field. Numeric Axis charts provide a way of creating a true numeric X-axis or a true date/time X-axis.

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:

  1. Either open the Sample Order Listing (Chap5.rpt) Report created in Hour 5 in the Crystal Reports Designer or quickly re-create the basics of it by selecting the Customer Name, Order ID, and Order Amount fields from the Xtreme Sample Database, Group by Customer Name, and Summarize Order Amount by the Customer Name group.

  2. To restrict the data to the Top 10 Customers, access the Group Sort Expert from the Report menu option. Select a Top 10 Sort based on the Sum of Order Amount and do not include Others.

  3. Insert a Chart onto the report using the Chart icon or the Chart option from the Insert menu.

  4. Select a bar chart as the main chart type in the list box by clicking on it. Also, click on the Horizontal radio button that is present at the bottom of the dialog box.

  5. Select the two-dimensional side-by-side bar chart sub-chart type (top left option) by clicking on the associated graphical icon to the right of the main list box area.

    The last option to set in the Chart Type tab is whether you want Crystal Reports to automatically use the default legend, data-point, color, and axes options for your chart. The automatic option is enabled by default, but it can be turned off by clicking on the check box near the top of the dialog box.

  6. At this point, de-select the automatic check box.

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.

graphics/11fig02.jpg

Table 11.2 highlights some common reports, their contained graphics, and the benefit that is realized by using them.

Table 11.2. Common Reports with Corresponding Chart Types

Report

Chart Type

Report and Chart Benefit

Company Sales Report

Pie or Donut Chart

Highlights the regional breakdown of product sales across continents or countries facilitating analysis of revenue contribution.

Product Profitability Report

Horizontal or Vertical Bar Chart

Highlights the profit margin per product that a company sells, facilitating comparative analysis of profitability.

Actual versus Target Report

Gauges

Highlights the progress being made against specified targets through the use of a speedometer visual. When used across projects or divisions, it isrelatively easy to compare how they are performing against certain initiatives.

Chart Data Tab

After 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.

graphics/11fig03.jpg

Chart Placement

The 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

  1. Select the Once Per Report option in the Place Chart drop-down box. This should be the only option and already selected by default.

  2. Select the Header button to specify placement in the report header.

graphics/bookpencil_icon.gif

When you select the Group Layout button (second button from top in Layout section see the next section for more details), you are presented with the options in the Chart Placement drop-down box based on what groups and summaries are already created in your report. Alternatively, if you select the Advanced Grouping Layout button, you will not be as restricted and can dynamically create summaries across groups not yet in your report.


Chart Layout

The 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.

Table 11.3. Layout Buttons and Typical Use

Layout Button

Description and Typical Use

Advanced

Description: This layout button provides complete flexibility in chart creation through the provision of controlling all charting options.

Typical Use: Creation of charts based on summaries not already created in the report or charts to be created for every detail record.

Grouping

Description: Although this button is presented second, it is the default layout. This layout limits the Chart 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 chart at the cost of some of the flexibility provided by the Advanced layout button.

Typical Use: Quick Creation of charts 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 chart based on an existing Cross-Tab in the report.

OLAP

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

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

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 Data

Figure 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:

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

  2. Select Customer Name in the On Change Of field. This indicates that the chart will break for every different customer.

  3. Select Sum of Order Amount for the Show field. This indicates that the chart will reflect this Sum for each customer. Figure 11.3 should reflect the results of these steps in the Chart Data tab. We will continue this chart creation in the next section.

graphics/bookpencil_icon.gif

When leveraging the Rapid Chart Creation functionality of the Group layout option, it's important to note that you will be limited to chart creation based on existing summary fields already created in your reports and inserted into existing group sections. For more flexible chart creation, you can use the Advanced layout option described later.


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.

graphics/11fig04.jpg

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.

graphics/lightbulb_icon.gif

When using the For All Records charting option, you can select the field to be displayed for each break by selecting a field from the available fields list into the list box beneath the For All Records drop-down box.


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.

graphics/bookpencil_icon.gif

As mentioned previously, you do not need to have an existing summary on your report to use it for a graph in the Advanced Charting layout options. You can add any field to the Show Value(s) 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 chart. This is one of the unique features of Crystal Reports and provides report designers with additional charting flexibility.


Chart Text Tab

Once 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.

graphics/11fig05.jpg

Continuing with the bar chart addition to the sample report, follow these steps:

  1. De-select the Autotext check box beside the Title entry. The text box for the title should now become available for you to modify. Change the title to CR24 Hour 11 Test Chart.

  2. De-select the Autotext check box beside the Data Title entry. Change the Data Title entry to Order Amounts. We will continue with this chart's creation in the next section.

Chart Axes Tab

The 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.

graphics/11fig06.jpg

graphics/bookpencil_icon.gif

This tab will only appear when the selected chart type has axes within it (for example, bar chart or line chart) and does not display for other chart types (for example, pie chart).


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.

graphics/lightbulb_icon.gif

By manually setting both the Min/Max Data Ranges and the Number of Data Value Divisions, you will be able to set your data axis gridline display labels in a customized manner.


Chart Options Tab

The 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.

graphics/11fig07.jpg

To complete the last customizations on the bar chart being added to your working sample report, follow these steps:

  1. Select the Show Value button in the Data Points section.

  2. Select the 1K format from the formatting drop-down box.

  3. Click the OK button, and you will find a bar chart representing the summarized sales of this company's top 10 customers presented. Figure 11.8 provides a snapshot of this report.

    Figure 11.8. A Sample Customer Orders report with a bar chart.

    graphics/11fig08.jpg

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.



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