Skip to main content


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 messageGo to next 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?)
>
Re: External Scripts [message #1805646 is a reply to message #554857] Fri, 19 April 2019 14:09 Go to previous message
venkatesh veera is currently offline venkatesh veeraFriend
Messages: 4
Registered: November 2018
Junior Member
Hi jason,
Can you please elaborate the Above Explanation . i have added the .js File into the Resource tab but i am unable use the functions in the .js file. language i am using is java and EngineApi for report Creation


script.setContentType(DesignChoiceConstants.TEXT_CONTENT_TYPE_HTML);
    script.setContent("<script src=\"report.js\" >"+
        "</script>");

[Updated on: Fri, 19 April 2019 14:11]

Report message to a moderator

Previous Topic:counting distinct items of a column and put it into computed column
Next Topic:Tomcat- Birt report not displayed in browser
Goto Forum:
  


Current Time: Tue Jul 23 04:44:26 GMT 2019

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

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

Back to the top