I’m creating a jasper report which has the parameters of datetrfrom and datetrto.
The filtering goes well except when the the two parameters carry the same data such as
datetrfrom>= '15-12-2012'
datetrto<= '15-12-2012'
The data which are processed on the 15-12-2012 will not come out.
I tried this in my JSP :
function ShowReport(){
var param='';
var timestart = ' 00:00:00'
var timeend = ' 23:59:59'
var datetrFrom = document.forms['report']['datetransfrom'].value;
datetrFrom.split("-")
//i split n join back the date to change the format from dd-MM-yyyy to yyyy-MM-dd
var dtf = [datetrFrom[6],datetrFrom[7],datetrFrom[8],datetrFrom[9],datetrFrom[5],datetrFrom[3],datetrFrom[4],datetrFrom[2],datetrFrom[0],datetrFrom[1] ].join('')
datetrfr = dtf + timestart; //i join the date with the timestart to create format yyyy-MM-dd hh:mm:ss
var datetrTo = document.forms['report']['datetransto'].value;
datetrTo.split("-")
var dtt = [datetrTo[6],datetrTo[7],datetrTo[8],datetrTo[9],datetrTo[5],datetrTo[3],datetrTo[4],datetrTo[2],datetrTo[0],datetrTo[1] ].join('')
datetrto = dtt + timeend; //i join the date with the timeend to create format yyyy-MM-dd hh:mm:ss
param = param + '@@dtTFrom=='+datetrfr+'@@dtTTo=='+datetrto;
@@dtTFrom and @@dtTTo are the parameters that I use in my jasper report.
This is what I do in the where clause in my jasper report:
where record_line_status='NO'
and datetime_process >= convert(date, $P{dtTFrom},105)
and datetime_process <= convert(date, $P{dtTTo},105)
But my report still does not work. Can anyone help me?
I have solved my problem here.
This is my new coding in my JSP:
and this is what I do in the where clause in my jasper report:
by the way my parameter class is
.