Dear readers, this blog talks about Date Calculation using Joda Time Library In iReport
By using Joda Time Library , we can give default value expression for any datetype parameter .
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
Steps for using joda time library in iReport :
- Download joda time library ,
2. Put its jar file “joda-time.jar” in the path of iReport : Tools/Options/Classpath/.
3. In the main report section properties , set import property to “org.joda.time.DateTime
”
Without double quotes.
4. Now with the above configuration , we will be able to do any type of date calculation
5. Example :
a. Start Day Of Current Month :
Take two parameters : now and startday respectively
For ‘now’ parameter give its class name as ‘java.util.Date’ and default value expression as new DateTime.now().dayOfMonth().withMinimumValue().withTimeAtStartOfDay()
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
b. Last day of previous Month :
Take two parameters : now and endday respectively
For ‘now’ parameter give its class name as ‘java.util.Date’ and default value expression as new DateTime.now().minusMonths(1).dayOfMonth().withMaximumValue()
In the similar way we can do any type of date calculation for default value expression.
Rupam Bhardwaj
Best Open Source Business Intelligence Software Helical Insight is Here