Get a list of groups in @
Then you can use that in the table header like such;
This was done on the fly so may not work but give the idea.
@{REPORT ORDER DETAILS:O.ItemGroup:{0}:,}
[$1 Items Sold:5, 2, 2,1]
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum:(ODI=True) and O.ItemGroup=$1}