One approach is the "3 formula" method. You set up the initialization formula in each header, with the "WhilePrintingRecords" evaluation time directive. This approach was the only one available for executing current totals in the “good days” before RunningTotal objects were available.
For example:
In the group header: - have the formula @InitiliseRT
WhilePrintingRecords; StringVar ConcatenatedID; If Not InRepeatedGroupHeader Then ConcatenatedID := "";
In the "Details" section: - have the formula @UpdateRT
WhilePrintingRecords; StringVar ConcatenatedID := ConcatenatedID + id1;
Finally, in the Footer group you can see the result: - Formula @ShowRT
WhilePrintingRecords; StringVar ConcatenatedID;
This should give you the final line "a1b2c3d4e5".
If you need, you can add additional formulas for additional groups, one variable for each group (for example, ConcatenatedIDGroup1, ConcatenatedIDGroup2). The key is to always get the name on the right between the groups and initialize the variable in the group header.
There are restrictions on the use of these formulas. The built-in summary functions (Sum, Max, Count, ...) or RunningTotals cannot use them, and you cannot group them.
Anthony k
source share