Jump to content
JasperReports Library 7.0 is now available ×

Print plain text when expression


2004 IR Help

Recommended Posts

By: hj1122 - hj1122

Print plain text when expression

2004-11-09 04:26

Hi all;

 

Just a quick question.

 

I'd like to display a plain text only when its x<0, is it possible to put the condition in the <printWhenExpression>? Is there any way I can return the value of x? Thanks in advance!

 

<staticText>

<reportElement

mode="Opaque"

x="-29"

y="2"

width="25"

height="41"

forecolor="#FFFFFF"

backcolor="#3366FF"

key="staticText-3"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false">

<printWhenExpression><![CDATA[this.x < 0 ? Boolean.TRUE : Boolean.FALSE]]></printWhenExpression>

</reportElement>

<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" lineSpacing="Single">

<font fontName="Helvetica" pdfFontName="Helvetica" size="10" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[only once]]></text>

</staticText>

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...