How can I use a conditional TextField in JasperReports?

前端 未结 3 689
闹比i
闹比i 2021-01-02 05:54

I would like to have a pair of TextFields depending on a value. And the \"y\"-value should be adjusted depending on the empty space.

When the value is \"0\"

3条回答
  •  甜味超标
    2021-01-02 06:19

    you can use like this

    Declare RED as [class="java.lang.Number"]
    

    while printing

    $P{red}.intValue() == 0 ? null : $P{red}.intValue()
    

    and enable Blank when null option of the field using

    textField isBlankWhenNull="true">               
    
    

提交回复
热议问题