Problem with Javascript [message #171205] |
Sat, 17 June 2006 01:59  |
Eclipse User |
|
|
|
OK. Maybe the following bug is due to a syntax error, but I'm not so
sure. The following code is entered through the Expression Builder for
a data item. When the report is previewed, the "result" is overridden
with the current date when the "currentFiscalStart" variable is setup.
If I comment it out, the result is unmodified. What is going on here?
result = "BOOKED "
var currentTime = new Date()
function TwoDigitYear(year) {
year = year % 100
return(year<0||year>9?year:"0"+year)
}
result += "FY" + TwoDigitYear(currentTime.getFullYear())
// For some reason, the following operation operation
// screws up the "result"
currentFiscalStart = currentTime
|
|
|
|
Re: Problem with Javascript (resolved) [message #171443 is a reply to message #171253] |
Mon, 19 June 2006 17:04  |
Eclipse User |
|
|
|
George Handin wrote:
> George Handin wrote:
>> OK. Maybe the following bug is due to a syntax error, but I'm not so
>> sure. The following code is entered through the Expression Builder for
>> a data item. When the report is previewed, the "result" is overridden
>> with the current date when the "currentFiscalStart" variable is setup.
>> If I comment it out, the result is unmodified. What is going on here?
>>
>> result = "BOOKED "
>>
>> var currentTime = new Date()
>>
>> function TwoDigitYear(year) {
>> year = year % 100
>> return(year<0||year>9?year:"0"+year)
>> }
>>
>> result += "FY" + TwoDigitYear(currentTime.getFullYear())
>>
>> // For some reason, the following operation operation
>> // screws up the "result"
>> currentFiscalStart = currentTime
>
> I've executed the same code within an HTML file and it works just fine. So
> this appears to be bug with BIRT. I've logged a defect:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=147612
User error. My knowledge of JavaScript continues to grow. As noted in
the bug report, the last line to execute in a JavaScript function is
what gets returned.
|
|
|
Powered by
FUDForum. Page generated in 0.02866 seconds