Fail passing date value to parameter in IReport

i try to assign date value which i get for JDateChooser (toedter component), to a parameter in IReport which is java.util.Date type.

Here's my code :

toDate = toDatePicker.getDate();
hash.put("period2", toDate);
jasperReport = JasperCompileManager.compileReport(jasperDesign);
jasperPrint = JasperFillManager.fillReport(jasperReport, hash, con);

But the jasper viewer say that the document has no pages. When i try to preview my report, choosing the parameter with the same date, I get my report properly. I hope i explained well. Thanks....

Edit : my mistake, i pass wrong parameter name, it should be "periode2", not "period2". Thanks... Btw, should i delete this post?


after long debugging, i realize that i pass wrong parameter name to the report.

It should be "periode2", not "period2". So JDateChooser from toedter is safe to use for get date parameter and pass it to report which have java.util.Date parameter. Thanks and sorry for my mistake :D

链接地址: http://www.djcxy.com/p/18694.html

上一篇: iReport:参数的本地化默认值

下一篇: 将传递日期值传递给IReport中的参数