Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

9.06 Tutorial 9-1 Building the Customer Sales Report

Tutorial 9-1. Building the Customer Sales Report

Before we practice using subreports, let’s first build the main report. This is going to be the foundation for all the tutorials throughout this chapter. It is a sales report which shows the detail sales record for each customer. This report will serve as the basis for the rest of the tutorials in this chapter.

  1. First, create a new report using the Standard Report Wizard and select the Xtreme.mdb database.
  2. Select the tables Customer and Orders. Click the Next button twice to get to the Fields tab.
  3. Select the following fields from the Customer table: Customer ID, Customer Name.
  4. Select the following fields from the Orders table: Order Num, Order Date, Ship Date, Order Amount. Click the Next button.
  5. For the groups, select the field Customers.Customer ID. Click the Next button.
  6. For the Summaries tab, there will be three summaries already selected (Crystal Reports automatically summarizes all numeric fields), but we only want one of them. Keep the Order Amount summary and delete the summaries for Customer ID and Order ID.
  7. Click the Next button four times to skip forward to the template tab. Select the template Block (Blue).
  8. Click the Finish button to save your changes and preview the report. It should look similar to the following:


  1. This report is a good first attempt, but let’s clean it up a bit before we move on to adding the subreport. Click on the Design tab to start making changes.
  2. Click on the Business Objects logo in the top right corner and delete it.
  3. Double-click on the Report Description textbox. Replace the text with “Customer Sales Report”.
  4. In the Details section, click on the Customer ID field and delete it. It’s already displayed in the group header so we don’t need to repeat it on every row.
  5. We don’t want the customer name repeated on every row either, so we’ll put it in the group header. Enlarge Group Header #1b and move the Customer Name field from the Details section into the group header.
  6. Format the Order ID so that it doesn’t have commas in it. Right-click on it and select Format Field. On the Number tab, set the Style to be -1123.
  7. For both of the date fields, right-click on them and select Format Field. On the Number tab, set the date format to ‘03/01/1999′.
  8. Save the report as Customer Sales.rpt and preview it. It should look similar to the following: