Adding/Removing Groups

A report group, just like an SQL GROUP BY clause, allows you to bundle together rows with the same group by field values. Because report groups are based on fields, make sure you have the data source and fields for the report defined before you add a new group.

To add a new group or remove an existing group, select Design > Group from the main menu. The Add/Remove Report Group dialog box appears. To add a new group, choose the Add New Group radio button, enter the Group Name: and choose the Group Field. To remove an existing group, choose the Remove Existing Group radio button, then choose the group to remove from the list of Existing Groups. In any case, click on the OK button underneath this box.

After adding a new group, two new sections appear on the design window. If your group name is mygroup, the two sections will be mygroup Header for the group header and mygroup Footer for the footer. You can drag and drop the field on which the group is based on the group header section. You can also use the group footer section to include summary calculations that you want Instant Report to perform for each group. To include summary calculations, drag and drop a Text-Field report element and configure its expression property. For example, for a report field named myfield and a group named mygroup, the following summary calculations become automatically available to use in your text expressions and conditional expression:

  1. myfield_COUNT_mygroup: count of myfield
  2. myfield_MIN_mygroup: minumum of myfield
  3. myfield_MAX_mygroup: maximum of myfield
And if the field named myfield is a number, additional calculations based on numbers become available:
  1. myfield_SUM_mygroup: sum of myfield
  2. myfield_AVG_mygroup: average of myfield
  3. myfield_STDDEVIATION_mygroup: standard deviation of myfield
  4. myfield_VARIANCE_mygroup: variance of myfield

It is recommended that you make use of formatting fonts, background and foreground colors including lines and rectangles for group headers and footers to give your report a professional appearance.