This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello Experts, I am facing a problem while passing date type parameters to jaster report. I am using SQL Server as my RDBMS. When i am passing the date in the form of string the erroer message says "can't convert string to date" on the other hand while passed the date in the form of Date(java.util.Date) the error says "Incompatible data type"... i tried all the combinations possible for the same problem..but in vain.. My report is getting two parametrs for date dtfr and dtto (both defined as of type java.lang.String...is it correct ?..if not then what it should be) and while i pass it from the jsp page the code is as below
//while passing as date type dtFrom and dtTo are java.util.Date type SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yyyy"); dtFrom = dateFormatter.parse(datefrom); dtTo = dateFormatter.parse(dateto); //datefrom and dateto has the date in "mm-dd-yyyy" format
i also tried by passing strings datefrom and dateto itself also but no outcome.. can any body suggest how can we pass the date type parameters to jasperreports..explaining each step.. if possible please supply a sample code Thanks to all Keshav