Format for setting eSpreadsheet date parameter with callback [message #646393] |
Thu, 23 December 2010 17:06 |
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());
}
|
|
|
Powered by
FUDForum. Page generated in 0.02087 seconds