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
1 Answer:
Hello
You 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 working
You 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.invdate
The 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