Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
passing date parameter
pko
I am working on BIRT 2.3.2. I am trying to pass date parameter from user. The user will select month parameter from the drop down box. What I am trying to do is to write the script to pick up the first date and last date of the month from user . The code below can only pick up the current month (09/01/2009 and 09/30/2009). Please help!!! //**Get First Date of the month
var usrMonth = params["Month"]
var cal = Calendar.getInstance();
var setFirstDate = cal.set(Calendar.DAY_OF_MONTH, 1);
var getFirstDay = cal.getTime();
var firstDayOfMonth = new SimpleDateFormat("MM/dd/yyyy").format(getFirstDay);
//**Get Last Date of the month
var lastDate = cal.getActualMaximum(Calendar.DATE); var setLastDate = cal.set(Calendar.DATE, lastDate);
var lastDay = cal.get(Calendar.DAY_OF_WEEK);
var getLastDay = cal.getTime();
var lastDayOfMonth = new SimpleDateFormat("MM/dd/yyyy").format(getLastDay);
reportContext.setPersistentGlobalVariable("tmpFirst", firstDayOfMonth);
reportContext.setPersistentGlobalVariable("tmpLast", lastDayOfMonth);
Find more posts tagged with
Comments
mwilliams
Hi pko,
Can you set this up in a sample report that I can run so I have a report to work with? Thanks.