Skip to main content



      Home
Home » Archived » BIRT » Problem with Javascript
Problem with Javascript [message #171205] Sat, 17 June 2006 01:59 Go to next message
Eclipse UserFriend
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 [message #171253 is a reply to message #171205] Sat, 17 June 2006 12:09 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Problem with Javascript (resolved) [message #171443 is a reply to message #171253] Mon, 19 June 2006 17:04 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Installing BIRT on Sybase's EAServer
Next Topic:Providing "missing" rows via scripted dataset
Goto Forum:
  


Current Time: Mon May 12 07:21:45 EDT 2025

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

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

Back to the top