bckeen Posted April 13, 2009 Share Posted April 13, 2009 Is there a way to typr case the return from a single select query to allow the selection of only available dates in the database. And have the date go into the report as a java.util.Date instead of a String Link to comment Share on other sites More sharing options...
andrewsok Posted April 13, 2009 Share Posted April 13, 2009 You can use String for visible parameter, and show your available dates from the DB, and then have a second hidden parameter which you use for the report query:<parameter name="P_DateString" isForPrompting="true" class="java.lang.String" /><parameter name="P_Date" isForPrompting="false" class="java.util.Date"> <defaultValueExpression><![CDATA[new java.text.SimpleDateFormat("--your--pattern--").parse($P{P_DateString})]]></defaultValueExpression></parameter>P_DateString is what InputControl sets up, and P_Date is what you user in your SQL query. Link to comment Share on other sites More sharing options...
bckeen Posted April 14, 2009 Author Share Posted April 14, 2009 This does not seem to work with iReport and Jasper Server 3.5. My code is attached. There are no errors just no data is retrieved Code: Post Edited by Brian Keener at 04/14/09 12:46 Link to comment Share on other sites More sharing options...
bckeen Posted April 14, 2009 Author Share Posted April 14, 2009 Nevermind, I have gotten it working Link to comment Share on other sites More sharing options...
zakaria2105 Posted May 6, 2010 Share Posted May 6, 2010 hi bckeen, i want to use your code to change the format of the calender but i dont know how can i use it , where can i put this code ? excuse me im a new user of jasper i try to understand some carasteristic of this opensource^^ 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