How To…Detect the Last Group Detail


“How do I detect the last detail printed in a group?”


Create a separate dataset that counts the values present for each group based on the grouping field.  You can then use this information to determine when the detail band has reached its final record for that group and you can make alterations to that band’s components as needed.


Sample Delphi code: