Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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 12:06
sjung is currently offline sjung
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: Sat Aug 23 03:32:06 EDT 2014

Powered by FUDForum. Page generated in 0.01624 seconds