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

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


    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


      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

  }

  public static DJGroup getColumnGroup(AbstractColumn col, List groups) {
    Iterator it = groups.iterator();
    while (it.hasNext()) {
      DJGroup group = (DJGroup) it.next();
      if (group.getColumnToGroupBy().equals(col))
        return group;
    }
    return null;
  }
View Full Code Here

   * @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

   */
  public static JRDesignGroup getJRDesignGroup(DynamicJasperDesign jd, LayoutManager layoutManager, DJGroup group) {
    Map references = layoutManager.getReferencesMap();
    for (Iterator iterator = references.keySet().iterator(); iterator.hasNext();) {
      String groupName = (String) iterator.next();
      DJGroup djGroup = (DJGroup) references.get(groupName);
      if (group == djGroup) {
        return (JRDesignGroup) jd.getGroupsMap().get(groupName);
      }
    }
    return null;
View Full Code Here

  public static JRDesignGroup findParentJRGroup(DJGroup djgroup, DynamicReport dr, DynamicJasperDesign djd, LayoutManager layoutManager) {
    JRDesignGroup registeredGroup;
    int gidx = dr.getColumnsGroups().indexOf(djgroup);
    if (gidx > 0) {
      gidx--;
      DJGroup djParentGroup = (DJGroup) dr.getColumnsGroups().get(gidx);
      JRDesignGroup jrParentGroup = LayoutUtils.getJRDesignGroup(djd, layoutManager, djParentGroup);
      registeredGroup = jrParentGroup;
    } else
      registeredGroup = null;
    return registeredGroup;
View Full Code Here

      registeredGroup = null;
    return registeredGroup;
 

  public static DJGroup findChildDJGroup(DJGroup djgroup, DynamicReport dr) {
    DJGroup child = null;
    int gidx = dr.getColumnsGroups().indexOf(djgroup);
    if (gidx+1 < dr.getColumnsGroups().size()) {
      gidx++;
      child = (DJGroup) dr.getColumnsGroups().get(gidx);
    }
View Full Code Here

    super(jd,dr,layoutManager);
  }

  protected void registerEntity(Entity entity) {
    log.debug("registering group...");
    DJGroup djgroup = (DJGroup) entity;
    try {
      JRDesignGroup group = (JRDesignGroup)transformEntity(djgroup);
      getDjd().addGroup(group);
      //Variables are registered right after the group where they belong.
      String property = djgroup.getColumnToGroupBy().getColumnProperty().getProperty();
     
      if (djgroup.getFooterLabel() != null && djgroup.getFooterLabel().getLabelExpression() != null) {
        registerCustomExpressionParameter(group.getName() + "_labelExpression", djgroup.getFooterLabel().getLabelExpression());
      }

//      ColumnsGroupFieldVariablesRegistrationManager fieldVariablesRM = new ColumnsGroupFieldVariablesRegistrationManager(getDjd(),getDynamicReport(),getLayoutManager(), group);
//      fieldVariablesRM.registerEntities(djgroup.getFieldVariables());
     
      DJGroupVariableDefRegistrationManager variablesRM = new DJGroupVariableDefRegistrationManager(getDjd(),getDynamicReport(),getLayoutManager(), group);
      variablesRM.registerEntities(djgroup.getVariables());
     
      ColumnsGroupVariablesRegistrationManager headerVariablesRM = new ColumnsGroupVariablesRegistrationManager(ColumnsGroupVariablesRegistrationManager.HEADER, property, getDjd(),getDynamicReport(),getLayoutManager());
      headerVariablesRM.registerEntities(djgroup.getHeaderVariables());
     
      ColumnsGroupVariablesRegistrationManager footerVariablesRM = new ColumnsGroupVariablesRegistrationManager(ColumnsGroupVariablesRegistrationManager.FOOTER, property, getDjd(),getDynamicReport(),getLayoutManager());
      footerVariablesRM.registerEntities(djgroup.getFooterVariables());
     
      DJCrosstabRegistrationManager headerCrosstabsRm = new DJCrosstabRegistrationManager(ColumnsGroupVariablesRegistrationManager.HEADER, getDjd(),getDynamicReport(),getLayoutManager());
      headerCrosstabsRm.registerEntities(djgroup.getHeaderCrosstabs());
     
      DJCrosstabRegistrationManager footerCrosstabsRm = new DJCrosstabRegistrationManager(ColumnsGroupVariablesRegistrationManager.FOOTER, getDjd(),getDynamicReport(),getLayoutManager());
      footerCrosstabsRm.registerEntities(djgroup.getFooterCrosstabs());
    } catch (JRException e) {
      throw new EntitiesRegistrationException(e.getMessage(),e);
    }
  }
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();

    if (djgroup.getName() == null) {
      int groupIndex = getDynamicReport().getColumnsGroups().indexOf(djgroup);
      int columnIndex = getDynamicReport().getColumns().indexOf(djgroup.getColumnToGroupBy());
      if (column instanceof GlobalGroupColumn){
        djgroup.setName("global_column_" + groupIndex);
      } else {
        djgroup.setName( "group["+groupIndex+"]_for_column_" + columnIndex + "-" +  column.getName());
      }     
    }
    group.setName(djgroup.getName());
   
    getLayoutManager().getReferencesMap().put(group.getName(), djgroup);

    group.setCountVariable(new JRDesignVariable());
    group.setGroupFooter(new JRDesignBand());
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.