Dynamic Text [message #715293] |
Sat, 13 August 2011 06:22 |
karvesh ghunsam Messages: 95 Registered: July 2011 |
Member |
|
|
Dear All,
I am currently looking how to use the Dynamic text control in BIRT.
I am having an issue:
I have 3 fields in my dataset: Address1, Address2, Address3
I want to display the 3 fields concatenated in a dynamic text that i set to HTML and Dynamic. The 3 addresses are then separated by a comma (","). Yet, if an address is blank (""), i dont want to show it.
So, in the edit window, i added the following code with a javascript if statement:
if(<VALUE-OF>row["Add1"]</VALUE-OF> == "")
{
"";
}
else
{
<VALUE-OF>row["Add1"]</VALUE-OF> + ",";
}
Unfortunately, it does not seem to work. Could anyone please please advise me here how to use it properly?
Thanking you in advance
Karvesh
|
|
|
|
Re: Dynamic Text [message #715785 is a reply to message #715296] |
Mon, 15 August 2011 14:39 |
|
Try adding +"<br>" and use the format=HTML attribute:
<VALUE-OF format="HTML">if( true){
"<br>";
}</VALUE-OF>
Jason
On 8/13/2011 3:04 AM, karvesh wrote:
> Dear All,
>
> Myself again. After some searching and struggling, the nearest I could
> get to is:
>
> <VALUE-OF>if(row["Add1"] == "") {"";}else{row["Add1"]+",
> \n";}</VALUE-OF> <VALUE-OF>if(row["Add2"] == "")
> {"";}else{row["Add2"]+", \n";}</VALUE-OF> <VALUE-OF>if(row["Add3"] ==
> "") {"";}else{row["Add3"];}</VALUE-OF>
>
> It seems to handle it ok. The only issue now is that i cannot get the
> addresses to appear on a separate line. The javascript special character
> for new line "\n" does not seem to force the following addresses on a
> new line...
>
> Any idea here please?
>
> Thanks in advance
> Karvesh
|
|
|
|
Powered by
FUDForum. Page generated in 0.02472 seconds