### Managing the aggregate fields in a crosstab

The following fields can be used as aggregate fields to summarize data in crosstabs:

- Query fields, formulas or crosstab formulas for page reports
- Detail fields, aggregation fields, or dynamic formulas/aggregations for web reports or library components

JReport provides you with the following methods to manage the aggregate fields in crosstabs easily:

#### Inserting an aggregate field by dragging and dropping

When a crosstab is created, you can further drag and drop fields from the Resource View panel to the crosstab to add more aggregate fields to summarize data in the crosstab.

1. Click View > Resource View on the menu bar to display the Resource View panel if it is not displayed.
2. In the Resource View panel, select a field that can be used as an aggregate field and drag it above or under the desired subtotal or grand total cell until a blue line appears, then release the cursor. The Insert Aggregation dialog appears. See the dialog.

3. From the Aggregate Function drop-down list, specify the function to summarize the selected field.

   If the selected field has been predefined with an aggregate function, you cannot edit the function any more, and the drop-down list is changed to the Aggregation text box with the name of the field displayed in it.

4. In the Label text field, specify a display name for the aggregate field if needed, which will label the newly created summaries.
5. Click OK and a new aggregate cell is added to the crosstab.

When you have added an aggregate field using this way, in the Display screen of the Crosstab Wizard, you can find the new aggregate field in the Summaries box along with the specified function and display name.

#### Switching the aggregate function of an aggregate field

For the aggregate field that has no predefined aggregate function in a crosstab, you can switch the function it uses at anytime. To do this:

1. Right-click the aggregate field and select Switch Aggregate Function from the shortcut menu.
2. Choose a new function from the submenu.
3. View the crosstab and the values are recalculated based on the new function.

#### Removing an aggregate field

To remove an aggregate field from a crosstab, right-click the field and click Remove Aggregation on the shortcut menu.