ireport 日期传入参数

来源:百度知道 编辑:UC知道 时间:2024/09/24 07:20:46
select * from drjl t where t.drrq>=to_date('$P!{Start}','yyyy-mm-dd') and t.drrq=<to_date('$P!{end}','yyyy-mm-dd') order by drbm
写了这么一句。好像不对。
关于日期参数要怎么写的呀?
jsp传来的参数是String类型的。可是数据库里面的drrq是date类型的。所以ireport里面sql要怎么写?怎么弄呀?

public static int iReport_print(HttpServletRequest request, HttpServletResponse response ) {
{
String getStartDate="07/25/2010"; //第二种赋值"20100725"
String getEndDate="08/25/2011"; //第二种赋值"20110825"

/*
以上变量的两种赋值格式在MyEclipse运行后均没有数据出来(运行后页面中会显示PDF界面,但该PDF界面上没有任何数据(即空白页)),个人认为是传递的日期参数格式有问题!此问题一直困扰着我...在线求高人能指点下,感激万分!
另外,worker_test2.jasper中SQL为:select distinct workerno,startdate,deptcode,enddate,workername from worker_test
where 1=1
and startdate=$P{start_date}
and enddate=$P{end_date}
其中start_date和end_date两参数类型均为java.lang.String
此语句在MS2000后台中对其赋值后(如and startdate='07/25/2010'
and enddate='08/25/2011')有数据出来
对于传递日期参数,ireport如何才能正常识别的到,而不会报类似错误Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.String.call() is applicable for argument types: (java.lang.String) values: [08/25/2011]

*/