I haven't tried this, but you might be able to do something like this:
1. Group your data by Result.
2. Create a formula that looks something like this:
StringVar samples;
NumberVar sampleNum;
BooleanVar isRange;
//Initialize the variables at the beginning and on change of status.
if PreviousIsNull({MyTable.Result}) or {MyTable.Result} <> previous{MyTable.Result} then
(
samples := 'Samples: ';
sampleNum := 0;
isRange := false;
)
if sampleNum > 0 and {MyTable.SampleNum} > sampleNum + 1
if isRange then
samples := samples + '-' + ToText(sampleNum, 0, '') + ',' + ToText({myTable.SampleNum}, 0, '')
else
samples := samples + '-' + ToText({MyTable.SampleNum}, 0, '');
else if sampleNum = 0 then
samples := samples + ToText({MyTable.SampleNum}, 0, '');
sampleNum := {MyTable.SampleNum};
samples
Like I said, I haven't tested this yet, but hopefully it will get you started.
-Dell