How to create Default Date parameter with relative value


Can we create Default Date Parameter with relative value e.g.

Today or Today + 7 days or This Month, Last Month, Next Month?



To define such parameter please

- specify parameter type as


- set Default Value Expression for this parameter as

(in sample below are used DAY and DAY-1 values):



Method set(java.sql.Timestamp.class) sets value class,

to indicate desired class of DateRange.getStart and DateRange.getEnd methods.


The screenshot with report and these parameters which have been executed

in JasperSoft Studio 6.1 is shown below:


Please find a sample of the report that should be opened in JasperSoft Studio 6.1

in the attachment to the article (the report uses Sample DB that is supplied with Studio).






could you not use:

EDATE(TODAY(), -1000)

for the parameter