syed.mohsin2 Posted October 12, 2012 Share Posted October 12, 2012 Sir i am using Jasper Report, iReport 3.7.3, and i want to use date parameter as from date and todate.plz help i want to select data between from date and todate. i have use invDate between $PP{fromDate} and $PP{toDate} but report did not run. can anybody guid me. Thanks Link to comment Share on other sites More sharing options...
peter.w Posted October 12, 2012 Share Posted October 12, 2012 HelloYou need to be sure you have a database connection for your iReport. Test with out any date ranges first to see if your connection is workingYou need to have your parameters for your "from" and "to" dates prepared.The xml should look something like this.<parameter name="fromDate" class="java.util.Date"/> <parameter name="toDate" class="java.util.Date"/>If you are using the IReport designer check the "Use as a prompt" option for testing.Then you need to have the reports "Query Text" in the report set to something like this SELECT r.invdate, r.detail, r.amount FROM record r, WHERE r.invdate >= $P{fromDate} AND r.invdate <= $P{toDate} ORDER BY r.invdateThe XML would look something like this<queryString language="SQL"> <![CDATA[sELECT r.invdate, r.detail, r.amount FROM record r, WHERE r.invdate >= $P{fromDate} AND r.invdate <= $P{toDate} ORDER BY r.invdate]]></queryString>I hope this helps 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