ireport 中没有 if else 写法但 有 ?: 运算符。
如 以下 if else 语句
if {CLASS}="0" then
"中国出口"
else if {CLASS}="1" then
"香港进口"
else if {CLASS}="2" then
"退料"
else if {CLASS}="3" then
"转余料进口"
else if {CLASS}="4" then
"转余料出口"
else if {CLASS}="5" then
"转厂进口"
else if {CLASS}="6" then
"转厂出口"
else if {CLASS}="7" then
"内销"
else if {CLASS}="8" then
"其它"
等价于
$F{CLASS}.equals("0")?"中国出口":
$F{CLASS}.equals("1")?"香港进口":
$F{CLASS}.equals("2")?"退料":
$F{CLASS}.equals("3")?"转余料进口":
$F{CLASS}.equals("4")?"转余料出口":
$F{CLASS}.equals("5")?"转厂进口":
$F{CLASS}.equals("6")?"转厂出口":
$F{CLASS}.equals("7")?"内销":"其它"
当 获得的值为 null 显示空事,可以按下图设置