How To…Detect the Last Group Detail

Question

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

Solution

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.

Download: LastDetailInGroup.zip

Sample Delphi code: