sacunamgmail.com Posted May 22, 2019 Share Posted May 22, 2019 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 More sharing options...
C-Box Posted May 24, 2019 Share Posted May 24, 2019 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 + regardsC-Box Link to comment Share on other sites More sharing options...
sacunamgmail.com Posted May 28, 2019 Author Share Posted May 28, 2019 Thank for the interest. I really need to frame a TextField conditionally Link to comment Share on other sites More sharing options...
C-Box Posted May 28, 2019 Share Posted May 28, 2019 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 fieldvalueorb) the background-color itself depends on a condition (e.g. $F{someField}.equals("x") --> color = #808080 ...$F{someField}.equals("y") --> color = #505050 ....orc) the background-color itself should come from another field-value (e.g. $F{backgroundColor} )??????regardsC-Box Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now