Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Format for setting eSpreadsheet date parameter with callback(Format for setting eSpreadsheet date parameter with callback)
Format for setting eSpreadsheet date parameter with callback [message #646393] Thu, 23 December 2010 17:06
sjung is currently offline sjungFriend
Messages: 2
Registered: December 2010
Junior Member
I am using a callback class to calculate and set date parameters for an eSpreadsheet report. My call back class compiles fine but when I run the eSpreadsheet with nul date parameter values which triggers the callback class to calculate the date parameters I get an invalid SQL message. I am setting the date with the folowing code. I'm not sure whether the problem is with the deprecated methods setDate and setMonth or if I need to apply additional formatting to the date.

try{
String beginDate = bk.getDefinedName("gpdtStartDate");
if (beginDate == null) {
Date Today = Calendar.getInstance().getTime();
Date StartDate = Calendar.getInstance().getTime();
Date EndDate = Calendar.getInstance().getTime();
int currentMonth = Today.getMonth();
switch(currentMonth){
case 1: case 2: case 3:
StartDate..setMonth(1);
StartDate.setDate(1);
EndDate.setMonth(3);
EndDate.setDate(31);
break;
case 4: case 5: case 6:
StartDate.setMonth(1);
StartDate.setDate(1);
EndDate.setMonth(3);
EndDate.setDate(31);
break;
case 7: case 8: case 9:
StartDate.setMonth(7);
StartDate.setDate(1);
EndDate.setMonth(9);
EndDate.setDate(30);
break;
case 10: case 11: case 12:
StartDate.setMonth(10);
StartDate.setDate(1);
EndDate.setMonth(12);
EndDate.setDate(31);
break;
}

bk.setDefinedName("gpdtStartDate",StartDate.toString());
bk.setDefinedName("gpdtEndDate",EndDate.toString());
}
Previous Topic:Single Value in row of crosstab
Next Topic:Can not create Bar Chart
Goto Forum:
  


Current Time: Thu Apr 25 19:50:04 GMT 2024

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

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

Back to the top