camilo.rodriguez17 Posted January 27, 2014 Share Posted January 27, 2014 Hi there!I have a problem with dynamic background color of textfield based on the value of field. I have the following textfields:$F{number1}$F{number2}$F{number3}.....I have a style:<style name="Color"> <conditionalStyle> <conditionExpression><![CDATA[$F{number1} == 1]]></conditionExpression> <style mode="Opaque" backcolor="red"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{number1} == 2]]></conditionExpression> <style mode="Opaque" backcolor="black"/> </conditionalStyle></style>[/code]The style 'Color' works for the textfield with field $F{number1}, but, I need apply that conditionExpression to others textfields(and every one have a different field associated), but I dont want duplicate the style for every field.Thanks for advance!!(I'm sorry for my bad english, if it's not clear please tell me) Link to comment Share on other sites More sharing options...
Ankur Gupta Posted January 28, 2014 Share Posted January 28, 2014 Hi,In order to achieve this scenario the most feasible method is what you have stated in you rquertion itself, that is creating several conditional styles, and it is not duplicating the styles, but if you are using iReport/Jaspersoft studio, then you can see that a single style can have several condional styling options so you need to apply only one style to all the textfeilds in the report and that will cater you needs according to the conditions. Hope that this helps,ThanksAnkur Guptahttp://ankurthetechie.blogspot.in/ Link to comment Share on other sites More sharing options...
camilo.rodriguez17 Posted January 28, 2014 Author Share Posted January 28, 2014 Ankurt thanks for your answer. I understand that you say, but if I apply the unique style with multiples "conditionalStyle", and apply the same style to every field(suppose that I have 80 fields), the generation time of the report will be higher? (I think so because the evaluation of every conditionalStyle take more time, but I'm not sure I'm a newbie with jasper) I see other software and I show that: BIRT or Reporting Services of Microsoft have the posibility to include my requeriment more faster and easy. :( .. thanks again for your help! Link to comment Share on other sites More sharing options...
dunham Posted April 18, 2018 Share Posted April 18, 2018 Ankur missed the point of the question Link to comment Share on other sites More sharing options...
Ankur Gupta Posted April 18, 2018 Share Posted April 18, 2018 Please enlighten us with your take on the question, so that it helps the community!! 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