BackPrevious Page Next PageNext

Managing the Aggregate Fields in a Crosstab

Inserting an aggregate field by dragging and dropping

Switching the aggregate function of an aggregate field

Removing an aggregate field

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

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 Data panel to the crosstab to add more aggregate fields to summarize data in the crosstab.

  1. Click View > Data to display the Data panel if it is not displayed.
  2. In the Data 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 mouse button. The Insert Aggregation dialog appears.

    Insert Aggrefation 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. However, whether the label you specify would be displayed depends on if you have added any labels to label the columns/rows/summaries in the crosstab while creating it with the report wizard. If no label is defined in the report wizard, the label you add in the Insert Aggregation dialog will be ignored.
  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.

BackPrevious Page Next PageNext