Jump to content
Changes to the Jaspersoft community edition download ×

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.


syed.mohsin2

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...