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

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


  }

  public DynamicReport build(){
    report.setOptions(options);
    if (globalFooterVariables != null || globalHeaderVariables != null) {
      DJGroup globalGroup = createDummyGroup();
      report.getColumnsGroups().add(0,globalGroup);
    }


    addGlobalCrosstabs();
View Full Code Here


  private void addGlobalCrosstabs() {
    //For header
    if (globalHeaderCrosstabs != null) {
      for (Iterator iterator = globalHeaderCrosstabs.iterator(); iterator.hasNext();) {
        DJCrosstab djcross = (DJCrosstab) iterator.next();
        DJGroup globalGroup = createDummyGroupForCrosstabs("crosstabHeaderGroup-" + globalHeaderCrosstabs.indexOf(djcross));
        globalGroup.getHeaderCrosstabs().add(djcross);
        report.getColumnsGroups().add(0,globalGroup);
      }
    }

    //For footer
    if (globalFooterCrosstabs != null) {
      for (Iterator iterator = globalFooterCrosstabs.iterator(); iterator.hasNext();) {
        DJCrosstab djcross = (DJCrosstab) iterator.next();
        DJGroup globalGroup = createDummyGroupForCrosstabs("crosstabFooterGroup-" + globalFooterCrosstabs.indexOf(djcross));
        globalGroup.getFooterCrosstabs().add(djcross);
        report.getColumnsGroups().add(0,globalGroup);
      }
    }

  }
View Full Code Here

  protected void addSubreportsToGroups() {
    for (Iterator iterator = groupFooterSubreports.keySet().iterator(); iterator.hasNext();) {
      Integer groupNum = (Integer) iterator.next();
      List list = (List) groupFooterSubreports.get(groupNum);

      DJGroup group = (DJGroup) report.getColumnsGroups().get(groupNum.intValue() - 1);
      group.getFooterSubreports().addAll(list);
    }

    for (Iterator iterator = groupHeaderSubreports.keySet().iterator(); iterator.hasNext();) {
      Integer groupNum = (Integer) iterator.next();
      List list = (List) groupHeaderSubreports.get(groupNum);

      DJGroup group = (DJGroup) report.getColumnsGroups().get(groupNum.intValue() - 1);
      group.getHeaderSubreports().addAll(list);
    }

  }
View Full Code Here

   * adds the subreport.
   */
  protected void concatenateReports() {

    if (!concatenatedReports.isEmpty()){ // dummy group for page break if needed
      DJGroup globalGroup = createDummyGroup();
      report.getColumnsGroups().add(0,globalGroup);
    }
    for (Iterator iterator = concatenatedReports.iterator(); iterator.hasNext();) {
      Subreport subreport = (Subreport) iterator.next();
      DJGroup globalGroup = createDummyGroup();
      globalGroup.getFooterSubreports().add(subreport);
      report.getColumnsGroups().add(0,globalGroup);
    }
  }
View Full Code Here

  /**
   * @return
   */
  private DJGroup createDummyGroup() {
    DJGroup globalGroup = new DJGroup();
    globalGroup.setLayout(GroupLayout.EMPTY);
    GlobalGroupColumn globalCol = new GlobalGroupColumn("global");
    globalCol.setTitle(grandTotalLegend);
    globalCol.setHeaderStyle(grandTotalStyle);
    globalCol.setStyle(grandTotalStyle);

    globalGroup.setColumnToGroupBy(globalCol);
    globalGroup.setHeaderVariables(globalHeaderVariables);
    globalGroup.setFooterVariables(globalFooterVariables);
    return globalGroup;
  }
View Full Code Here

    globalGroup.setFooterVariables(globalFooterVariables);
    return globalGroup;
  }

  private DJGroup createDummyGroupForCrosstabs(String name) {
    DJGroup globalGroup = new DJGroup();
    globalGroup.setLayout(GroupLayout.EMPTY);
    GlobalGroupColumn globalCol = new GlobalGroupColumn(name );

    globalCol.setTitle(grandTotalLegend);
    globalCol.setHeaderStyle(grandTotalStyle);
    globalCol.setStyle(grandTotalStyle);

    globalGroup.setColumnToGroupBy(globalCol);
    return globalGroup;
  }
View Full Code Here

   * @return
   */
  protected List getVisibleColumns() {
    List visibleColums = new ArrayList(getReport().getColumns());
    for (Iterator iterator = getReport().getColumnsGroups().iterator(); iterator.hasNext();) {
      DJGroup group = (DJGroup) iterator.next();
      if (group.getLayout().isHideColumn()){
        visibleColums.remove(group.getColumnToGroupBy());
      }
    }
    return visibleColums;
  }
View Full Code Here

   */
  protected void layoutGroups() {
    log.debug("Starting groups layout...");
    int i = 0;
    for (Iterator iter = getReport().getColumnsGroups().iterator(); iter.hasNext();) {
      DJGroup columnsGroup = (DJGroup) iter.next();
//      JRDesignGroup jgroup = (JRDesignGroup) getDesign().getGroupsList().get(i++);
      JRDesignGroup jgroup = getJRGroupFromDJGroup(columnsGroup);

      jgroup.setStartNewPage(columnsGroup.getStartInNewPage().booleanValue());
      jgroup.setStartNewColumn(columnsGroup.getStartInNewColumn().booleanValue());

      JRDesignBand header = (JRDesignBand) jgroup.getGroupHeader();
      JRDesignBand footer = (JRDesignBand) jgroup.getGroupFooter();
      header.setHeight(columnsGroup.getHeaderHeight().intValue());
      footer.setHeight(columnsGroup.getFooterHeight().intValue());

      header.setSplitAllowed(columnsGroup.isAllowHeaderSplit());
      footer.setSplitAllowed(columnsGroup.isAllowFooterSplit());

      if (columnsGroup.getLayout().isPrintHeaders()) {
        boolean found = false;
        boolean skipPreviousGroupHeaders = false;
        int groupIdx = getReport().getColumnsGroups().indexOf(columnsGroup);
        if (groupIdx>0){
          DJGroup prevG =  (DJGroup) getReport().getColumnsGroups().get(groupIdx-1);
          skipPreviousGroupHeaders = !prevG.getLayout().isShowValueForEachRow();
        }
        for (Iterator iterator =  getVisibleColumns().iterator(); iterator.hasNext();) {
          AbstractColumn col = (AbstractColumn) iterator.next();

          //If in a nested group, header for column prior to this groups column
View Full Code Here

  }

  protected void transformDetailBandTextField(AbstractColumn column, JRDesignTextField textField) {
    //TODO: Set default characters when null values are found.
    log.debug("transforming detail band text field...");
    DJGroup group = DynamicJasperHelper.getColumnGroup(column, getReport().getColumnsGroups());
    if (group!=null&&!group.getLayout().isShowValueForEachRow()) {
      textField.setExpression(null); //this way, the textfield is not added to the band
    }
  }
View Full Code Here

    }
    return this;
  }

  public FastReportBuilder setGroupLayout(int groupNumber, GroupLayout layout) throws BuilderException {
    DJGroup group = getGroupByNumber(groupNumber);
    group.setLayout(layout);
    return this;
  }
View Full Code Here

TOP

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

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.