10/3/13

Date calculation in iReport: set default of Date input at the first day of current month

new GroovyShell(new Binding()).evaluate("""
Calendar c = Calendar.getInstance()
c.set(Calendar.DAY_OF_MONTH, 0)
return "" + (c.getTime().getYear() + 1900) + "-" + c.getTime().getMonth() + "-" + c.getTime().getDay()
""")

No comments: