Examples of DJCrosstabRow


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

    //The width can be the sum of the with of all the rows starting from the current one, up to the inner most one.
    int auxWidth = 0;
    boolean found = false;
    for (Iterator iterator = djcross.getRows().iterator(); iterator.hasNext();) {
      DJCrosstabRow row = (DJCrosstabRow) iterator.next();
      if (!row.equals(crosstabRow) && found == false){
        continue;
      } else {
        found = true;
      }

      auxWidth += row.getHeaderWidth();
    }
    element.setWidth(auxWidth);

    applyCellBorder(totalHeaderContent);
View Full Code Here

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

    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();
    }

    JRDesignExpression exp = ExpressionUtils.createStringExpression(text);
    element.setExpression(exp);
View Full Code Here

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

      if (iterator.hasNext())
        text += ", ";
    }
    text += "\\nvs.\\n";
    for (Iterator iterator = djcross.getRows().iterator(); iterator.hasNext();) {
      DJCrosstabRow row = (DJCrosstabRow) iterator.next();
//      auxWidth += row.getHeaderWidth();
      text += row.getTitle();
      if (iterator.hasNext())
        text += ", ";
    }
    text = "\"" + text + "\"";
    return text;
View Full Code Here

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

    JRDesignDataset jrDataset = new JRDesignDataset(false);
//    jrDataset.setName("sub1");

    for (int i =  rows.length-1; i >= 0; i--) {
      DJCrosstabRow crosstabRow = rows[i];
      JRDesignField field = new JRDesignField();
      field.setName(crosstabRow.getProperty().getProperty());
      field.setValueClassName(crosstabRow.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.DJCrosstabRow

     * 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);
        }

View Full Code Here

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

  /**
   * Register the Rowgroup buckets and places the header cells for the rows
   */
  private void registerRows() {
    for (int i =  0; i < rows.length; i++) {
      DJCrosstabRow crosstabRow = rows[i];

      JRDesignCrosstabRowGroup ctRowGroup = new JRDesignCrosstabRowGroup();
      ctRowGroup.setWidth(crosstabRow.getHeaderWidth());
      ctRowGroup.setName(crosstabRow.getProperty().getProperty());

      JRDesignCrosstabBucket rowBucket = new JRDesignCrosstabBucket();
      ctRowGroup.setBucket(rowBucket);

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


      JRDesignCellContents rowHeaderContents = new JRDesignCellContents();
      JRDesignTextField rowTitle = new JRDesignTextField();

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

      rowTitle.setExpression(rowTitExp);
      rowTitle.setWidth(crosstabRow.getHeaderWidth());

      //The width can be the sum of the with of all the rows starting from the current one, up to the inner most one.
      int auxHeight = getRowHeaderMaxHeight(crosstabRow);
//      int auxHeight = crosstabRow.getHeight(); //FIXME getRowHeaderMaxHeight() must be FIXED because it breaks when 1rs row sho total and 2nd doesnt
      rowTitle.setHeight(auxHeight);


      if (crosstabRow.getHeaderStyle() != null)
        layoutManager.applyStyleToElement(crosstabRow.getHeaderStyle(), rowTitle);

      rowHeaderContents.addElement(rowTitle);
      rowHeaderContents.setBackcolor(colors[cols.length-1][i]);
//      rowHeaderContents.setBackcolor(colors[0][0]);
//      rowHeaderContents.setBackcolor(Color.blue);
      rowHeaderContents.setMode(new Byte(Transparency.OPAQUE.getValue()));
      applyCellBorder(rowHeaderContents);

      ctRowGroup.setHeader(rowHeaderContents );

      if (crosstabRow.isShowTotals())
        createRowTotalHeader(ctRowGroup,crosstabRow);


      try {
        jrcross.addRowGroup(ctRowGroup);
View Full Code Here

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

   */
  private int getRowHeaderMaxHeight(DJCrosstabRow crosstabRow) {
    int auxHeight = crosstabRow.getHeight();
    boolean found = false;
    for (Iterator iterator = djcross.getRows().iterator(); iterator.hasNext();) {
      DJCrosstabRow row = (DJCrosstabRow) iterator.next();
      if (!row.equals(crosstabRow) && found == false){
        continue;
      } else {
        found = true;
      }

      if (row.equals(crosstabRow))
        continue;

      if (crosstabRow.isShowTotals())
        auxHeight += row.getHeight();
    }
    return auxHeight;
  }
View Full Code Here

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

    .build();
    addColumn(col);
    return this;
  }
  public CrosstabBuilder addRow(String title, String property, String className, boolean showTotal) {
    DJCrosstabRow row = new CrosstabRowBuilder()
      .setProperty(property,className)
      .setShowTotals(showTotal)
      .setTitle(title)
      .build();
    addRow(row);
View Full Code Here

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

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

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

    return this;
  }

  public CrosstabBuilder setRowStyles(Style headerStyle, Style totalStyle, Style totalHeaderStyle) {
    for (Iterator iterator = crosstab.getRows().iterator(); iterator.hasNext();) {
      DJCrosstabRow row = (DJCrosstabRow) iterator.next();
      row.setHeaderStyle(headerStyle);
      row.setTotalHeaderStyle(totalHeaderStyle);
      row.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.