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

Examples of ar.com.fdvs.dj.domain.entities.ColumnsGroupVariable


  private Style defaultHeaderVariableStyle;

  public ColumnsGroup build(){
    //Apply Styles if any (for variables)
    for (Iterator iterator = group.getHeaderVariables().iterator(); iterator.hasNext();) {
      ColumnsGroupVariable var = (ColumnsGroupVariable) iterator.next();
      if (defaultHeaderVariableStyle != null)
        var.setStyle(defaultHeaderVariableStyle);
    }

    for (Iterator iterator = group.getFooterVariables().iterator(); iterator.hasNext();) {
      ColumnsGroupVariable var = (ColumnsGroupVariable) iterator.next();
      if (defaultFooterVariableStyle != null)
        var.setStyle(defaultFooterVariableStyle);
    }

    return group;
  }
View Full Code Here


    group.getHeaderVariables().add(variable);
    return this;
  }

  public GroupBuilder addHeaderVariable(AbstractColumn column, ColumnsGroupVariableOperation operation) {
    group.getHeaderVariables().add(new ColumnsGroupVariable(column,operation));
    return this;
  }
View Full Code Here

    group.getHeaderVariables().add(new ColumnsGroupVariable(column,operation));
    return this;
  }

  public GroupBuilder addHeaderVariable(AbstractColumn column, ColumnsGroupVariableOperation operation, Style style) {
    group.getHeaderVariables().add(new ColumnsGroupVariable(column,operation,style));
    return this;
  }
View Full Code Here

    group.getFooterVariables().add(variable);
    return this;
  }

  public GroupBuilder addFooterVariable(AbstractColumn column3, ColumnsGroupVariableOperation operation) {
    group.getFooterVariables().add(new ColumnsGroupVariable(column3,operation));
    return this;
  }
View Full Code Here

  public GroupBuilder addFooterVariable(AbstractColumn column3, ColumnsGroupVariableOperation operation) {
    group.getFooterVariables().add(new ColumnsGroupVariable(column3,operation));
    return this;
  }
  public GroupBuilder addFooterVariable(AbstractColumn column3, ColumnsGroupVariableOperation operation, Style style) {
    group.getFooterVariables().add(new ColumnsGroupVariable(column3,operation,style));
    return this;
  }
View Full Code Here

  private void placeVariableInBand(List variables, ColumnsGroup columnsGroup, JRDesignGroup jgroup, String type, JRDesignBand band, int yOffset) {
    log.debug("Placing variables in "+type+" band...");
    if ((variables != null)&&(variables.size()>0)) {
      Iterator it = variables.iterator();
      while (it.hasNext()) {
        ColumnsGroupVariable var = (ColumnsGroupVariable) it.next();
        AbstractColumn col = var.getColumnToApplyOperation();

        String variableName = col.getGroupVariableName(type, columnsGroup.getColumnToGroupBy().getColumnProperty().getProperty());

        JRDesignExpression expression = new JRDesignExpression();
        JRDesignTextField textField = new JRDesignTextField();
        expression.setText("$V{" + variableName + "}");
        expression.setValueClassName(col.getVariableClassName(var.getOperation()));
        if (var.getOperation() != ColumnsGroupVariableOperation.COUNT)
          textField.setPattern(col.getPattern());

        textField.setKey(variableName);
        textField.setExpression(expression);

        if (DJConstants.FOOTER.equals(type)){
          textField.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        }

        textField.setX(col.getPosX().intValue());
        if (yOffset!=0)
          textField.setY(yOffset);

//        textField.setHeight(columnsGroup.getHeaderHeight().intValue());
        textField.setHeight(2 + getReport().getOptions().getDetailHeight().intValue()); //XXX be carefull with the "2+ ..."
        textField.setWidth(col.getWidth().intValue());

        textField.setEvaluationTime(JRExpression.EVALUATION_TIME_GROUP);

        textField.setEvaluationGroup(jgroup);
        //Assign the style to the element.
        //First we look for the specific element style, then the default style for the group variables
        //and finally the column style.
        Style defStyle = DJConstants.HEADER.equals(type)?columnsGroup.getDefaulHeaderStyle():columnsGroup.getDefaulFooterStyle();

        if (var.getStyle() != null)
          applyStyleToElement(var.getStyle(), textField);
        else if (defStyle != null)
          applyStyleToElement(defStyle, textField);
        else
          applyStyleToElement(col.getStyle(), textField);


        band.addElement(textField);

      }

      if (columnsGroup.getColumnToGroupBy() instanceof GlobalGroupColumn) {
        int totalWidth = 0;

        ColumnsGroupVariable leftmostColumn = findLeftMostColumn(variables);
        totalWidth = leftmostColumn.getColumnToApplyOperation().getPosX().intValue();

        GlobalGroupColumn globalCol = (GlobalGroupColumn) columnsGroup.getColumnToGroupBy();

        JRDesignTextField globalTextField = new JRDesignTextField();
        JRDesignExpression globalExp = new JRDesignExpression();
View Full Code Here

    }
  }

  private ColumnsGroupVariable findLeftMostColumn(List variables) {
    int mostLeftX = Integer.MAX_VALUE;
    ColumnsGroupVariable mostLeftColumn =  null;
    for (Iterator iterator = variables.iterator(); iterator.hasNext();) {
      ColumnsGroupVariable currentCol = (ColumnsGroupVariable) iterator.next();
      if (currentCol.getColumnToApplyOperation().getPosX().intValue() <= mostLeftX) {
        mostLeftColumn = currentCol;
                mostLeftX = mostLeftColumn.getColumnToApplyOperation().getPosX().intValue();
            }
        }
    return mostLeftColumn;
View Full Code Here

   * @return
   */
  public DynamicReportBuilder addGlobalHeaderVariable(AbstractColumn col, ColumnsGroupVariableOperation op) {
    if (this.globalHeaderVariables == null)
      this.globalHeaderVariables = new ArrayList();
    this.globalHeaderVariables.add(new ColumnsGroupVariable(col, op));
    return this;
  }
View Full Code Here

  }

  public DynamicReportBuilder addGlobalHeaderVariable(AbstractColumn col, ColumnsGroupVariableOperation op, Style style) {
    if (this.globalHeaderVariables == null)
      this.globalHeaderVariables = new ArrayList();
    this.globalHeaderVariables.add(new ColumnsGroupVariable(col, op, style));
    return this;
  }
View Full Code Here

   * @return
   */
  public DynamicReportBuilder addGlobalFooterVariable(AbstractColumn col, ColumnsGroupVariableOperation op) {
    if (this.globalFooterVariables == null)
      this.globalFooterVariables = new ArrayList();
    this.globalFooterVariables.add(new ColumnsGroupVariable(col, op));
    return this;
  }
View Full Code Here

TOP

Related Classes of ar.com.fdvs.dj.domain.entities.ColumnsGroupVariable

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.