Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Wanted: Easy Report with JavaScript
Wanted: Easy Report with JavaScript [message #531233] Tue, 04 May 2010 09:22 Go to next message
Juliane Harbarth is currently offline Juliane HarbarthFriend
Messages: 21
Registered: July 2009
Junior Member


Good morning,

I understood that BIRT's features can be enhanced by embedding JavaScript snipplets and I have seen some kind of evidence for this when using the Expression Builder that offers some JavaScript functions. I'd like to explorer these facilities but feel somehow inadequate.

Can somebody provide me with (or point me to) a preferrably simple report that uses JavaScript so that I can understand both, how this is embedded, and for which occasion one would do so. I am currently running BIRT 232.

Thanks & regards,
Juliane.


Re: Wanted: Easy Report with JavaScript [message #531336 is a reply to message #531233] Tue, 04 May 2010 14:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Juliane,

There is an extension point for this. Take a look at this blogpost:
http://birtworld.blogspot.com/2008/09/birt-231-adding-functi ons-to-expression.html

but use this example

http://www.birt-exchange.org/devshare/designing-birt-reports /1101-example-plugin-for-expression-builder/#description


Jason

On 5/4/2010 5:22 AM, Juliane Harbarth wrote:
>
>
> Good morning,
>
> I understood that BIRT's features can be enhanced by embedding
> JavaScript snipplets and I have seen some kind of evidence for this when
> using the Expression Builder that offers some JavaScript functions. I'd
> like to explorer these facilities but feel somehow inadequate.
>
> Can somebody provide me with (or point me to) a preferrably simple
> report that uses JavaScript so that I can understand both, how this is
> embedded, and for which occasion one would do so. I am currently running
> BIRT 232.
>
> Thanks & regards,
> Juliane.
>
>
>
Re: Wanted: Easy Report with JavaScript [message #531915 is a reply to message #531336] Thu, 06 May 2010 14:09 Go to previous messageGo to next message
Juliane Harbarth is currently offline Juliane HarbarthFriend
Messages: 21
Registered: July 2009
Junior Member

Hi Jason,

thank you very much. Both the explanation and the sample will be very useful.

Have a nice day,
Juliane.
Re: Wanted: Easy Report with JavaScript [message #632559 is a reply to message #531915] Wed, 13 October 2010 12:39 Go to previous messageGo to next message
Juliane Harbarth is currently offline Juliane HarbarthFriend
Messages: 21
Registered: July 2009
Junior Member
Good afternoon,

I assumed that adding more JavaScript functions than offered in the Expression Builder requires an extension, but those functions already offered in the Expression Builder would be executable without further add-ons.

I have just tried with Eclipse IDE for Java and Report Developers, Version: Helios Service Release 1, Build id: 20100917-0705 and either I am doing something terribly wrong or my above assumption is not correct.

What I have done is selecting concat() from the list of functions and previewed the report and it gives me the following error:

The following items have errors:


Grid (id = 8):
+ A BIRT exception occurred: Error evaluating Javascript expression. Script engine error: ReferenceError: "concat" is not defined.
Script source: , line: 0, text:
"Result: " + concat(params["TextParameter"].value,"test"). See next exception for more information.
Error evaluating Javascript expression. Script engine error: ReferenceError: "concat" is not defined.
Script source: , line: 0, text:
"Result: " + concat(params["TextParameter"].value,"test")

Please advise, thanks a lot & have a nice day,
Juliane.
Re: Wanted: Easy Report with JavaScript [message #632612 is a reply to message #632559] Wed, 13 October 2010 15:18 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You need to call it on the string like:

params["NewParameter"].concat("jjj")


Jason

On 10/13/2010 8:39 AM, Juliane Harbarth wrote:
> Good afternoon,
>
> I assumed that adding more JavaScript functions than offered in the
> Expression Builder requires an extension, but those functions already
> offered in the Expression Builder would be executable without further
> add-ons.
> I have just tried with Eclipse IDE for Java and Report Developers,
> Version: Helios Service Release 1, Build id: 20100917-0705 and either I
> am doing something terribly wrong or my above assumption is not correct.
>
> What I have done is selecting concat() from the list of functions and
> previewed the report and it gives me the following error:
>
> The following items have errors:
>
> Grid (id = 8): + A BIRT exception occurred: Error evaluating Javascript
> expression. Script engine error: ReferenceError: "concat" is not defined.
> Script source: , line: 0, text:
> "Result: " + concat(params["TextParameter"].value,"test"). See next
> exception for more information.
> Error evaluating Javascript expression. Script engine error:
> ReferenceError: "concat" is not defined.
> Script source: , line: 0, text:
> "Result: " + concat(params["TextParameter"].value,"test")
> Please advise, thanks a lot & have a nice day,
> Juliane.
>
Re: Wanted: Easy Report with JavaScript [message #632634 is a reply to message #632612] Wed, 13 October 2010 16:21 Go to previous message
Juliane Harbarth is currently offline Juliane HarbarthFriend
Messages: 21
Registered: July 2009
Junior Member
Uh, wrong JavaScript syntax, embarrassing

Thank you very much Jason,
Juliane.
Previous Topic:BIRT publishes xml parser an crashes second webapp
Next Topic:Toggle Series Visibility Feature: Default hidden series
Goto Forum:
  


Current Time: Thu Apr 18 15:05:21 GMT 2024

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

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

Back to the top