How to compare dates in iReport?

2019-08-31 05:50发布

问题:

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