Examples of JRDesignGroup


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

  //PropertyColumn only can be used for grouping (not OperationColumn)
  protected Object transformEntity(Entity entity) {
    log.debug("transforming group...");
    ColumnsGroup columnsGroup = (ColumnsGroup) entity;
    PropertyColumn column = columnsGroup.getColumnToGroupBy();
    JRDesignGroup group = new JRDesignGroup();

    int groupIndex = getDynamicReport().getColumnsGroups().indexOf(columnsGroup);
    int columnIndex = getDynamicReport().getColumns().indexOf(columnsGroup.getColumnToGroupBy());
    if (column instanceof GlobalGroupColumn){
      group.setName("global_column_" + groupIndex);
    } else {
      group.setName( "group["+groupIndex+"]_for_column_" + columnIndex + "-" +  column.getTitle());
    }

    group.setCountVariable(new JRDesignVariable());
    group.setGroupFooter(new JRDesignBand());
    group.setGroupHeader(new JRDesignBand());

    JRDesignExpression jrExpression = new JRDesignExpression();
    jrExpression.setText(column.getTextForExpression());
    jrExpression.setValueClassName(column.getValueClassNameForExpression());

    group.setExpression(jrExpression);
    group.setCountVariable(new JRDesignVariable());

    return group;
  }
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.