Skip to the content.

Crystal Reports uses a three-pass reporting method to generate reports. The sections below describe what happens during each step of this process.

A pass is a process that Crystal Reports uses each time the data is read or manipulated. Depending on the complexity of the report, Crystal Reports may make 1, 2, or 3 passes over the data. This allows for complex reporting and formula manipulation.

Pre-pass 1

When previewing a report, the first elements to be evaluated are “constant” formulas. Constant formulas are those that have a constant value for the entire report — they do not change from record to record. For example, 100 * 30 would be a constant formula. Constant formulas are evaluated at the beginning of the print generation process and are never evaluated again. This process is known as BeforeReadingRecords. If you place a constant formula field (i.e. 100 * 30) in the Details section, the result is 3000 for each record displayed.

Pass 1

After the BeforeReadingRecords process has taken place, Crystal Reports begins reading the database records. During the record reading process, the following occurs:

Pre-pass 2

During Pre-pass 2, Crystal Reports orders the groups in the report for Top/Bottom N or Hierarchical Grouping. The records are not read in this process; instead Crystal Reports only looks at group instances from Pass 1, and takes the Top N as appropriate, or orders the groups based on the Hierarchical Grouping settings specified.

Pass 2

Crystal Reports enters the second pass through the data to format pages. The pages are formatted on demand — Crystal Reports will not format a page until it is requested by the user, or until it is required for the total page count in Pass 3.

During page formatting, Crystal Reports does the following:

Note: Subtotals, grand totals, and summaries may appear to be incorrect if the report has a group selection formula. This occurs because the grand totals and summaries are calculated during Pass 1, but the group selection formula filters the data again in Pass 2. Running total fields can be used instead of summaries to total data in reports with a group selection formula.

Pass 3

In the third and final pass, the total page count is determined. This applies to reports that use the total page count, or the Page N of M special fields.

Report-processing summary

Pre-pass 1   Evaluate constant formulas (BeforeReadingRecords)
    |
Pass 1       Read records -> recurring formulas (WhileReadingRecords)
             -> local record selection -> sort, group, total
             -> Cross-Tabs/charts/maps on database fields -> save data
    |
Pre-pass 2   Order groups for Top/Bottom N and hierarchical grouping
    |
Pass 2       Format pages on demand: group selection, running totals,
             PrintTime formulas (WhilePrintingRecords), remaining
             Cross-Tabs/charts/maps, OLAP grids, subreports
    |
Pass 3       Determine total page count (Page N of M)

Note: Although subreports appear in Pass 2, you can use on-demand subreports to ensure that your main report remains a single-pass report. With on-demand subreports, Crystal Reports must still make a second pass through the data; however, that second pass does not begin until you drill down on the subreport. Consequently, you can increase the performance of reports that contain subreports by using on-demand subreports.