Package ar.com.fdvs.dj.domain.entities.columns

Examples of ar.com.fdvs.dj.domain.entities.columns.ExpressionColumn


        if ( propertyColumn.getColumnProperty() != null && !(entity instanceof ExpressionColumn)){
          getDjd().addField((JRField)transformEntity(entity));
        }
        if (entity instanceof ExpressionColumn) {
          //The Custom Expression parameter must be registered
          ExpressionColumn expressionColumn = (ExpressionColumn) entity;
//          ArrayList l = new ArrayList(getColumns());
//          for (Iterator iter = getDynamicReport().getFields().iterator(); iter.hasNext();) {
//            ColumnProperty columnProperty = (ColumnProperty) iter.next();
//            SimpleColumn simpleColumn = new SimpleColumn();
//            simpleColumn.setColumnProperty(columnProperty);
//            l.add(simpleColumn);
//
//          }
          expressionColumn.setColumns( getDynamicReport().getAllFields() );
          expressionColumn.setVariables( new ArrayList(getDjd().getVariablesList()) );
          String property_name = expressionColumn.getColumnProperty().getProperty();
          registerExpressionColumnParameter(property_name, expressionColumn.getExpression());
          registerExpressionColumnParameter(property_name + "_calc", expressionColumn.getExpressionForCalculation());
        }
      } catch (JRException e) {
        log.info(FIELD_ALREADY_REGISTERED);
      }
    }
View Full Code Here


  /**
   * For creating expression columns
   * @return
   */
  protected AbstractColumn buildExpressionColumn() {
    ExpressionColumn column = new ExpressionColumn();
    populateCommonAttributes(column);
    int random = new Random().nextInt();
    column.setColumnProperty(new ColumnProperty("expressionColumn" + random,CustomExpression.class.getName()));
    column.setExpression(customExpression);
    column.setExpressionToGroupBy(customExpressionToGroupBy);
    column.setExpressionForCalculation(customExpressionForCalculation);
//    column.getFieldProperties().putAll(fieldProperties);
    return column;
  }
View Full Code Here

    //only variables from the last registered group are important now
    List groupsList = getDjd().getGroupsList();
    JRDesignGroup registeredGroup = (JRDesignGroup)groupsList.get(groupsList.size()-1);

    if (col instanceof ExpressionColumn && ((ExpressionColumn)col).getExpressionForCalculation() != null){
      ExpressionColumn expcol = (ExpressionColumn)col;
      expression.setText(expcol.getTextForExpressionForCalculartion());
      expression.setValueClassName(expcol.getExpressionForCalculation().getClassName());
    } else {
      expression.setText(col.getTextForExpression());
      expression.setValueClassName(col.getValueClassNameForExpression());
    }
   
