I am creating a report in iReport
The user enters a date eg. 2014-09-14
The report then needs to print 2014-09-01 and 2014-09-30
(\"First day of
If you like to do this inside jasper report a good way to go is using variable
Example: lets assume the date is arriving as a parameter (if you like naturally it can be a field, you just need to switch how the variable is calculated).
The incoming date (I use directly the java.util.Calendar
as class and set a default value so that I can test in preview)
The variable definition, this is beginning of month, create another variable for end of month using getActualMaximum
instead of getActualMinimum
since we are using a parameter its enough to set initialValueExpression
if you are using a field you need to set the variableExpression
Thats it we have our date, format it as you like in the textField
Example
Note: if you are using old version of jasper report (3.1 ecc) you need to set correct class on the different expression 's