Skip to main content



      Home
Home » Archived » BIRT » External Scripts
External Scripts [message #554598] Mon, 23 August 2010 12:16 Go to next message
Eclipse UserFriend
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 12:36 Go to previous messageGo to next message
Eclipse UserFriend
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 02:57 Go to previous messageGo to next message
Eclipse UserFriend
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 10:16 Go to previous messageGo to next message
Eclipse UserFriend
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 10:09 Go to previous messageGo to next message
Eclipse UserFriend
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 10:11] by Moderator

Re: External Scripts [message #1817101 is a reply to message #1805646] Fri, 15 November 2019 09:19 Go to previous message
Eclipse UserFriend
venkatesh veera wrote on Fri, 19 April 2019 16:09
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>");


Did you find any solution?
Previous Topic:Generate xlsx report using birt template and .csv file.
Next Topic:create Data Source with .csv
Goto Forum:
  


Current Time: Wed Jul 23 06:39:09 EDT 2025

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

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

Back to the top