Defining summary statistics

When you generate a crosstab, the columns and rows are automatically totaled for you. You can include other statistical summaries in crosstabs as well. To do that, you place computed fields in the workspace.

StepsTo define a column summary:

  1. Enlarge the summary band to make room for the summaries.

  2. Select Computed Field from the Visual Studio Toolbox.

  3. Click the cell in the summary band where you want the summary to display.

    The Modify Expression dialog box displays.

  4. Define the computed field.

    For example, if you want the average value for a column, specify avg(units for all), where units is the column providing the values in the crosstab.

For example, this is a crosstab that has been enhanced to show averages and maximum values for each column. This is the Design view:

The sample is titled "This report summarizes the unit sales of printers in each quarter." Header one includes Sum of units and Quarter. Header two includes Product. @ quarter, and Grand Total. The Detail line includes product, units, and the expression cross tab sum ( one ). The Summary has three lines. The first has columns showing  "Grand Total," and the truncated expressions for sum ( unit, and sum ( grand _ sum. Line two of the summary shows columns for Average and the expression a v g ( units. The last line has Maximum and max ( unit. The Footer at the bottom is empty.

This is the crosstab at runtime:

The sample displays the title "This report summarizes the unit sales of printers in each quarter." The sample has  headings for Sum of Units and Quarter. Below them is a column heading for Product, a column heading for each quarter, and a column heading for grand total. Data is shown for three sample products, Cosmic, Galactic, and Stellar. At the bottom of the crosstab are three lines of data. First is a grand total of all three products sold for each quarter. Next is the Average number of units sold per quarter. Last is the Maximum number of any one product sold for that quarter. .

StepsTo define a row summary:

  1. Select Computed Field from the Visual Studio Toolbox.

  2. Click the empty cell to the right of the last column in the detail band.

    The Modify Expression dialog box displays.

  3. Define the computed field. You should use one of the crosstab functions, described next.