Using Delphi TTable components with Oleander you should set up the grouping structure using the Mastersource and Masterfield properties. The group identifiers in the document have then to be named like the datasource that controls the group. An advantage of TTable over TQuery is, that you have all fields available to print without declaring each one in the result set. But with complex documents using TTable leads to lots of Tables and different names you have to use.
TQuery components are very well suited to be printed with Oleander, as they combine all necessary fields in one result set. This leads to simple identifier naming, as only one datasource is used. The grouping information differs from the TTable usage, though. In this case do not specifiy a group controlling datasource in the identifier name, but a group controlling field. Every time the field value changes, a group change will happen. This group controlling field needs not to be among the printable fields, but has to be in the result set.