steven.cyc Posted January 23, 2013 Share Posted January 23, 2013 Hi guys, I need your help from iReport, I need to generate a monthly figure from iReport, suppose I have a date inputted: 2012-08-20 then I need to generate the 12 month label starting from the date inputted ( e.g. 08/2012, 09/2012, 10/2012, 11/2012, 12/2012 , 01/2013, 02/2013.......) Do you think iReport support to do this by Variable? Link to comment Share on other sites More sharing options...
marianol Posted January 23, 2013 Share Posted January 23, 2013 Steven,If you have a date parameter you can use that parameter in variables to generate the dates you need using either java.util.Date or java.util.Calendar, check this blog post that has a really cool example similar to what you need. http://type-exit.org/adventures-with-open-source-bi/2010/06/date-calculation-in-ireport/Since you need to generate 12 variables for this, the other option may be using report scriptlets check chapter 18 of the iReport Ultimate guide http://community.jaspersoft.com/documentation?version=6263 for more information on using Scriptlets Link to comment Share on other sites More sharing options...
rlfisherpbtgroup.com Posted January 25, 2013 Share Posted January 25, 2013 Depending upon your environment, another approach I take sometimes is to have a subselect in my (MySQL) query to create the dates based (in your case) on the input parameter. Might need a UNION or some GROUP BY for aggregating your results. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now