I have place this formula in Formula Fields:
whileprintingrecords;
shared numbervar jems;
shared numbervar rej;
shared numbervar rework;
shared numbervar fg;
if Not(IsNull({V_INV_LOC.INV_LOC})) or Instr({V_INV_LOC.INV_LOC},"JEMS") > 0 then
jems := {V_INV_LOC.ORD_QTY}
else if Not(IsNull({V_INV_LOC.INV_LOC})) or Instr({V_INV_LOC.INV_LOC},"REJ") > 0 then
rej := {V_INV_LOC.QTY_OH}
else if Not(IsNull({V_INV_LOC.INV_LOC})) or Instr({V_INV_LOC.INV_LOC},"FG") > 0 then
rej := {V_INV_LOC.QTY_OH}
else if Not(IsNull({V_INV_LOC.INV_LOC})) or Instr({V_INV_LOC.INV_LOC},"REWORK") > 0 then
rework := {V_INV_LOC.QTY_OH};
Then in the Formula Fields:
whileprintingrecords;
shared numbervar reject;
which I called it in Reject
then on the report in the detail I have @reject to print off the values in that field.