How to compare dates in iReport?

青春壹個敷衍的年華 提交于 2019-12-25 14:25:26

问题


How to compare dates in iReport ? I want to use the "Print When Expression.."

Something like : $F{date_from_table} <= $F{another_date_from_table} ? true : false

It should work .

What is the correct syntax? Thanks.


回答1:


Try to use Date.before() or Date.after() method.
Like below

($F{date_from_table}.before($F{another_date_from_table}) || $F{date_from_table}.equals($F{another_date_from_table})) ? true : false


来源:https://stackoverflow.com/questions/31256124/how-to-compare-dates-in-ireport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!