Sort, group and summarize a grid
In this task you change how the table of a report is arranged. You sort the rows by a column, group them by one or more columns, and show a total for each group and for the whole table. The report is not run again, so the figures do not change: only their arrangement does.
Before you begin
- Run a report that shows a table and wait until the result appears. See Run a report and read the result.
- Click inside the table. The Tools tab appears on the ribbon.
- A report decides whether its table can be sorted, grouped or summarized. If a command in this task is missing or disabled, the report does not allow it.
Steps
Sort the rows
- Click the header of the column you want to sort by. The rows follow the order of that column.
- To choose the direction, right-click a cell in the column and choose Sort Ascending or Sort Descending.
- To remove the sort, right-click a cell in a sorted column and choose Clear Sorting. The command works when the column of the cell is sorted, and removes the sort of all columns.
In a report that shows a running balance, the program calculates the balance again after each sort, so it follows the new order of the rows.
Group the rows
- Right-click a cell in the column you want to group by and choose Group by This Column. Or drag the header of the column to the group panel above the table. If the panel is not visible, click Tools > Grouping > Group Panel.
- The table now shows one row for each value of the column. The row has an arrow: click the arrow to open or close the group.
- To group by a second column, repeat step 1 with another column. The new groups appear inside the first groups.
- To open or close all groups at once, right-click a group row and choose Expand All or Collapse All.
- If you grouped by a date column, click Tools > Grouping > Group Interval to choose how the dates are divided: Date, Year, Month or Range.
- To remove the grouping, click Tools > Grouping > Ungroup. To remove only one column, click the arrow of the button and choose its name.

Show summaries
- Click Tools > Data > Manage Summaries.
- To show a value in each group row, open the Groups tab. Select a column in the list of columns, then tick the summaries you want for it, for example Sum and Maximum.
- To show a total at the end of the table, open the Totals tab and tick the summaries in the same way. Tick Show Total Summary if it is not ticked.
- To change the order of the summaries of a column, select one and click the up or down arrow.
- Click Ok.
Some reports already include summaries. In the Journal, Sum is ticked for Debit and Credit on both tabs, and the two columns are in bold in the list. The group rows show their sums as soon as you group, as in the images on this page, where the Journal is grouped by Entry origin.
A summary type is disabled when it does not suit the column: Count and First work for every column, and the other types work for numeric columns only. The window is explained in Report grid tools.
You can also right-click the total of a column and tick or clear a summary directly. Tree tables don't have this menu: use Manage Summaries.
Order the groups by a summary
Use this to put, for example, the group with the highest total first.
- Group the table and show at least one group summary, as above.
- Click Tools > Grouping > Sort by Summary.
- In Grouping Field, choose the grouped column. In Summary Field, choose the column whose summary decides the order. In Sort Order, choose Descending to put the highest first.
- Click Ok.
To remove one rule, open the window again, set Summary Field to (None) and click Ok. With no rule yet, the window starts with the first grouped column, (None) and Ascending. To remove all rules, click Clear All: the program removes them at once, even if you then click Cancel.

Summarize only some rows
- Select the rows: click a row, or hold Ctrl and click several rows, or use Tools > Selection > Select.
- Click Tools > Data > Summarize Selection.
The group summaries and the totals now count only the selected rows. Click Summarize Selection again to return to all rows. While it is on, Manage Summaries is disabled.
Result
The table shows the order, groups and summaries you chose. For example, if a group has three rows with the values 100, 250 and 50, and you ticked Sum and Maximum for that column in the Groups tab, the group row shows 400 and 250. In the images of this page the Journal is grouped by Entry origin. The group RCH: 1 shows 20,000.00 in Debit and in Credit. After Sort by Summary on Debit with Descending, it comes right after the first group, whose origin is empty and which shows 259,605.00. The program marks the report as changed. When you close it, it may ask whether to save the workspace. See Closing the viewer.
If something goes wrong
| Problem | Why it happens | What to do |
|---|---|---|
| The Grouping group is missing on the Tools tab. | The report does not allow grouping for this table. | Use another report or ask the person who prepared the report. |
| Sort by Summary is disabled. | The table is not grouped, or no group summary is ticked. | Group the table and tick a summary in the Groups tab of Manage Summaries. |
| The Data group is missing. | The report does not allow summaries for this table. | The group summaries and the totals are not available in this report. |
| A summary type in Manage Summaries is disabled. | The column is not numeric, or the report defines that summary itself. | Choose Count or First, or another column. A summary that shows "(Custom)" cannot be changed. Clear All also unticks these summaries and you can't tick them again: click Cancel if you cleared them by mistake. |
| The total at the end of the table does not show. | Show Total Summary is off, or no total is ticked. | Open Manage Summaries, tick a total in the Totals tab and tick Show Total Summary. |
Related
- Report grid tools: every button and window used here
- Report viewer
- Search inside a report grid
- Add a calculated field
This page applies to alameen ERP 10, version 10.1.79.764.