drummer54 Posted May 8, 2014 Posted May 8, 2014 Is there a way to create a single conditional style to apply to multiple fields and variables? For example, I have a report being populated from a SQL Server stored procedure that returns 12 fields, one per month, of data represented in percentages. For each month I need to set the background and foreground colors to one of 3 different combinations based on how the percent for that month falls within a specified range. I also have variables for each month that calculate these percentages at the region and company level. That gives me 12 fields and 24 variables to set a conditional style for. The only way I can figure out to do this is to create 36 different conditional styles, one for each field & variable. Is there an easier way to do this? It's quite cumbersome and tedious. Seems it would be much easier to create 3 styles and in each of the 36 objects set the style based on the value in that object.
djohnson53 Posted May 12, 2014 Posted May 12, 2014 drummer54,Does this thread help? http://community.jaspersoft.com/questions/526876/apply-same-conditional-style-many-fields
drummer54 Posted May 13, 2014 Author Posted May 13, 2014 That might help. Not being Java fluent (used it for a few months about 12 years ago but that's all) I'll have to study it. Thanks very much.
drummer54 Posted May 13, 2014 Author Posted May 13, 2014 I don't think that's going to help after all. The Java solution is far outside my comfort zone and the style solution won't work for me. I had thought that maybe it would work in a Pattern Expression but I can't find any documentation for Pattern Expression and my attempts at coding it compile & run but have no effect. Thanks, anyway.
drummer54 Posted June 2, 2014 Author Posted June 2, 2014 I created a Java class and created a jar file, but how do I add it to JasperSoft Studio and use it in an expression?Thanks.
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