This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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