Hi Eric,
Make sure you're not using this code in the Record Selection Formula, Group Selection Formula or the conditional suppression formulae.
Go to the Field Explorer > Click 'New' > Past the code in the Formula Editor > Save > Drag and drop the formula on the report.
-Abhilash