Jasper and IReport removing carriage returns in logic

I have just been caught out by IReport.  I had the following “image statement”:

<![CDATA[$F{os}.indexOf("2008 R2") > 0 ? $P{SUBREPORT_DIR} + "warning.png" : $F{os}.indexOf("2008") ? $P{SUBREPORT_DIR} + "cross.png" : $F{os}.indexOf("2003") ? $P{SUBREPORT_DIR} + "cross.png" : $P{SUBREPORT_DIR} + "tick.png"]]>

After looking at the logic (which is fine), I discovered that the carriage / line returns break things (it will still compile in IReport).

Please make sure that line returns are removed ;O)

Author | Miles Davenport

Career programmer, who designs, assembles, fixes, and supports customers, software and systems.