Skip to main content



      Home
Home » Archived » BIRT » Text element expressions
Text element expressions [message #88710] Tue, 08 November 2005 09:31 Go to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

Hi all...I was reading the spec for the text element
(http://www.eclipse.org/birt/ref/ROM_Text_SPEC.pdf) and in section 5.1 it
says:

The value-of tag identifies a value to insert into the text for a Text
element. The value-of
tag contains the expression to evaluate to obtain the data. Value-of tags
cannot be
inserted into text returned from the value expression property (i.e., it
can not be used
with data and multi-line data items).
For example:
Dear <value-of>
if [Sex] = “M” then “Mr.”
else if [Sex] = “F” then “Ms.”
</value-of> <value-of>row.firstName</value-of>
<value-of>row.lastName</value-of >,
<p>
<b>Thank you</b> for your purchase of an exciting new
<value-of> row.productName</value-of > on
<value-of> row.purchaseDate</value-of>.
The above shows that the value-of tag can encapsulate either a simple
value/expression, or a script.

My question is: what does the bracketed expression mean (if [Sex] = “M”
then “Mr.”)? What object/value does this use? (I understand brackets to
get script object properties or array elements, but this doesn't look like
either of those.)
Re: Text element expressions [message #89902 is a reply to message #88710] Thu, 10 November 2005 14:34 Go to previous message
Eclipse UserFriend
This spec was written before the implementation was fully decided. You must
use a valid JavaScript expression. I was unable to get the if, then, else
syntax to perform, so I checked the JavaScript documentation for valid
expression formats. After doing that, I successfully used the following:

<VALUE-OF>(row["custID"] > 200) ? row["Issues"] : "Customer level does not
permit an issue" </VALUE-OF>

I am using the 2.0 stable build 20051110.

--
Jane Tatchell
BIRT documentation lead

"Mark Lorenz" <mlorenz@nc.rr.com> wrote in message
news:42e7b7f6f90c7331848416ddcd6d12c8$1@www.eclipse.org...
> Hi all...I was reading the spec for the text element
> (http://www.eclipse.org/birt/ref/ROM_Text_SPEC.pdf) and in section 5.1 it
> says:
>
> The value-of tag identifies a value to insert into the text for a Text
> element. The value-of
> tag contains the expression to evaluate to obtain the data. Value-of tags
> cannot be
> inserted into text returned from the value expression property (i.e., it
> can not be used
> with data and multi-line data items).
> For example:
> Dear <value-of>
> if [Sex] =
Previous Topic:Get BIRT to close the output file
Next Topic:Has anyone gotten images to work?
Goto Forum:
  


Current Time: Fri May 09 21:26:23 EDT 2025

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

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

Back to the top