laugue Posted June 21, 2007 Share Posted June 21, 2007 I try to use date parameters (type java.util.Date)with a report. SELECT ...FROM ...WHERE date >= $P{Date1} AND date <= $P{Date2} I have set default value for the 2 parameters like this : new Date(01,01,2001) for Date1 and new Date(31,12,2099) for Date2 but it doesn't work when I launch the report in jasper without parameters. Could you help me. Link to comment Share on other sites More sharing options...
tekmonkey Posted June 21, 2007 Share Posted June 21, 2007 I am a bit of a newbie.... but I had the same thing so I checked the USE AS PROMPT box on the parameter properties and left the default blank - it seem to work fine Link to comment Share on other sites More sharing options...
laugue Posted June 21, 2007 Author Share Posted June 21, 2007 When I leave blank the default value, I got a "No result" message in jasper. Link to comment Share on other sites More sharing options...
codyjasperForge Posted July 3, 2007 Share Posted July 3, 2007 lauge, Your default values for your date parameters have to be valid Java expressions. Try instantiating a Date object using correct Java syntax, this should work. For example, a default value for an Integer parameter should look like this: new Integer(0) Date's in Java are created somewhat differently. I think this is where your problem lies. Remember that the Date class is instantiated like so: Date d1 = new Date(aNumberInMilliseconds); HTH... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now