Organize data in a template

A report template does not contain data, but it can define how the data in a resultant report will be initially organized. Configure grouping, sorting, and summary statistics to ensure these prompts are prepopulated when the template is used to create a report.

Similar to adding fields to a template, you must define how the template locates the corresponding field. There are three ways to define how a template will recognize a field:

  • Use element draw order for field index—Populate the fields using the database order. For example, the first field in the template will be associated with the first field in the table.
    Note:

    • If using this method for grouping, only one instance is supported.
    • This method is not supported when adding summary statistics.

  • Specify field index—Use the database index to specify the field to be used. You must provide a corresponding Field index and Field filter. The index is zero based. The following table describes how to use combinations of the index and filter to define the field:

    Filter typeDescription

    All

    All fields are included in the field. This is the default.

    Using this filter type and a field index value of 5 means use the sixth field in the table.

    Text

    Only text fields are indexed.

    Using this filter type and a field index value of 3 means use the fourth text field.

    Numeric

    Only numeric fields are indexed.

    Using this filter type and a field index value of 4 means use the fifth numeric field.

    Date

    Only date fields are indexed.

    Using this filter type and a field index value of 2 means use the third date field.

  • Name—Manually type the name of the field the template will use when creating a report.

Add grouping to a template from the ribbon

By default, report templates do not include grouping, however, one or more groups can be added. Add a single group from the ribbon using the following steps:

  1. On the Insert tab, in the Data group, click the Group button Grouping to open the Insert Group dialog box.
  2. Define how the template will recognize the field.
  3. Choose the direction the group will be sorted.
  4. Click OK.

A new group header and footer are added to the report section.

Configure data organization in the report properties

Once the template has been created, the sorting and grouping settings can be changed using the following steps:

  1. In the Contents pane, right-click the report section name and click Properties to open the Report Properties dialog box.
  2. Click the Sorting tab.
  3. Choose the direction existing groups will be sorted.
  4. Click the Add Sort Field button to open the Insert Sort Field dialog box.

    Alternatively, click the Clear button to remove all sorting or click the Remove button Remove to remove each sorting level individually.

  5. Define how the template will recognize the field.
  6. Use the Sort drop-down menu to choose how the field will be sorted.
  7. Click OK to close the dialog box.

    The new sorting appears on the Report Properties dialog box.

  8. Click OK to apply this change.

Add summary statistics to a template

You can add statistics to a Group Footer or Report Footer using the following steps:

  1. Click a Group Footer or Report Footer subsection in the Contents pane or directly in the report view to activate the subsection.
  2. On the Insert tab, in the Data group, click the Statistics button to open the Insert Statistic window.

    The Statistics gallery lists the available choices.

  3. Choose the statistic type you want to calculate.
  4. Define how the template will recognize the field.
  5. Optionally, check the Add associated labels to statistic. option to include a preceding label.
  6. Click OK and click within the subsection to place the element box.

    The statistic element is added and can be resized or repositioned.

Related topics