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

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


    this.globalHeaderVariables.add(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


   * @param groupNum
   * @return
   * @throws BuilderException
   */
  private DJGroup getGroupByNumber(int groupNum) throws BuilderException {
    DJGroup group;
    try {
      group = (DJGroup) report.getColumnsGroups().get(groupNum-1);
    } catch (IndexOutOfBoundsException e) {
      throw new BuilderException("No such group, use addGroups(int) first");
    }
View Full Code Here

    this.globalFooterVariables.add(new DJGroupVariable(column, op, style));
    return this;
  }

  public FastReportBuilder addFooterVariable(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.getFooterVariables().add(columnsGroupVariable);
    return this;
  }
View Full Code Here

    group.getFooterVariables().add(columnsGroupVariable);
    return this;
  }

  public FastReportBuilder addHeaderCrosstab(int groupNumber, DJCrosstab djcross) throws BuilderException {
    DJGroup group = getGroupByNumber(groupNumber);
    group.getHeaderCrosstabs().add(djcross);
    return this;
  }
View Full Code Here

    DJGroup group = getGroupByNumber(groupNumber);
    group.getHeaderCrosstabs().add(djcross);
    return this;
  }
  public FastReportBuilder addFooterCrosstab(int groupNumber, DJCrosstab djcross) throws BuilderException {
    DJGroup group = getGroupByNumber(groupNumber);
    group.getFooterCrosstabs().add(djcross);
    return this;
  }
View Full Code Here

    super(jd,dr);
  }

  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.
      new ColumnsGroupVariablesRegistrationManager(ColumnsGroupVariablesRegistrationManager.HEADER, columnsGroup.getColumnToGroupBy().getColumnProperty().getProperty(), getDjd(),getDynamicReport()).registerEntities(columnsGroup.getHeaderVariables());
      new ColumnsGroupVariablesRegistrationManager(ColumnsGroupVariablesRegistrationManager.FOOTER, columnsGroup.getColumnToGroupBy().getColumnProperty().getProperty(), getDjd(),getDynamicReport()).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) {
    log.debug("transforming group...");
    DJGroup columnsGroup = (DJGroup) 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());
    }
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

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.