Examples of JRDesignConditionalStyle


Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

  /**
   *
   */
  public Object createObject(Attributes atts)
  {
    JRDesignConditionalStyle style = new JRDesignConditionalStyle();
    JRDesignStyle parentStyle = (JRDesignStyle) digester.peek();

    style.setParentStyle(parentStyle);
    parentStyle.addConditionalStyle(style);

    return style;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

  /**
   *
   */
  public Object createObject(Attributes atts)
  {
    JRDesignConditionalStyle style = (JRDesignConditionalStyle) digester.peek();

    if (log.isWarnEnabled())
    {
      if (atts.getValue(JRXmlConstants.ATTRIBUTE_name) != null)
      {
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

          expression.setValueClass(Boolean.class);
          expression.setText(EXPRESSION_TRUE_WHEN_ODD);

          Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

          JRDesignConditionalStyle condStyle = new JRDesignConditionalStyle();
          condStyle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
          condStyle.setMode(JRDesignElement.MODE_OPAQUE);

          condStyle.setConditionExpression(expression);
          jrstyle.addConditionalStyle(condStyle);
          }
        }
        return textField;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

        expression.setValueClass(Boolean.class);
        expression.setText(EXPRESSION_TRUE_WHEN_ODD);

        Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

        JRDesignConditionalStyle condStyle = new JRDesignConditionalStyle();
        condStyle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
        condStyle.setMode(JRDesignElement.MODE_OPAQUE);

        condStyle.setConditionExpression(expression);
        jrstyle.addConditionalStyle(condStyle);
       
        return;
    }
     
    if (Utils.isEmpty(column.getConditionalStyles()))
      return;
   
    for (Iterator iterator = column.getConditionalStyles().iterator(); iterator.hasNext();) {
      ConditionalStyle condition = (ConditionalStyle) iterator.next();
     
      if (getReport().getOptions().isPrintBackgroundOnOddRows()
          && Transparency.TRANSPARENT == condition.getStyle().getTransparency() ){ //condition style + odd row (only if conditional style's background is transparent)
       
        JRDesignExpression expressionForConditionalStyle = getExpressionForConditionalStyle(condition, column);
        String expStr = JRExpressionUtil.getExpressionText(expressionForConditionalStyle);
       
        //ODD
        JRDesignExpression expressionOdd = new JRDesignExpression();
        expressionOdd.setValueClass(Boolean.class);
        expressionOdd.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_ODD+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");

        Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

        JRDesignConditionalStyle condStyleOdd = makeConditionalStyle( condition.getStyle());     
//        Utils.copyProperties(condStyleOdd, condition.getStyle().transform());
        condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
        condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
        condStyleOdd.setConditionExpression(expressionOdd);
        jrstyle.addConditionalStyle(condStyleOdd)
       
        //EVEN
        JRDesignExpression expressionEven = new JRDesignExpression();
        expressionEven.setValueClass(Boolean.class);
        expressionEven.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_EVEN+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");

        JRDesignConditionalStyle condStyleEven = makeConditionalStyle( condition.getStyle());     
        condStyleEven.setConditionExpression(expressionEven);
        jrstyle.addConditionalStyle(condStyleEven);       
             
      } else { //No odd row, just the conditional style
        JRDesignExpression expression = getExpressionForConditionalStyle(condition, column);
        JRDesignConditionalStyle condStyle = makeConditionalStyle( condition.getStyle());
        condStyle.setConditionExpression(expression);
        jrstyle.addConditionalStyle(condStyle);           
      }   
    }
   
    //The last condition is the basic one
    //ODD
    if (getReport().getOptions().isPrintBackgroundOnOddRows() ){
     
      JRDesignExpression expressionOdd = new JRDesignExpression();
      expressionOdd.setValueClass(Boolean.class);
      expressionOdd.setText(EXPRESSION_TRUE_WHEN_ODD);
 
      Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();
 
      JRDesignConditionalStyle condStyleOdd = new JRDesignConditionalStyle();
      condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
      condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
      condStyleOdd.setConditionExpression(expressionOdd);
     
      jrstyle.addConditionalStyle(condStyleOdd)
     
      //EVEN
      JRDesignExpression expressionEven = new JRDesignExpression();
      expressionEven.setValueClass(Boolean.class);
      expressionEven.setText(EXPRESSION_TRUE_WHEN_EVEN);
 
      JRDesignConditionalStyle condStyleEven = new JRDesignConditionalStyle();
      condStyleEven.setBackcolor(jrstyle.getBackcolor());
      condStyleEven.setMode(jrstyle.getMode());
      condStyleEven.setConditionExpression(expressionEven);
     
      jrstyle.addConditionalStyle(condStyleEven);   
    }
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

    }
  }

 
  protected JRDesignConditionalStyle makeConditionalStyle( Style style )  {
    JRDesignConditionalStyle condStyle = style.transformAsConditinalStyle();
    return condStyle;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

  public void setVerticalAlign(VerticalAlign verticalAlign) {
    this.verticalAlign = verticalAlign;
  }

  public JRDesignConditionalStyle transformAsConditinalStyle() {
    JRDesignConditionalStyle ret = new JRDesignConditionalStyle();
    setJRBaseStyleProperties(ret);
    return ret;
   
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

          expression.setValueClass(Boolean.class);
          expression.setText(EXPRESSION_TRUE_WHEN_ODD);

          Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

          JRDesignConditionalStyle condStyle = new JRDesignConditionalStyle();
          condStyle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
          condStyle.setMode(JRDesignElement.MODE_OPAQUE);

          condStyle.setConditionExpression(expression);
          jrstyle.addConditionalStyle(condStyle);
          }
        }
        return textField;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

        expression.setValueClass(Boolean.class);
        expression.setText(EXPRESSION_TRUE_WHEN_ODD);

        Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

        JRDesignConditionalStyle condStyle = new JRDesignConditionalStyle();
        condStyle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
        condStyle.setMode(JRDesignElement.MODE_OPAQUE);

        condStyle.setConditionExpression(expression);
        jrstyle.addConditionalStyle(condStyle);
       
        return;
    }
     
    if (Utils.isEmpty(column.getConditionalStyles()))
      return;
   
    for (Iterator iterator = column.getConditionalStyles().iterator(); iterator.hasNext();) {
      ConditionalStyle condition = (ConditionalStyle) iterator.next();
     
      if (getReport().getOptions().isPrintBackgroundOnOddRows()
          && JRDesignElement.MODE_TRANSPARENT == jrstyle.getMode().byteValue() ){//condition style + odd row (only if original background is transparent)
       
        JRDesignExpression expressionForConditionalStyle = getExpressionForConditionalStyle(condition, column);
        String expStr = JRExpressionUtil.getExpressionText(expressionForConditionalStyle);
       
        //ODD
        JRDesignExpression expressionOdd = new JRDesignExpression();
        expressionOdd.setValueClass(Boolean.class);
        expressionOdd.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_ODD+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");

        Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

        JRDesignConditionalStyle condStyleOdd = new JRDesignConditionalStyle();
        Utils.copyProperties(condStyleOdd, condition.getStyle().transform());
        condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
        condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
        condStyleOdd.setConditionExpression(expressionOdd);
       
        jrstyle.addConditionalStyle(condStyleOdd)
       
        //EVEN
        JRDesignExpression expressionEven = new JRDesignExpression();
        expressionEven.setValueClass(Boolean.class);
        expressionEven.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_EVEN+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");

        JRDesignConditionalStyle condStyleEven = new JRDesignConditionalStyle();
        Utils.copyProperties(condStyleEven, condition.getStyle().transform());
        condStyleEven.setBackcolor(jrstyle.getBackcolor());
        condStyleEven.setMode(jrstyle.getMode());
        condStyleEven.setConditionExpression(expressionEven);
       
        jrstyle.addConditionalStyle(condStyleEven);       
       
       
       
      } else { //No odd row, just the conditional style
        JRDesignExpression expression = getExpressionForConditionalStyle(condition, column);
        JRDesignConditionalStyle condStyle = new JRDesignConditionalStyle();
        condStyle.setConditionExpression(expression);
        jrstyle.addConditionalStyle(condStyle);           
      }
     
    }
   
    //The last condition is the basic one
    //ODD
    JRDesignExpression expressionOdd = new JRDesignExpression();
    expressionOdd.setValueClass(Boolean.class);
    expressionOdd.setText(EXPRESSION_TRUE_WHEN_ODD);

    Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

    JRDesignConditionalStyle condStyleOdd = new JRDesignConditionalStyle();
    condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
    condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
    condStyleOdd.setConditionExpression(expressionOdd);
   
    jrstyle.addConditionalStyle(condStyleOdd)
   
    //EVEN
    JRDesignExpression expressionEven = new JRDesignExpression();
    expressionEven.setValueClass(Boolean.class);
    expressionEven.setText(EXPRESSION_TRUE_WHEN_EVEN);

    JRDesignConditionalStyle condStyleEven = new JRDesignConditionalStyle();
    condStyleEven.setBackcolor(jrstyle.getBackcolor());
    condStyleEven.setMode(jrstyle.getMode());
    condStyleEven.setConditionExpression(expressionEven);
   
    jrstyle.addConditionalStyle(condStyleEven);   
   
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

      return;
   
    for (Iterator iterator = djmeasure.getConditionalStyles().iterator(); iterator.hasNext();) {
      ConditionalStyle condition = (ConditionalStyle) iterator.next();
      JRDesignExpression expression = getExpressionForConditionalStyle(condition, columExpression);
      JRDesignConditionalStyle condStyle = layoutManager.makeConditionalStyle( condition.getStyle());
      condStyle.setConditionExpression(expression);
      jrstyle.addConditionalStyle(condStyle)
    }
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.design.JRDesignConditionalStyle

        expression.setValueClass(Boolean.class);
        expression.setText(EXPRESSION_TRUE_WHEN_ODD);

        Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

        JRDesignConditionalStyle condStyle = new JRDesignConditionalStyle();
        condStyle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
        condStyle.setMode(JRDesignElement.MODE_OPAQUE);

        condStyle.setConditionExpression(expression);
        jrstyle.addConditionalStyle(condStyle);
       
        return;
    }
     
    if (Utils.isEmpty(column.getConditionalStyles()))
      return;
   
    for (Iterator iterator = column.getConditionalStyles().iterator(); iterator.hasNext();) {
      ConditionalStyle condition = (ConditionalStyle) iterator.next();
     
      if (getReport().getOptions().isPrintBackgroundOnOddRows()
          && JRDesignElement.MODE_TRANSPARENT == jrstyle.getMode().byteValue() ){//condition style + odd row (only if original background is transparent)
       
        JRDesignExpression expressionForConditionalStyle = getExpressionForConditionalStyle(condition, column);
        String expStr = JRExpressionUtil.getExpressionText(expressionForConditionalStyle);
       
        //ODD
        JRDesignExpression expressionOdd = new JRDesignExpression();
        expressionOdd.setValueClass(Boolean.class);
        expressionOdd.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_ODD+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");

        Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

        JRDesignConditionalStyle condStyleOdd = new JRDesignConditionalStyle();
        Utils.copyProperties(condStyleOdd, condition.getStyle().transform());
        condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
        condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
        condStyleOdd.setConditionExpression(expressionOdd);
       
        jrstyle.addConditionalStyle(condStyleOdd)
       
        //EVEN
        JRDesignExpression expressionEven = new JRDesignExpression();
        expressionEven.setValueClass(Boolean.class);
        expressionEven.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_EVEN+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");

        JRDesignConditionalStyle condStyleEven = new JRDesignConditionalStyle();
        Utils.copyProperties(condStyleEven, condition.getStyle().transform());
        condStyleEven.setBackcolor(jrstyle.getBackcolor());
        condStyleEven.setMode(jrstyle.getMode());
        condStyleEven.setConditionExpression(expressionEven);
       
        jrstyle.addConditionalStyle(condStyleEven);       
       
       
       
      } else { //No odd row, just the conditional style
        JRDesignExpression expression = getExpressionForConditionalStyle(condition, column);
        JRDesignConditionalStyle condStyle = new JRDesignConditionalStyle();
        condStyle.setConditionExpression(expression);
        jrstyle.addConditionalStyle(condStyle);           
      }
     
    }
   
    //The last condition is the basic one
    //ODD
    JRDesignExpression expressionOdd = new JRDesignExpression();
    expressionOdd.setValueClass(Boolean.class);
    expressionOdd.setText(EXPRESSION_TRUE_WHEN_ODD);

    Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

    JRDesignConditionalStyle condStyleOdd = new JRDesignConditionalStyle();
    condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
    condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
    condStyleOdd.setConditionExpression(expressionOdd);
   
    jrstyle.addConditionalStyle(condStyleOdd)
   
    //EVEN
    JRDesignExpression expressionEven = new JRDesignExpression();
    expressionEven.setValueClass(Boolean.class);
    expressionEven.setText(EXPRESSION_TRUE_WHEN_EVEN);

    JRDesignConditionalStyle condStyleEven = new JRDesignConditionalStyle();
    condStyleEven.setBackcolor(jrstyle.getBackcolor());
    condStyleEven.setMode(jrstyle.getMode());
    condStyleEven.setConditionExpression(expressionEven);
   
    jrstyle.addConditionalStyle(condStyleEven);   
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.