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

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


   * @return
   */
  public static boolean existsGroupWithColumnNames(List groups) {
    Iterator it = groups.iterator();
    while (it.hasNext()) {
      DJGroup group = (DJGroup) it.next();
      if (group.getLayout().isShowColumnName())
        return true;
    }
    return false;
  }
View Full Code Here


    super(jd,dr,layoutManager);
  }

  protected void registerEntity(Entity entity) {
    log.debug("registering group...");
    DJGroup columnsGroup = (DJGroup) entity;
    try {
      JRDesignGroup group = (JRDesignGroup)transformEntity(columnsGroup);
      getDjd().addGroup(group);
      //Variables are registered right after the group where they belong.
      String property = columnsGroup.getColumnToGroupBy().getColumnProperty().getProperty();
      ColumnsGroupVariablesRegistrationManager headerVariablesRM = new ColumnsGroupVariablesRegistrationManager(ColumnsGroupVariablesRegistrationManager.HEADER, property, getDjd(),getDynamicReport(),getLayoutManager());
      headerVariablesRM.registerEntities(columnsGroup.getHeaderVariables());
      ColumnsGroupVariablesRegistrationManager footerVariablesRM = new ColumnsGroupVariablesRegistrationManager(ColumnsGroupVariablesRegistrationManager.FOOTER, property, getDjd(),getDynamicReport(),getLayoutManager());
      footerVariablesRM.registerEntities(columnsGroup.getFooterVariables());
    } catch (JRException e) {
      throw new EntitiesRegistrationException(e.getMessage());
    }
  }
View Full Code Here

  }

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

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

    setBandFinalHeight((JRDesignBand) design.getPageFooter());
    setBandFinalHeight((JRDesignBand) design.getNoData());

    for (Iterator iter = design.getGroupsList().iterator(); iter.hasNext();) {
      JRGroup jrgroup = (JRGroup) iter.next();
      DJGroup djGroup = (DJGroup) getReferencesMap().get(jrgroup.getName());
      if (djGroup != null){
        setBandFinalHeight((JRDesignBand) jrgroup.getGroupHeader(),djGroup.getHeaderHeight().intValue(), djGroup.isFitHeaderHeightToContent());
        setBandFinalHeight((JRDesignBand) jrgroup.getGroupFooter(),djGroup.getFooterHeight().intValue(), djGroup.isFitFooterHeightToContent());
      } else {
        setBandFinalHeight((JRDesignBand) jrgroup.getGroupHeader());
        setBandFinalHeight((JRDesignBand) jrgroup.getGroupFooter());
      }
    }
View Full Code Here

 
  protected DJGroup getDJGroup(AbstractColumn col) {
    Iterator it = getReport().getColumnsGroups().iterator();
    while (it.hasNext()) {
      DJGroup group = (DJGroup) it.next();
      if (group.getColumnToGroupBy().equals(col))
        return group;
    }
    return null;
  }   
View Full Code Here

   * @return
   */
  protected boolean existsGroupWithColumnNames() {
    Iterator it = getReport().getColumnsGroups().iterator();
    while (it.hasNext()) {
      DJGroup group = (DJGroup) it.next();
      if (group.getLayout().isShowColumnName())
        return true;
    }
    return false;
 
View Full Code Here

      JRXmlWriter.writeReport(jr, filename, xmlEncoding);
    }

    protected static void compileOrLoadSubreports(DynamicReport dr, Map _parameters) throws JRException {
      for (Iterator iterator = dr.getColumnsGroups().iterator(); iterator.hasNext();) {
      DJGroup group = (DJGroup) iterator.next();

      //Header Subreports
      for (Iterator iterator2 = group.getHeaderSubreports().iterator(); iterator2.hasNext();) {
        Subreport subreport = (Subreport) iterator2.next();

        if (subreport.getDynamicReport() != null){
           compileOrLoadSubreports(subreport.getDynamicReport(),_parameters);
           JasperReport jp = generateJasperReport(subreport.getDynamicReport(), subreport.getLayoutManager(), _parameters);
           _parameters.put(jp.toString(), jp);
           subreport.setReport(jp);
        }

      }

      //Footer Subreports
      for (Iterator iterator2 = group.getFooterSubreports().iterator(); iterator2.hasNext();) {
        Subreport subreport = (Subreport) iterator2.next();

        if (subreport.getDynamicReport() != null){
          compileOrLoadSubreports(subreport.getDynamicReport(),_parameters);
          JasperReport jp = generateJasperReport(subreport.getDynamicReport(), subreport.getLayoutManager(), _parameters);
View Full Code Here

* @param _parameters
* @throws JRException
*/
  protected static void visitSubreports(DynamicReport dr, Map _parameters) throws JRException{
      for (Iterator iterator = dr.getColumnsGroups().iterator(); iterator.hasNext();) {
      DJGroup group = (DJGroup) iterator.next();

      //Header Subreports
      for (Iterator iterator2 = group.getHeaderSubreports().iterator(); iterator2.hasNext();) {
        Subreport subreport = (Subreport) iterator2.next();

        if (subreport.getDynamicReport() != null){
          visitSubreport(dr,subreport,_parameters);
          visitSubreports(subreport.getDynamicReport(),_parameters);
        }

      }

      //Footer Subreports
      for (Iterator iterator2 = group.getFooterSubreports().iterator(); iterator2.hasNext();) {
        Subreport subreport = (Subreport) iterator2.next();

        if (subreport.getDynamicReport() != null){
          visitSubreport(dr,subreport,_parameters);
          visitSubreports(subreport.getDynamicReport(),_parameters);
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

    this.globalVariablesGroup.addHeaderVariable(new DJGroupVariable(column, op, style));
    return this;
  }

  public FastReportBuilder addHeaderVariable(int groupNum, int colNumber, DJCalculation op, Style style) throws BuilderException {
    DJGroup group = getGroupByNumber(groupNum);
    PropertyColumn column = (PropertyColumn) report.getColumns().get(colNumber -1);
    if (style == null)
      style = numberStyle;

    DJGroupVariable columnsGroupVariable = new DJGroupVariable(column, op, style);
    group.getHeaderVariables().add(columnsGroupVariable);
    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.