Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » External Scripts
External Scripts [message #554598] Mon, 23 August 2010 16:16 Go to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
Hi,
can I use external Scripts in BIRT?
Currently I have created several Reports using mostly similar code. For better Maintenance I would like to externalize these scripts.

For example I am creating the SQL for my Data Sets with a script in the beforeOpen method using my parameters.
Now I want to take this script and save it under "sqlCreation.js" in a Folder "scripts" nearby the report. How can I now access this Script?

Thanks in advance!
Re: External Scripts [message #554605 is a reply to message #554598] Mon, 23 August 2010 16:36 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

If you put your .js files in the resource folder and then add them to
the report this is possible. Look at the resources tab in the
properties editor when the root report is selected. There is an option
to use a .js file.

Jason

On 8/23/2010 12:16 PM, tobias.koehler1987@googlemail.com wrote:
> Hi,
> can I use external Scripts in BIRT?
> Currently I have created several Reports using mostly similar code. For
> better Maintenance I would like to externalize these scripts.
>
> For example I am creating the SQL for my Data Sets with a script in the
> beforeOpen method using my parameters. Now I want to take this script
> and save it under "sqlCreation.js" in a Folder "scripts" nearby the
> report. How can I now access this Script?
>
> Thanks in advance!
Re: External Scripts [message #554698 is a reply to message #554605] Tue, 24 August 2010 06:57 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
Thank you!
The next step is assigning this JS file to a report Item. How can I do that?
I only found the Event Handler Item (which is just for Java classes I guess?)
Re: External Scripts [message #554857 is a reply to message #554698] Tue, 24 August 2010 14:16 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can call any function you define in the .js file from script, but
the call has to be placed in the event script tab. One option is to
build a template that has all the calls already in it and then use these
to start your development.

Jason

On 8/24/2010 2:57 AM, tobias.koehler1987@googlemail.com wrote:
> Thank you!
> The next step is assigning this JS file to a report Item. How can I do
> that? I only found the Event Handler Item (which is just for Java
> classes I guess?)
>
Previous Topic:How to display another data set values in Table
Next Topic:Column Mapping from one node name to multiple fields
Goto Forum:
  


Current Time: Fri Dec 19 01:42:59 GMT 2014

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

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