Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Firing JS event at end of RunTask?
Firing JS event at end of RunTask? [message #243973] Thu, 21 June 2007 15:39 Go to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: July 2009
Junior Member
Hi all,

I am running and rendering reports in separate tasks and want to write
some JS-code that sets a global persistent variable after running the
report, before the document is saved (based on what other JS-handlers have
gathered in onCreate() of their items). What would be the right hook to
use? afterFactory() doesn't seem to get called by the RunTask and of the
report item events, onCreate() is too early and onRender() is only called
by the RenderTask.

TIA,

Olaf
Re: Firing JS event at end of RunTask? [message #244014 is a reply to message #243973] Thu, 21 June 2007 16:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Olaf,

The afterFactory is the correct location. How are you determining that
it is not being called.

If you use runandrender vs a run and then render the events are called
slightly different. Also initialize is always called for each phase.

Jason


Olaf Lenzmann wrote:
> Hi all,
>
> I am running and rendering reports in separate tasks and want to write
> some JS-code that sets a global persistent variable after running the
> report, before the document is saved (based on what other JS-handlers
> have gathered in onCreate() of their items). What would be the right
> hook to use? afterFactory() doesn't seem to get called by the RunTask
> and of the report item events, onCreate() is too early and onRender() is
> only called by the RenderTask.
>
> TIA,
>
> Olaf
>
>
Re: Firing JS event at end of RunTask? [message #244019 is a reply to message #244014] Thu, 21 June 2007 16:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Olaf,

There may be an issue with accessing variables from onRender.
I just logged a bugzilla entry.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193782

Jason

Jason Weathersby wrote:
> Olaf,
>
> The afterFactory is the correct location. How are you determining that
> it is not being called.
>
> If you use runandrender vs a run and then render the events are called
> slightly different. Also initialize is always called for each phase.
>
> Jason
>
>
> Olaf Lenzmann wrote:
>> Hi all,
>>
>> I am running and rendering reports in separate tasks and want to write
>> some JS-code that sets a global persistent variable after running the
>> report, before the document is saved (based on what other JS-handlers
>> have gathered in onCreate() of their items). What would be the right
>> hook to use? afterFactory() doesn't seem to get called by the RunTask
>> and of the report item events, onCreate() is too early and onRender()
>> is only called by the RenderTask.
>>
>> TIA,
>>
>> Olaf
>>
>>
Re: Firing JS event at end of RunTask? [message #244152 is a reply to message #244019] Fri, 22 June 2007 06:38 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: July 2009
Junior Member
Jason,

I have
Re: Firing JS event at end of RunTask? [message #244157 is a reply to message #244019] Fri, 22 June 2007 06:40 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: July 2009
Junior Member
Jason,

I have in my afterFactory()

reportContext.setPersistentGlobalVariable( "rating", new
Packages.java.lang.Long(3) )

and looking at the file that the run task creates, I cannot find the
variable stored.

The workaround I use now is to put the code into beforeClose() of my main
dataset and with this change, the global variable appears in the report
document.

Olaf


Jason Weathersby wrote:

> Olaf,

> There may be an issue with accessing variables from onRender.
> I just logged a bugzilla entry.
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=193782

> Jason

> Jason Weathersby wrote:
>> Olaf,
>>
>> The afterFactory is the correct location. How are you determining that
>> it is not being called.
>>
>> If you use runandrender vs a run and then render the events are called
>> slightly different. Also initialize is always called for each phase.
>>
>> Jason
>>
>>
>> Olaf Lenzmann wrote:
>>> Hi all,
>>>
>>> I am running and rendering reports in separate tasks and want to write
>>> some JS-code that sets a global persistent variable after running the
>>> report, before the document is saved (based on what other JS-handlers
>>> have gathered in onCreate() of their items). What would be the right
>>> hook to use? afterFactory() doesn't seem to get called by the RunTask
>>> and of the report item events, onCreate() is too early and onRender()
>>> is only called by the RenderTask.
>>>
>>> TIA,
>>>
>>> Olaf
>>>
>>>
Re: Firing JS event at end of RunTask? [message #244346 is a reply to message #244157] Fri, 22 June 2007 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Olaf,

According to the bugzilla entry the report document is closed before the
afterfactory event. This is why it is not showing up.

Jason

Olaf Lenzmann wrote:
> Jason,
>
> I have in my afterFactory()
>
> reportContext.setPersistentGlobalVariable( "rating", new
> Packages.java.lang.Long(3) )
>
> and looking at the file that the run task creates, I cannot find the
> variable stored.
>
> The workaround I use now is to put the code into beforeClose() of my
> main dataset and with this change, the global variable appears in the
> report document.
>
> Olaf
>
>
> Jason Weathersby wrote:
>
>> Olaf,
>
>> There may be an issue with accessing variables from onRender.
>> I just logged a bugzilla entry.
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=193782
>
>> Jason
>
>> Jason Weathersby wrote:
>>> Olaf,
>>>
>>> The afterFactory is the correct location. How are you determining
>>> that it is not being called.
>>>
>>> If you use runandrender vs a run and then render the events are
>>> called slightly different. Also initialize is always called for each
>>> phase.
>>>
>>> Jason
>>>
>>>
>>> Olaf Lenzmann wrote:
>>>> Hi all,
>>>>
>>>> I am running and rendering reports in separate tasks and want to
>>>> write some JS-code that sets a global persistent variable after
>>>> running the report, before the document is saved (based on what
>>>> other JS-handlers have gathered in onCreate() of their items). What
>>>> would be the right hook to use? afterFactory() doesn't seem to get
>>>> called by the RunTask and of the report item events, onCreate() is
>>>> too early and onRender() is only called by the RenderTask.
>>>>
>>>> TIA,
>>>>
>>>> Olaf
>>>>
>>>>
>
>
Re: Firing JS event at end of RunTask? [message #244531 is a reply to message #244346] Mon, 25 June 2007 06:19 Go to previous message
No real name is currently offline No real nameFriend
Messages: 23
Registered: July 2009
Junior Member
Jason,

I had not seen that in the entry - thanks.

Olaf

On 22.06.2007 17:57:50, Jason Weathersby wrote:
> Olaf,
>
> According to the bugzilla entry the report document is closed before the
> afterfactory event. This is why it is not showing up.
>
> Jason
>
> Olaf Lenzmann wrote:
>> Jason,
>>
>> I have in my afterFactory()
>>
>> reportContext.setPersistentGlobalVariable( "rating", new
>> Packages.java.lang.Long(3) )
>>
>> and looking at the file that the run task creates, I cannot find the
>> variable stored.
>>
>> The workaround I use now is to put the code into beforeClose() of my
>> main dataset and with this change, the global variable appears in the
>> report document.
>>
>> Olaf
>>
>>
>> Jason Weathersby wrote:
>>
>>> Olaf,
>>
>>> There may be an issue with accessing variables from onRender.
>>> I just logged a bugzilla entry.
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=193782
>>
>>> Jason
>>
>>> Jason Weathersby wrote:
>>>> Olaf,
>>>>
>>>> The afterFactory is the correct location. How are you determining
>>>> that it is not being called.
>>>>
>>>> If you use runandrender vs a run and then render the events are
>>>> called slightly different. Also initialize is always called for each
>>>> phase.
>>>>
>>>> Jason
>>>>
>>>>
>>>> Olaf Lenzmann wrote:
>>>>> Hi all,
>>>>>
>>>>> I am running and rendering reports in separate tasks and want to
>>>>> write some JS-code that sets a global persistent variable after
>>>>> running the report, before the document is saved (based on what
>>>>> other JS-handlers have gathered in onCreate() of their items). What
>>>>> would be the right hook to use? afterFactory() doesn't seem to get
>>>>> called by the RunTask and of the report item events, onCreate() is
>>>>> too early and onRender() is only called by the RenderTask.
>>>>>
>>>>> TIA,
>>>>>
>>>>> Olaf
>>>>>
>>>>>
>>
>>
>
Previous Topic:Birt licensing question
Next Topic:[2.20RC3] How can I get more info for the exception
Goto Forum:
  


Current Time: Mon Jul 22 05:15:26 GMT 2024

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

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

Back to the top