JasperReports: How to call a java bean method in report template?

后端 未结 1 758
礼貌的吻别
礼貌的吻别 2020-12-03 08:59

I am passing a java bean collection into a jasper report. I have several fields for this java bean defined an they are display just fine in my report.

Im wondering i

1条回答
  •  佛祖请我去吃肉
    2020-12-03 09:11

    Using the keyword _THIS in a field name or description will make it map to the bean class itself. Using the fieldDescription tag is better as it allows you to do this with multiple beans.

    For example:

    
        _THIS
    
    

    Then you can call methods in an expression like this:

    $F{customBean}.someMethod()
    

    0 讨论(0)
提交回复
热议问题