Examples of DJGroupLabel


Examples of ar.com.fdvs.dj.domain.DJGroupLabel

          designTextField.setPositionType(JRDesignElement.POSITION_TYPE_FLOAT); //XXX changed to see what happens  (must come from the column position property)
          designTextField.setStretchType(JRDesignElement.STRETCH_TYPE_NO_STRETCH); //XXX changed to see what happens (must come from the column property)
          header.addElement(designTextField);
        }
      }
      DJGroupLabel label = columnsGroup.getFooterLabel()
      if (label != null /*&& !footerVariables.isEmpty()*/) {
        List footerVariables = columnsGroup.getFooterVariables();
        PropertyColumn col = columnsGroup.getColumnToGroupBy();
        JRDesignBand band = (JRDesignBand)jgroup.getGroupFooter();
        int x = 0, y = 0;
        //max width
        int width = getDesign().getPageWidth() - getDesign().getLeftMargin() - getDesign().getRightMargin();
        int height = label.getHeight();
        int yOffset = 0;
        if (label.getLabelPosition() == LabelPosition.LEFT) {
          DJGroupVariable lmvar = findLeftMostColumn(footerVariables);
       
          x = col.getPosX().intValue(); //label starts in the column-to-group-by x position
          y = findYOffsetForGroupLabel(band);
          if (lmvar != null) {
            AbstractColumn lmColumn = lmvar.getColumnToApplyOperation();
            width = lmColumn.getPosX().intValue() - x;
          }
          else
            width -= x;
          height = getFooterVariableHeight(columnsGroup);
        }
        else if (label.getLabelPosition() == LabelPosition.RIGHT) {
          DJGroupVariable rmvar = findRightMostColumn(footerVariables);         
         
          if (rmvar != null) {
            AbstractColumn rmColumn = rmvar.getColumnToApplyOperation();
            x = rmColumn.getPosX().intValue() + rmColumn.getWidth().intValue();
          }
          else
            x = col.getPosX().intValue(); //label starts in the column-to-group-by x position
          y = findYOffsetForGroupLabel(band);
          width -= x;
          height = getFooterVariableHeight(columnsGroup);
        }
        else if (label.getLabelPosition() == LabelPosition.TOP) {
          x = col.getPosX().intValue(); //label starts in the column-to-group-by x position
          width -= x;
          yOffset = height;
        }
        else if (label.getLabelPosition() == LabelPosition.BOTTOM) {
          x = col.getPosX().intValue(); //label starts in the column-to-group-by x position
          y = getFooterVariableHeight(columnsGroup);
          width -= x;
        }
        layoutGroupFooterLabels(columnsGroup, jgroup, x, y, width, height);
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJGroupLabel

   * @param djgroup
   * @param jgroup
   */
  protected void layoutGroupFooterLabels(DJGroup djgroup, JRDesignGroup jgroup, int x, int y, int width, int height) {
    //List footerVariables = djgroup.getFooterVariables();
    DJGroupLabel label = djgroup.getFooterLabel();
   
    //if (label == null || footerVariables.isEmpty())
      //return;
   
    //PropertyColumn col = djgroup.getColumnToGroupBy();
    JRDesignBand band = (JRDesignBand)jgroup.getGroupFooter();

//    log.debug("Adding footer group label for group " + djgroup);
   
    /*DJGroupVariable lmvar = findLeftMostColumn(footerVariables);
    AbstractColumn lmColumn = lmvar.getColumnToApplyOperation();
    int width = lmColumn.getPosX().intValue()  - col.getPosX().intValue();
   
    int yOffset = findYOffsetForGroupLabel(band);*/
   
    JRDesignExpression labelExp;
    if (label.isJasperExpression()) //a text with things like "$F{myField}"
      labelExp = ExpressionUtils.createStringExpression(label.getText());
    else if (label.getLabelExpression() != null){
      labelExp = ExpressionUtils.createExpression(jgroup.getName() + "_labelExpression", label.getLabelExpression());
    } else //a simple text
      //labelExp = ExpressionUtils.createStringExpression("\""+ Utils.escapeTextForExpression(label.getText())+ "\"");   
      labelExp = ExpressionUtils.createStringExpression("\""+ label.getText() + "\"");
    JRDesignTextField labelTf = new JRDesignTextField();
    labelTf.setExpression(labelExp);
    labelTf.setWidth(width);
    labelTf.setHeight(height);
    labelTf.setX(x);
    labelTf.setY(y);
    //int yOffsetGlabel = labelTf.getHeight();       
    labelTf.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
    applyStyleToElement(label.getStyle(), labelTf);
    band.addElement(labelTf);   
  }
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJGroupLabel

      //Build the expression for the variable
      String variableName = col.getGroupVariableName(type, djGroup.getColumnToGroupBy().getColumnProperty().getProperty());
     
      //Add the group label
      DJGroupLabel label = var.getLabel();
      JRDesignTextField labelTf = null;
      if (label != null){
        JRDesignExpression labelExp;
        if (label.isJasperExpression()) //a text with things like "$F{myField}"
          labelExp = ExpressionUtils.createStringExpression(label.getText());
        else if (label.getLabelExpression() != null){
          labelExp = ExpressionUtils.createExpression(variableName + "_labelExpression", label.getLabelExpression());
        } else //a simple text
          //labelExp = ExpressionUtils.createStringExpression("\""+ Utils.escapeTextForExpression(label.getText())+ "\"");
          labelExp = ExpressionUtils.createStringExpression("\""+ label.getText() + "\"");
        labelTf = new JRDesignTextField();
        labelTf.setExpression(labelExp);
        labelTf.setWidth(col.getWidth().intValue());
        labelTf.setHeight(label.getHeight());
        labelTf.setX(col.getPosX().intValue());
        labelTf.setY(yOffset);
        yOffsetGlabel = labelTf.getHeight();       
        if (inFooter){
          labelTf.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        }
        applyStyleToElement(label.getStyle(), labelTf);
        band.addElement(labelTf);
       
      }

      JRDesignExpression expression = new JRDesignExpression();
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJGroupLabel

   * @param djgroup
   * @param jgroup
   */
  protected void layoutGroupFooterLabels(DJGroup djgroup, JRDesignGroup jgroup) {
    List footerVariables = djgroup.getFooterVariables();
    DJGroupLabel label = djgroup.getFooterLabel();
   
    if (label == null || footerVariables.isEmpty())
      return;
   
    PropertyColumn col = djgroup.getColumnToGroupBy();
    JRDesignBand band = (JRDesignBand)jgroup.getGroupFooter();

//    log.debug("Adding footer group label for group " + djgroup);
   
    DJGroupVariable lmvar = findLeftMostColumn(footerVariables);
    AbstractColumn lmColumn = lmvar.getColumnToApplyOperation();
    int width = lmColumn.getPosX().intValue()  - col.getPosX().intValue();
   
    int yOffset = findYOffsetForGroupLabel(band);
   
    JRDesignExpression labelExp = ExpressionUtils.createStringExpression("\""+ label.getText() + "\"");
    JRDesignTextField labelTf = new JRDesignTextField();
    labelTf.setExpression(labelExp);
    labelTf.setWidth(width);
    labelTf.setHeight(getFooterVariableHeight(djgroup));
    labelTf.setX(col.getPosX().intValue()); //label starts in the column-to-group-by x position
    labelTf.setY(yOffset);
    int yOffsetGlabel = labelTf.getHeight();       
    labelTf.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
    applyStyleToElement(label.getStyle(), labelTf);
    band.addElement(labelTf);
     
   
   
  }
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJGroupLabel

    while (it.hasNext()) {
      DJGroupVariable var = (DJGroupVariable) it.next();
      AbstractColumn col = var.getColumnToApplyOperation();
     
      //Add the group label
      DJGroupLabel label = var.getLabel();
      if (label != null){
       
        JRDesignExpression labelExp = ExpressionUtils.createStringExpression("\""+ label.getText() + "\"");
        JRDesignTextField labelTf = new JRDesignTextField();
        labelTf.setExpression(labelExp);
        labelTf.setWidth(col.getWidth().intValue());
        labelTf.setHeight(label.getHeight());
        labelTf.setX(col.getPosX().intValue());
        labelTf.setY(yOffset);
        yOffsetGlabel = labelTf.getHeight();       
        if (inFooter){
          labelTf.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        }
        applyStyleToElement(label.getStyle(), labelTf);
        band.addElement(labelTf);
       
      }

      //Build the expression for the variable
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.