Examples of DJCrosstabColumn


Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

      text = createAutomaticMainHeaderTitle();
    else if (djcross.getMainHeaderTitle() != null)
      text = "\"" + djcross.getMainHeaderTitle() "\"";

    for (Iterator iterator = djcross.getColumns().iterator(); iterator.hasNext();) {
      DJCrosstabColumn col = (DJCrosstabColumn) iterator.next();
      auxHeight += col.getHeaderHeight();
    }
    for (Iterator iterator = djcross.getRows().iterator(); iterator.hasNext();) {
      DJCrosstabRow row = (DJCrosstabRow) iterator.next();
      auxWidth += row.getHeaderWidth();
    }
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

   * @return
   */
  private String createAutomaticMainHeaderTitle() {
    String text = "";
    for (Iterator iterator = djcross.getColumns().iterator(); iterator.hasNext();) {
      DJCrosstabColumn col = (DJCrosstabColumn) iterator.next();
//      auxHeight += col.getHeaderHeight();
      text += col.getTitle();
      if (iterator.hasNext())
        text += ", ";
    }
    text += "\\nvs.\\n";
    for (Iterator iterator = djcross.getRows().iterator(); iterator.hasNext();) {
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

      } catch (JRException e) {
        log.error(e.getMessage(),e);
      }
    }
    for (int i = cols.length-1; i >= 0; i--) {
      DJCrosstabColumn crosstabColumn = cols[i];
      JRDesignField field = new JRDesignField();
      field.setName(crosstabColumn.getProperty().getProperty());
      field.setValueClassName(crosstabColumn.getProperty().getValueClassName());
      try {
        jrDataset.addField(field);
      } catch (JRException e) {
        log.error(e.getMessage(),e);
      }
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

     *
     * where the col(n) is the outer most column, and row(n) is the outer most row in the crosstab
     *
     * The cell with null/null is the inner most cell in the crosstab
     */
    DJCrosstabColumn auxCol = new DJCrosstabColumn();
    DJCrosstabRow auxRow = new DJCrosstabRow();
    try {
      BeanUtils.copyProperties(auxCol, djcross.getColumns().get(djcross.getColumns().size()-1));
      BeanUtils.copyProperties(auxRow, djcross.getRows().get(djcross.getRows().size()-1));
    } catch (Exception e) {
      log.error(e.getMessage(),e); //must not happend
    }
    auxCol.setProperty(null);
    auxRow.setProperty(null);

    List auxColsList = new ArrayList(djcross.getColumns());
    auxColsList.add(auxCol);
    List auxRowsList = new ArrayList(djcross.getRows());
    auxRowsList.add(auxRow);

    DJCrosstabColumn[] auxCols = (DJCrosstabColumn[]) auxColsList.toArray(new DJCrosstabColumn[]{});
    DJCrosstabRow[] auxRows = (DJCrosstabRow[]) auxRowsList.toArray(new DJCrosstabRow[]{});


    for (int i = auxCols.length-1; i >= 0; i--) {
      for (int j =  auxRows.length-1; j >= 0; j--) {
        DJCrosstabColumn crosstabColumn = auxCols[i];
        DJCrosstabRow crosstabRow = auxRows[j];

        JRDesignCrosstabCell cell = new JRDesignCrosstabCell();

        cell.setWidth(new Integer(crosstabColumn.getWidth()));
        cell.setHeight(new Integer(crosstabRow.getHeight()));

        if (crosstabColumn.getProperty() != null)
          cell.setColumnTotalGroup(crosstabColumn.getProperty().getProperty());

        if (crosstabRow.getProperty() != null)
          cell.setRowTotalGroup(crosstabRow.getProperty().getProperty());


        JRDesignCellContents contents = new JRDesignCellContents();

        JRDesignTextField element = new JRDesignTextField();
        element.setWidth(crosstabColumn.getWidth());
        element.setHeight(crosstabRow.getHeight());

        JRDesignExpression measureExp = new JRDesignExpression();
        DJCrosstabMeasure measure = djcross.getMeasure(0);
        measureExp.setValueClassName(measure.getProperty().getValueClassName());
        measureExp.setText("$V{"+measure.getProperty().getProperty()+"}");

        element.setExpression(measureExp);

        /**
         * Is there any style for this object?
         */
        if (crosstabRow.getProperty() == null && crosstabColumn.getProperty() == null && measure.getStyle() != null ){
          //this is the inner most cell
          layoutManager.applyStyleToElement(measure.getStyle() , element);
        } else if (crosstabRow.getTotalStyle() != null) {
          layoutManager.applyStyleToElement(crosstabRow.getTotalStyle(), element);
        }
        else if (crosstabColumn.getTotalStyle() != null) {
          layoutManager.applyStyleToElement(crosstabColumn.getTotalStyle(), element);
        }

//        if ((i == auxCols.length-1 &&  j != auxRows.length-1) || (i != auxCols.length-1 &&  j != auxRows.length-1)){
//          cell.setWidth(Integer.valueOf( 100));
//        }
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

  /**
   * Registers the Columngroup Buckets and creates the header cell for the columns
   */
  private void registerColumns() {
    for (int i = 0; i < cols.length; i++) {
      DJCrosstabColumn crosstabColumn = cols[i];

      JRDesignCrosstabColumnGroup ctColGroup = new JRDesignCrosstabColumnGroup();
      ctColGroup.setName(crosstabColumn.getProperty().getProperty());
      ctColGroup.setHeight(crosstabColumn.getHeaderHeight());

      JRDesignCrosstabBucket bucket = new JRDesignCrosstabBucket();

      JRDesignExpression bucketExp = ExpressionUtils.createExpression("$F{"+crosstabColumn.getProperty().getProperty()+"}", crosstabColumn.getProperty().getValueClassName());
      bucket.setExpression(bucketExp);

      ctColGroup.setBucket(bucket);

      JRDesignCellContents colHeaerContent = new JRDesignCellContents();
      JRDesignTextField colTitle = new JRDesignTextField();

      JRDesignExpression colTitleExp = new JRDesignExpression();
      colTitleExp.setValueClassName(crosstabColumn.getProperty().getValueClassName());
      colTitleExp.setText("$V{"+crosstabColumn.getProperty().getProperty()+"}");


      colTitle.setExpression(colTitleExp);
      colTitle.setWidth(crosstabColumn.getWidth());
      colTitle.setHeight(crosstabColumn.getHeaderHeight());

      //The height can be the sum of the heights of all the columns starting from the current one, up to the inner most one.
      int auxWidth = calculateRowHeaderMaxWidth(crosstabColumn);
      colTitle.setWidth(auxWidth);

      if (crosstabColumn.getHeaderStyle() != null)
        layoutManager.applyStyleToElement(crosstabColumn.getHeaderStyle(),colTitle);


      colHeaerContent.addElement(colTitle);
      colHeaerContent.setBackcolor(colors[i][rows.length-1]);
      colHeaerContent.setMode(new Byte(Transparency.OPAQUE.getValue()));
      applyCellBorder(colHeaerContent);

      ctColGroup.setHeader(colHeaerContent);

      if (crosstabColumn.isShowTotals())
        createColumTotalHeader(ctColGroup,crosstabColumn);


      try {
        jrcross.addColumnGroup(ctColGroup);
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

    int auxWidth = 0;
    boolean firstTime = true;
    List auxList = new ArrayList(djcross.getColumns());
    Collections.reverse(auxList);
    for (Iterator iterator = auxList.iterator(); iterator.hasNext();) {
      DJCrosstabColumn col = (DJCrosstabColumn) iterator.next();

      if (col.equals(crosstabColumn)){
        if (auxWidth == 0)
          auxWidth = col.getWidth();
        break;
      }

      if (firstTime){
        auxWidth += col.getWidth();
        firstTime = false;
      }
      if (col.isShowTotals()) {
        auxWidth += col.getWidth();
      }
    }
    return auxWidth;
  }
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

    //The height can be the sum of the heights of all the columns starting from the current one, up to the inner most one.
    int auxWidth = 0;
    boolean found = false;
    for (Iterator iterator = djcross.getColumns().iterator(); iterator.hasNext();) {
      DJCrosstabColumn col = (DJCrosstabColumn) iterator.next();
      if (!col.equals(crosstabColumn) && found == false){
        continue;
      } else {
        found = true;
      }

      auxWidth += col.getHeaderHeight();
    }
    element.setHeight(auxWidth);

    applyCellBorder(totalHeaderContent);
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

    crosstab.setTopSpace(topSpace);
    return this;
  }

  public CrosstabBuilder addColumn(String title, String property, String className, boolean showTotal) {
    DJCrosstabColumn col = new CrosstabColumnBuilder()
      .setProperty(property,className)
      .setShowTotals(showTotal)
      .setTitle(title)
      .build();
    addColumn(col);
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

    addColumn(col);
    return this;
  }
  public CrosstabBuilder addColumn(String title, String property, String className, boolean showTotal,
      Style headerStyle, Style totalStyle, Style totalHeaderStyle) {
    DJCrosstabColumn col = new CrosstabColumnBuilder()
    .setProperty(property,className)
    .setShowTotals(showTotal)
    .setTitle(title)
    .setHeaderStyle(headerStyle)
    .setTotalHeaderStyle(totalHeaderStyle)
View Full Code Here

Examples of ar.com.fdvs.dj.domain.DJCrosstabColumn

    return this;
  }

  public CrosstabBuilder setColumnStyles(Style headerStyle, Style totalStyle, Style totalHeaderStyle) {
    for (Iterator iterator = crosstab.getColumns().iterator(); iterator.hasNext();) {
      DJCrosstabColumn col = (DJCrosstabColumn) iterator.next();
      col.setHeaderStyle(headerStyle);
      col.setTotalHeaderStyle(totalHeaderStyle);
      col.setTotalStyle(totalStyle);
    }
    return this;
  }
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.