There seems to be a huge missing feature in jasper studio. It seems its not possible for a mortal to get yesterdays date, or do date arithmentic in general. We need a report which shows summaries for today, yesterday, last month, today last month, last quarter etc.
I have read many forum posts postulating ways to get yesterdays date, and things like last month. It seems it is not feasible.
This was suggested: DATE(YEAR(TODAY( )),MONTH(TODAY( )),DAY(TODAY( ))-1)
But this is wrong - if it is the 1st today, then yesterday needs to be the last day of the previous month, not just day -1 of the current month.
Other suggestions include writing java classes (you may as well say build a rocket to land a girbil on the moon), or using groovy. We tried using grovy, but the expression editor doesnt recognis groovy syntax.
Is there no solution for this for normal report writers?
We could duplicate the report 10 times, and hard code the requred date ranges in SQL, but this is a maintenance nightmare as we change the columns requently, and there are a lot of them. If we are goijng to do this, there is no point in us using Jasper - we may as well stick to manually producing reports.