Using Named Expressions or User Properties [message #263596] |
Wed, 19 December 2007 15:41  |
Eclipse User |
|
|
|
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: Named Expressions Not Working - Sample Code [message #263661 is a reply to message #263652] |
Thu, 20 December 2007 19:50  |
Eclipse User |
|
|
|
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'.
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04793 seconds