Crystal Reports  

Creating Running Totals in a List

Running totals are totals that are displayed generally on a record-by-record basis. They total all records (in the report, in the group, and so on) up to and including the current record. The most basic form of a running total is a single running total maintained throughout a list.

You create running total fields with the Running Total Expert, which allows you to select the field to summarize, the summary operation to use, a condition upon which to base the evaluation, and a condition upon which to reset the evaluation.

Note   A running total field can be used on database fields and first-pass formulas, but cannot be used on second-pass formulas or formulas that reference other second-pass formulas. See Report Processing Model.

To create a running total in a list

  1. In the Field Explorer, right-click Running Total Fields and click New.
  2. In the Create Running Total Field dialog box, enter a name for the running total object in the Running Total Name field.
  3. In the Available Tables and Fields area, select the field you want to summarize.
  4. Click the first arrow button to add the field to the Field to summarize box.
  5. In the Evaluate section of the dialog box, choose when you want the running total to execute.

    For a running total in a list, click "On change of field."

  6. In the Available Tables and Fields area, select your "on change of" field.
  7. Click the second arrow button to add the field to the On change of field box.
  8. In the Reset section of the dialog box, click Never.

    This gives you a running total that never resets; that is, the running total continues throughout the report and provides a grand total.

  9. Click OK to save the running total field.

    Your running total now appears in the Field Explorer, under Running Total Fields.

  10. Drag your running total field onto the Details section of the report.
    Note   A running total that is placed on a report is indicated by the # prefix (for instance, #Total1).

See Also

Placement of Running Total Fields | Creating Running Totals