Schedule reports - Date parameters


Is it possible to insert dynamic date parameters for schedule reports? Like last month? Current month?

Can someone help me with that..

samhast's picture
Joined: Nov 4 2011 - 6:41am
Last seen: 6 years 6 months ago

3 Answers:

I think that's the solution i am searching for:

iReport 5.0 introduces relative dates..


Can someone give me an example how I can do it in iReport..

samhast's picture
Joined: Nov 4 2011 - 6:41am
Last seen: 6 years 6 months ago

There is a section about relative dates in the iReport Ultimate Guide, at

The guide gives an example:

<parameter class="“net.sf.jasperreports.engine.rd.DateRange”" name="“myParameter”">
new DateRangeBuilder("DAY-1").toDateRange()
Select * from account where $X{EQUAL, OpportunityCloseDate, SelectedDateRange}

The important part is DAY-1. Available keyword are DAY, WEEK, MONTH, QUARTER, SEMI, and YEAR.

elizam's picture
Joined: Mar 5 2012 - 9:19am
Last seen: 2 years 10 months ago

Yes I read about it. But when I try it, I always get an error:
Cannot resolve DateRange......

samhast - 10 years 3 months ago

Yes thats because you need to include the class, instead of new DateRangeBuilder("DAY-1").toDateRange()

use new"DAY-1").toDateRange()and have the parameter class as

curbish - 9 years 11 months ago

I had the same story : Doc reading, same example and same error
@zctcurbish : I also tried your solution without any results..

fabrice.sabot - 9 years 3 months ago
I have tried it, but I get this error (by iReport and the Server):
"net.sf.jasperreports.engine.rd.DateRange cannot be resolved to a type"
Is something missing?
I use "" now.
ernst_2's picture
Joined: Feb 17 2015 - 1:15am
Last seen: 7 years 5 months ago