Hopefully Vimal's formula resolves this for you.
Since your debugging was displaying False on every line this lets you know that the gl_trans.cost_code_dr is never NULL and is more likely an empty string. Vimal's ;ast post addresses this.
I have also seen this where you need to trim the field when comparing it to an empty string as it may have spaces in it.
again you can debug to see it by using a formula as
{gl_trans.cost_code_cr} <> ""
place it on the detail row and see if you get True False where expected.
you may need to try
TRIM({gl_trans.cost_code_cr})<>""
if it has any spaces in the field