Jump to content
JasperReports Library 7.0 is now available ×

<bottomPen> inside <conditionalStyle>


sacunamgmail.com

Recommended Posts

I need to create two condition in a style that this work with a single datasorse's value. If a value is "IsBold" the text must be bold, but If the values is "IsEnclosed" the cell of the field must be framing

    <style name="styleNegraLineaLeft" style="row_style" radius="1" markup="none" pattern="" isStrikeThrough="false">
        <conditionalStyle>
            <conditionExpression><![CDATA[new Boolean($F{flgIsBold}==1)]]></conditionExpression>
            <style isBold="true" pdfFontName="Helvetica-Bold"/>
        </conditionalStyle>
        <conditionalStyle>
            <conditionExpression><![CDATA[new Boolean($F{flgIsEnclosed}==1)]]></conditionExpression>
            <style mode="Opaque" backcolor="#808080"/> <---- I need replace this
        </conditionalStyle>
    </style>

 

                            <textField>
                                <reportElement style="styleNegraLineaLeft" x="0" y="0" width="80" height="6" uuid="ff3dc74b-74a8-40cf-b548-60b6592f6a41"/>
                                <box topPadding="0" bottomPadding="0">
                                    <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                </box>
                                <textFieldExpression><![CDATA[$F{conceptName}+"["+$F{flgIsBold}+":"+$F{flgIsEnclosed}+"]"]]></textFieldExpression>
                            </textField>
 

 

Here will there be a soul that takes pity on my misery?

 

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Do you want to set the background color itself to a dynamic value or just that the TextBox has a colored background (the fixed color defined in the conditional style) ???

The first one isn't possible in the design, because the background-color is a static value and not an expression. So here you could use a scriptlet or something else to dynamically change the color value depending on a fieldvalue.

If just the predefined color from the condition isn't working, then try to delete all the box settings from the TextField.
I assume, this will override your conditional style settings, as it's explicitly set at the TextField.

Not tried... but worth to give it a try! :-)

hth + regards

C-Box

Link to comment
Share on other sites

Still not clear if:

A) just the opaque flag with the static background (e.g #808080 )  color should appear by a condition for a certain fieldvalue

or

b) the background-color itself depends on a condition (e.g. $F{someField}.equals("x") --> color = #808080  ...$F{someField}.equals("y") --> color = #505050  ....

or

c) the background-color itself should come from another field-value (e.g. $F{backgroundColor} )

??????

regards

C-Box

Link to comment
Share on other sites

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...