View Full Code Here

     
    } else {
      AbstractColumn col = columnsGroupVariable.getColumnToApplyOperation();
     
      if (col instanceof ExpressionColumn && ((ExpressionColumn)col).getExpressionForCalculation() != null){
        ExpressionColumn expcol = (ExpressionColumn)col;
        expression.setText(expcol.getTextForExpressionForCalculartion());
        expression.setValueClassName(expcol.getExpressionForCalculation().getClassName());
      }
      else {
        expression.setText(col.getTextForExpression());
        expression.setValueClassName(col.getValueClassNameForExpression());
      }
View Full Code Here

    if (expressionToGroupBy != null) { //new in 3.0.7-b5
      useVariableForCustomExpression(group, jrExpression, expressionToGroupBy);
     
    } else {
      if (column instanceof ExpressionColumn){
        ExpressionColumn col = (ExpressionColumn)column;
        CustomExpression customExpression = col.getExpression();
        useVariableForCustomExpression(group, jrExpression, customExpression);
      } else {
        jrExpression.setText(column.getTextForExpression());
        jrExpression.setValueClassName(column.getValueClassNameForExpression());
      }
View Full Code Here

    JRDesignGroup registeredGroup = (JRDesignGroup)groupsList.get(groupsList.size()-1);
   
    String variableName = col.getGroupVariableName(type, columnToGroupByProperty);

    if (col instanceof ExpressionColumn && ((ExpressionColumn)col).getExpressionForCalculation() != null){
      ExpressionColumn expcol = (ExpressionColumn)col;
      expression.setText(expcol.getTextForExpressionForCalculartion());
      expression.setValueClassName(expcol.getExpressionForCalculation().getClassName());
    }
    else if (col instanceof PercentageColumn) {
      PercentageColumn pcol = (PercentageColumn) col;
      expression.setText(pcol.getPercentageColumn().getTextForExpression());
      expression.setValueClassName(pcol.getPercentageColumn().getValueClassNameForExpression());
View Full Code Here

            getDjd().addField(jrfield);
          }         
        }
        if (entity instanceof ExpressionColumn) {
          //The Custom Expression parameter must be registered
          ExpressionColumn expressionColumn = (ExpressionColumn) entity;
          expressionColumn.setColumns( getDynamicReport().getAllFields() );
          expressionColumn.setVariables( new ArrayList(getDjd().getVariablesList()) );
          String property_name = expressionColumn.getColumnProperty().getProperty();
          registerCustomExpressionParameter(property_name, expressionColumn.getExpression());
          registerCustomExpressionParameter(property_name + "_calc", expressionColumn.getExpressionForCalculation());
        }
      } catch (JRException e) {
        log.info("The field has already been registered" + ": " + e.getMessage() + ", (skipping)");
      }
    }
View Full Code Here

  /**
   * For creating expression columns
   * @return
   */
  protected AbstractColumn buildExpressionColumn() {
    ExpressionColumn column = new ExpressionColumn();
    populateCommonAttributes(column);
    long random_ = Math.abs(random.nextLong());
    column.setColumnProperty(new ColumnProperty("expressionColumn_" + random_,CustomExpression.class.getName()));
    column.setExpression(customExpression);
    column.setExpressionToGroupBy(customExpressionToGroupBy);
    column.setExpressionForCalculation(customExpressionForCalculation);
//    column.getFieldProperties().putAll(fieldProperties);
    return column;
  }
View Full Code Here

  /**
   * For creating expression columns
   * @return
   */
  protected AbstractColumn buildExpressionColumn() {
    ExpressionColumn column = new ExpressionColumn();
    populateCommonAttributes(column);
    long random_ = Math.abs(random.nextLong());
    column.setColumnProperty(new ColumnProperty("expressionColumn_" + random_,CustomExpression.class.getName()));
    column.setExpression(customExpression);
    column.setExpressionToGroupBy(customExpressionToGroupBy);
    column.setExpressionForCalculation(customExpressionForCalculation);
//    column.getFieldProperties().putAll(fieldProperties);
    return column;
  }
View Full Code Here

        if ( propertyColumn.getColumnProperty() != null && !(entity instanceof ExpressionColumn)){
          getDjd().addField((JRField)transformEntity(entity));
        }
        if (entity instanceof ExpressionColumn) {
          //The Custom Expression parameter must be registered
          ExpressionColumn expressionColumn = (ExpressionColumn) entity;
          expressionColumn.setColumns( getDynamicReport().getAllFields() );
          expressionColumn.setVariables( new ArrayList(getDjd().getVariablesList()) );
          String property_name = expressionColumn.getColumnProperty().getProperty();
          registerCustomExpressionParameter(property_name, expressionColumn.getExpression());
          registerCustomExpressionParameter(property_name + "_calc", expressionColumn.getExpressionForCalculation());
        }
      } catch (JRException e) {
        log.info(FIELD_ALREADY_REGISTERED);
      }
    }
View Full Code Here

TOP

Related Classes of ar.com.fdvs.dj.domain.entities.columns.ExpressionColumn

Copyright © 2018 www.massapicom. 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.