it looks ok, did you place the iCount formula on the report...I have forgotten to do that ;) I am also assuming that
{@newPallet} returns that exact verbiage, otherwise it will never increment.
you also could move the increment logic to the
{@newPallet} formula, and when it determines it is a new pallet to increment the shared variable
HTH