Here's a solution that should work for up to 108 employees (up to 762 characters, with 7 digits and a space for each employee ID). This is an adaptation of a solution by Naith for segmenting string length so that a combination of fields each no greater than the 254 limit can together exceed that limit.
You should discard my earlier formulas so that they don't confound the following ones. Create the following formulas:
{@dupe} to be placed in the details section:
whileprintingrecords;
stringvar id1;
stringvar id2;
stringvar id3;
if instr(trim(id3),totext({table.emplID},0,""

) = 0 then
if instr(trim(id2),totext({table.emplID},0,""

) = 0 then
if trim(id2) = "" then
if length(id3) + length(totext({table.emplID},0,""

+" "

> 254
then id2 := id2 + totext({table.emplID},0,""

+ " " else
id3 := id3 + totext({table.emplID},0,""

+ " "
else
if instr(trim(id1),totext({table.emplID},0,""

) = 0 then
if trim(id1) = "" then
if length(id2) + length(totext({table.emplID},0,""

+" "

> 254
then id1 := id1 + totext({table.emplID},0,""

+ " " else
id2 := id2 + totext({table.emplID},0,""

+ " "
else
if length(id1) + length(totext({table.emplID},0,""

+" "

> 254
then id1 := id1
else id1 := id1 + totext({table.emplID},0,""

+ " "
else id1 := id1
else id2 := id2
else id3 := id3;
{@amt} to be placed in the details section:
whileprintingrecords;
numbervar amt ;
if onfirstrecord then amt := {table.amount} else
if not onfirstrecord and
((len(trim({@id3})) = 7 and
{@id3} = totext({table.emplID},0,""

) or
(len(trim({@id2})) = 7 and
{@id2} = totext({table.emplID},0,""

) or
(len(trim({@id1})) = 7 and
{@id1} = totext({table.emplID},0,""

))
then amt := 0 else
if not onfirstrecord and
(len(trim({@id3})) > 7 and
instr(trim({@id3}),totext({table.emplID},0,""

) > 0) or
(len(trim({@id2})) > 7 and
instr(trim({@id2}),totext({table.emplID},0,""

) > 0) or
(len(trim({@id1})) > 7 and
instr(trim({@id1}),totext({table.emplID},0,""

) > 0) then
amt := 0 else amt := {table.amount};
{@id1}--this does not have to be placed on the report canvas:
whileprintingrecords;
stringvar id1;
{@id2}--this does not have to be placed on the report canvas:
whileprintingrecords;
stringvar id2;
{@id3}--this does not have to be placed on the report canvas:
whileprintingrecords;
stringvar id3;
{@sumamt) to be placed in the details section:
whileprintingrecords;
numbervar sumamt := sumamt + {@amt};
{@displaysumamt}--this is the grand total to be placed in the report footer:
whileprintingrecords;
numbervar sumamt;
The logic of the formulas could be extended for more employees by added new id segments (id4, id5, id6, etc.). Note that formulas ({@id1},{@id2},{@id3}) are used in {@amt} in order to carry the variable amounts forward, since {@dupe} will only carry forward values that fall within the 254-character segment that is current at the time.
-LB