You can do this with three formulas:
A. In the 'Group Header' place the @reset formula:
WhilePrintingRecords;
StringVar result := "";
NumberVar flag := 1
B. In the 'Detail' section place the @createResult formula
WhilePrintingRecords;
StringVar fld := {table.field};
StringVar result;
NumberVar flag;
if flagt = 1 then
(
flag := 2;
result := fld
)
else
result := result + ", " + fld
// You'll want to suppress the detail section
C. In the 'Group Footer' section, place the @Display formula:
WhilePrintingRecords;
StringVar result;
result