Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Dynamic Font
Dynamic Font [message #56644] Tue, 12 July 2005 15:14 Go to next message
Joe Rybacki is currently offline Joe RybackiFriend
Messages: 36
Registered: July 2009
Member
Is there a way to change the font of a portion of text based on parameter
values?
Re: Dynamic Font [message #56887 is a reply to message #56644] Tue, 12 July 2005 18:05 Go to previous messageGo to next message
Stanley Wang is currently offline Stanley WangFriend
Messages: 81
Registered: July 2009
Member
Joe,

You can use a text item instead of a data/label item for your text.
Then, use the <value-of> tag in for text item. ROM text spec has
detailed info about the value-of tag.

Stanley Wang
BIRT Engine



Joe Rybacki wrote:
> Is there a way to change the font of a portion of text based on parameter
> values?
>
>
Re: Dynamic Font [message #59169 is a reply to message #56887] Fri, 15 July 2005 17:12 Go to previous messageGo to next message
Joe Rybacki is currently offline Joe RybackiFriend
Messages: 36
Registered: July 2009
Member
I've added a text item and i'm running into the following problem with the
value-of tag:

<I>

<VALUE-OF format="html">

var value;

value="test";

value;

</VALUE-OF>

</I>

gives the error:

There are errors on the report page:
Error1:Invalid Javascript expression: null
The expression cannot be null or empty
The expression cannot be null or empty



So then I went to the rom spec for an example and tried the following and
got the error below

<value-of format="html">

String value;

if ( 10.24 < 0 )

value = "<span style=\"red\"";

value += format( 10.24, "(##,###.##)" );

if ( 10.24 < 0 )

value += "</span>";

value;

</value-of>

There are errors on the report page:
Error1:Invalid Javascript expression: String value; if ( 10.24 < 0 ) value =
"
missing ; before statement
missing ; before statement

Anyone tried this?

"Stanley Wang" <swang@actuate.com> wrote in message
news:db10no$vg4$4@news.eclipse.org...
> Joe,
>
> You can use a text item instead of a data/label item for your text. Then,
> use the <value-of> tag in for text item. ROM text spec has detailed info
> about the value-of tag.
>
> Stanley Wang
> BIRT Engine
>
>
>
> Joe Rybacki wrote:
>> Is there a way to change the font of a portion of text based on parameter
>> values?
Re: Dynamic Font [message #61664 is a reply to message #59169] Mon, 25 July 2005 13:55 Go to previous message
Joe Rybacki is currently offline Joe RybackiFriend
Messages: 36
Registered: July 2009
Member
For all those interested...after much pain here's how to have 2 fonts based
on some condition:

<span style="font-family: ARIAL; font-size: 36;">

<VALUE-OF contentType="HTML">

var value='*'+row["value"]+'*';

if(barcodeFont=="ARIAL"){

value;

}else{

value="";

value;

}

</VALUE-OF>

</span>

<span style="font-family: COURIER; font-size: 36;">

<VALUE-OF contentType="HTML">

var value='*'+row["value"]+'*';

if(font=="COURIER"){

value;

}else{

value="";

value;

}

</VALUE-OF>

</span>


"Joe Rybacki" <Joe.Rybacki@dynetics.com> wrote in message
news:db8qq9$opg$1@news.eclipse.org...
> I've added a text item and i'm running into the following problem with the
> value-of tag:
>
> <I>
>
> <VALUE-OF format="html">
>
> var value;
>
> value="test";
>
> value;
>
> </VALUE-OF>
>
> </I>
>
> gives the error:
>
> There are errors on the report page:
> Error1:Invalid Javascript expression: null
> The expression cannot be null or empty
> The expression cannot be null or empty
>
>
>
> So then I went to the rom spec for an example and tried the following and
> got the error below
>
> <value-of format="html">
>
> String value;
>
> if ( 10.24 < 0 )
>
> value = "<span style=\"red\"";
>
> value += format( 10.24, "(##,###.##)" );
>
> if ( 10.24 < 0 )
>
> value += "</span>";
>
> value;
>
> </value-of>
>
> There are errors on the report page:
> Error1:Invalid Javascript expression: String value; if ( 10.24 < 0 ) value
> = "
> missing ; before statement
> missing ; before statement
>
> Anyone tried this?
>
> "Stanley Wang" <swang@actuate.com> wrote in message
> news:db10no$vg4$4@news.eclipse.org...
>> Joe,
>>
>> You can use a text item instead of a data/label item for your text. Then,
>> use the <value-of> tag in for text item. ROM text spec has detailed info
>> about the value-of tag.
>>
>> Stanley Wang
>> BIRT Engine
>>
>>
>>
>> Joe Rybacki wrote:
>>> Is there a way to change the font of a portion of text based on
>>> parameter values?
>
>
Previous Topic:formatting problems: an example of what i mean
Next Topic:using more than 2 data sets
Goto Forum:
  


Current Time: Thu Aug 29 13:00:16 GMT 2024

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

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

Back to the top