Jump to content
We've recently updated our Privacy Statement, available here ×

concurrent

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by concurrent

  1. Yes indeed, thank you kindly! I see I had some misconceptions about how the conditional trigger impacted the style.
  2. Hello, I'm using the Java API to build a report that uses an ArrayList of ArrayList of Objects (Strings or Doubles) as a DataSource and am having trouble mastering the conditional formatting at the cell level. I've searched the forums and based on what I have learned I have been able to create ConditionalStyles and apply them to a row -- the alternating row colour example is well-documented, for example. I am trying to have conditional cell-formatting for a Double value exceeding a high or a low threshold, I am very close, except that when a cell matches, the entire row of data where that cell is located is formatted with the condition format, not the individual cell. Any help appreciated, I haven't found a spelled-out API-based cell-specific conditional formatting example, but I have found plenty of row-specific examples. Thanks for any advice! Code:I am adding the fields to a band as follows (data is showing correctly in the report): for (JRField field : fields) { textField.setStyle(normalStyle); expression = new JRDesignExpression(); expression.setValueClass(field.getValueClass()); expression.setText("$F{"+field.getName()+"}"); textField.setExpression(expression); band.addElement(textField); } And the conditional formatting definition looks like: for (JRField field:fields) { JRDesignExpression conditionExpression = new JRDesignExpression(); JRDesignConditionalStyle cs = new JRDesignConditionalStyle(); conditionExpression.setValueClass(java.lang.Boolean.class); conditionExpression.setText("new Boolean($F{"+field.getName()+"} < 0.0)"); cs.setConditionExpression(conditionExpression); cs.setBold(true); cs.setBackcolor(new Color(0xFF, 0xC0, 0xC0)); normalStyle.addConditionalStyle(cs); }
×
×
  • Create New...