Skip to main content



      Home
Home » Archived » BIRT » Using Named Expressions or User Properties
Using Named Expressions or User Properties [message #263596] Wed, 19 December 2007 15:41 Go to next message
Eclipse UserFriend
Using the RCP Designer 2.2.0 version, I can create Named Expressions and
User Properties. However, I have found no examples that will allow me to
successfully access either of those in scripts or in Dynamic Text. Are
these retrievable from the Designer yet?

Richard A. Polunsky
Houston, Texas, USA
Re: Using Named Expressions or User Properties [message #263609 is a reply to message #263596] Wed, 19 December 2007 19:50 Go to previous messageGo to next message
Eclipse UserFriend
Try to use below script
this.getUserPropertyValue(String arg1)
this.getNamedExpressionValue(String arg1)


"Richard A. Polunsky" <rpolunsky@yahoo.com> wrote in message
news:daa5de16036e732acbc334bee382f031$1@www.eclipse.org...
> Using the RCP Designer 2.2.0 version, I can create Named Expressions and
> User Properties. However, I have found no examples that will allow me to
> successfully access either of those in scripts or in Dynamic Text. Are
> these retrievable from the Designer yet?
>
> Richard A. Polunsky
> Houston, Texas, USA
>
>
Named Expressions Not Working - Sample Code [message #263652 is a reply to message #263609] Thu, 20 December 2007 12:11 Go to previous messageGo to next message
Eclipse UserFriend
I created a Data Source and Data Set.
I dragged the Data Set onto the Layout, thus creating a Table with header
and detail rows filled in.
I clicked on the Table handle, went through Properties to Named
Expressions and created one named MyNamedExp with default value "mne_value"
Note that when I did this, the system in turn created a User Property
named MyNamedExp of type Expression.
Finally I dragged a Dynamic Text element into the first Footer cell and
entered:

this.getNamedExpressionValue("MyNamedExp")

On trying to preview the report, I get the following:

ReportDesign (id = 1):
+ There are errors evaluating script
"this.getNamedExpressionValue("MyNamedExp")":{1}.

Investigating the logfile under
workspace\.metadata\.plugins\org.eclipse.birt.report.viewer\ logs shows the
following:

SEVERE: TypeError: getNamedExpressionValue is not a function. (<inline>#1)
org.mozilla.javascript.EcmaError: TypeError: getNamedExpressionValue is
not a function. (<inline>#1)

I tried changing the quote marks from double to single, no change. I also
tried this.parent (in case the dynamic text element doesn't see the
expression but the table as its parent would) - that failed with an
indication that this.parent yielded 'undefined'.
Re: Named Expressions Not Working - Sample Code [message #263661 is a reply to message #263652] Thu, 20 December 2007 19:50 Go to previous message
Eclipse UserFriend
Hi Richard

Because you have defined your name expression on the table.
this.getNamedExpressionValue will get the dynamic text's named expression.
So you should get table's namedexpression(dynamic text->cell->table
footer->table):

this.valueExpr=this.getParent().getParent().getParent().getN amedExpression( "MyNamedExp")


"Richard A. Polunsky" <rpolunsky@yahoo.com> wrote in message
news:3969f1403cf00c00da19b562ca7111dc$1@www.eclipse.org...
>I created a Data Source and Data Set.
> I dragged the Data Set onto the Layout, thus creating a Table with header
> and detail rows filled in.
> I clicked on the Table handle, went through Properties to Named
> Expressions and created one named MyNamedExp with default value
> "mne_value"
> Note that when I did this, the system in turn created a User Property
> named MyNamedExp of type Expression.
> Finally I dragged a Dynamic Text element into the first Footer cell and
> entered:
>
> this.getNamedExpressionValue("MyNamedExp")
>
> On trying to preview the report, I get the following:
>
> ReportDesign (id = 1): + There are errors evaluating script
> "this.getNamedExpressionValue("MyNamedExp")":{1}.
> Investigating the logfile under
> workspace\.metadata\.plugins\org.eclipse.birt.report.viewer\ logs shows the
> following:
>
> SEVERE: TypeError: getNamedExpressionValue is not a function. (<inline>#1)
> org.mozilla.javascript.EcmaError: TypeError: getNamedExpressionValue is
> not a function. (<inline>#1)
>
> I tried changing the quote marks from double to single, no change. I also
> tried this.parent (in case the dynamic text element doesn't see the
> expression but the table as its parent would) - that failed with an
> indication that this.parent yielded 'undefined'.
>
>
>
Previous Topic:How to convert Time to User's Time - Timezone?
Next Topic:Expression Builder: Missing Available Datasets
Goto Forum:
  


Current Time: Sat Jul 12 10:24:35 EDT 2025

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

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

Back to the top