Tutorial 12-1. Creating a Group Chart in the Page Header
Let’s take a report that uses groups and print a bar chart in the page header that summarizes each group’s value. This gives the user a high-level overview of how each group compares to the other groups. The Crystal Reports sample report, Summary Group.rpt, groups sales data by country and shows sub-totals of last year’s sales. We will add a chart in the header that shows each country and chart’s last year’s sales.
- Open the Crystal Reports sample report, Summary Group.rpt.
- Select the menu options File > Save As and enter the filename, Summary Group Chart.rpt.
- In Design mode, right-click on the chart and select the option Insert Chart. The chart’s outline appears and it is attached to the mouse.
- Position the chart outline in the Page Header section and click the mouse button to place the chart. This also changes the height of the Page Header so that the chart can fit on it.
- Right-click on the chart and select the menu option Chart Expert. This opens the Chart Expert dialog box.
- On the Type tab, it should have defaulted to the Bar Chart type. If not, select it now.
- Click on the Data tab. The On Change Of option selects which data points are plotted on the chart. Crystal Reports has already selected Customer.Country by default. Leave it at this field.
- The Show option selects which values are plotted within the chart. Crystal Reports selected the field Count Of Customer Name. We want to show last year’s sales instead. Click on the drop-down list and select the field Sum of Customer.Last Year’s Sales.
- Click the Ok button to save the chart options.
- Click on the Preview tab and you should see the chart displayed in the report header. It should look similar to this: