Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Script to set dates for scheduled repoorts(Birt report script for dates )
Script to set dates for scheduled repoorts [message #686644] Wed, 22 June 2011 16:32
sjung is currently offline sjungFriend
Messages: 2
Registered: December 2010
Junior Member
dFrequency = params["pintFrequency"].value;

dbegin = new Date();
dend = new Date();

switch (dFrequency) {
case 1: // Daily
params["pdtmBeginDate"].value = dbegin;
params["pdtmEndDate"].value = dend;
break;
case 2: // Monthly
dyear = dbegin.getFullYear();
dmonth = dbegin.getMonth();
params["pdtmBeginDate"].value = new Date(dyear,dmonth,1);
dd = new Date(dyear, dmonth + 1, 0);
params["pdtmEndDate"].value = dd;
break;
case 3: // Quarterly
dyearq = dbegin.getFullYear();
dmonthq = dbegin.getMonth();
switch (dmonthq){
case 0,1,2:
params["pdtmBeginDate"].value = new Date(dyearq,0,1);
params["pdtmEndDate"].value = new Date(dyearq,2,31);
break;
case 3,4,5:
params["pdtmBeginDate"].value = new Date(dyearq,3,1);
params["pdtmEndDate"].value = new Date(dyearq,5,30);
break;
case 6,7,8:
params["pdtmBeginDate"].value = new Date(dyearq,6,1);
params["pdtmEndDate"].value = new Date(dyearq,8,30);
break;
case 9,10,11:
params["pdtmBeginDate"].value = new Date(dyearq,9,1);
params["pdtmEndDate"].value = new Date(dyearq,11,31);
break;
}
}
Previous Topic:Referencing .sql file, .jar file
Next Topic:org.mozilla.javascript.EcmaError: ReferenceError: "Total" is not defined
Goto Forum:
  


Current Time: Sun Nov 23 06:19:36 GMT 2014

Powered by FUDForum. Page generated in 0.21099 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software