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

Examples of ar.com.fdvs.dj.domain.entities.columns.PropertyColumn


    //Show the current value above the column name
    int yOffset = 0;
    GroupLayout layout = group.getLayout();
    //Only the value in heaeder
    PropertyColumn column = group.getColumnToGroupBy();

    //VALUE_IN_HEADER,
    //VALUE_IN_HEADER_WITH_HEADERS,
    //VALUE_IN_HEADER_AND_FOR_EACH,
    //VALUE_IN_HEADER_AND_FOR_EACH_WITH_HEADERS
    if (layout.isShowValueInHeader() && layout.isHideColumn() && !layout.isShowColumnName()){
      //textvield for the current value
      JRDesignTextField currentValue = generateTextFieldFromColumn(column, getReport().getOptions().getDetailHeight().intValue(), group);

      //The width will be all the page
      currentValue.setWidth(getReport().getOptions().getPrintableWidth());

      //fix the height depending on the font size
      currentValue.setHeight(FontHelper.getHeightFor(column.getStyle().getFont()));
      yOffset += currentValue.getHeight();

      //Move down exisiting elements in the band.
      moveBandsElemnts(yOffset-1, headerBand); //Dont know why, but without the "-1" it wont show the headers

      headerBand.addElement(currentValue);
    }
    //DEFAULT and DEFAULT_WITH_HEADER
    else if (layout.isShowValueInHeader() && !layout.isHideColumn() && !layout.isShowColumnName()){
      headerOffset = changeHeaderBandHeightForVariables(headerBand, group);
      insertValueInHeader(headerBand, group, headerOffset);
    }
    //VALUE_IN_HEADER_WITH_HEADERS_AND_COLUMN_NAME
    else if (layout.isShowValueInHeader() && layout.isHideColumn() && layout.isShowColumnName()){
      //Create the element for the column name
      JRDesignTextField columnNameTf = createColumnNameTextField(group, column);
      columnNameTf.setY(columnNameTf.getY() + headerOffset);

      //textvield for the current value
      JRDesignTextField currentValue = generateTextFieldFromColumn(column, getReport().getOptions().getDetailHeight().intValue(), group);

      //The width will be (width of the page) - (column name width)
      currentValue.setWidth(getReport().getOptions().getPrintableWidth() - columnNameTf.getWidth());
      //The x position for the current value is right next to the column name
      currentValue.setX(columnNameTf.getWidth());

      //fix the height depending on the font size
      currentValue.setHeight(FontHelper.getHeightFor(column.getStyle().getFont()));
      columnNameTf.setHeight(currentValue.getHeight());

      yOffset += currentValue.getHeight();

      //Move down exisiting elements in the band.
View Full Code Here


    }

    if (entity instanceof PropertyColumn) {
      try {
        //addField() will throw an exception only if the column has already been registered.
        PropertyColumn propertyColumn = ((PropertyColumn)entity);
        log.debug("registering column " + column.getName());
        if ( propertyColumn.getColumnProperty() != null && !(entity instanceof ExpressionColumn)){
          getDjd().addField((JRField)transformEntity(entity));
        }
        if (entity instanceof ExpressionColumn) {
          //The Custom Expression parameter must be registered
          ExpressionColumn expressionColumn = (ExpressionColumn) entity;
View Full Code Here

      }
    }
  }

  protected Object transformEntity(Entity entity) {
    PropertyColumn propertyColumn = (PropertyColumn) entity;
    JRDesignField field = new JRDesignField();
    ColumnProperty columnProperty = propertyColumn.getColumnProperty();
    field.setName(columnProperty.getProperty());
    field.setValueClassName(columnProperty
        .getValueClassName());
    log.debug("transforming column: " + columnProperty.getProperty() + " / " + columnProperty
        .getValueClassName());

    field.setDescription(propertyColumn.getFieldDescription()); //hack for XML data source
    Iterator iter = columnProperty.getFieldProperties().keySet().iterator();
    while (iter.hasNext()) {
      String key = (String) iter.next();
      field.getPropertiesMap().setProperty(key, (String) columnProperty.getFieldProperties().get(key));
    }
View Full Code Here

  public FastReportBuilder addGroups(int numgroups) {
    groupCount = numgroups;
    for (int i = 0; i < groupCount; i++) {
      GroupBuilder gb = new GroupBuilder();
      PropertyColumn col = (PropertyColumn) report.getColumns().get(i);
      gb.setCriteriaColumn(col);
      report.getColumnsGroups().add(gb.build());
    }
    return this;
  }
View Full Code Here

  public FastReportBuilder addGroups(int numgroups, GroupLayout gLayout) {
    groupCount = numgroups;
    for (int i = 0; i < groupCount; i++) {
      GroupBuilder gb = new GroupBuilder();
      PropertyColumn col = (PropertyColumn) report.getColumns().get(i);
      gb.setCriteriaColumn(col);
      gb.setGroupLayout(gLayout);
      report.getColumnsGroups().add(gb.build());
    }
    return this;
View Full Code Here

    group.setLayout(layout);
    return this;
  }

  public FastReportBuilder addGlobalHeaderVariable(int colNumber, DJCalculation op, Style style) {
    PropertyColumn column = (PropertyColumn) report.getColumns().get(colNumber -1);
//    if (this.globalHeaderVariables == null)
//      this.globalHeaderVariables = new ArrayList();
    if (style == null)
      style = numberStyle; //XXX Carefree style assignment
//    this.globalHeaderVariables.add(new DJGroupVariable(column, op, style));
View Full Code Here

    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);
View Full Code Here

   * @param op
   * @param style OPTIONAL, may be null
   * @return
   */
  public FastReportBuilder addGlobalFooterVariable(int colNumber, DJCalculation op, Style style) {
    PropertyColumn column = (PropertyColumn) report.getColumns().get(colNumber -1);

    if (style == null)
      style = numberStyle;

    this.globalVariablesGroup.addFooterVariable(new DJGroupVariable(column, op, style));
View Full Code Here

    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);
View Full Code Here

    return this;
  }

  public FastReportBuilder addFooterVariable(int groupNum, int colNumber, DJCalculation op, Style style, DJValueFormatter valueFormatter) 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, valueFormatter);
    group.getFooterVariables().add(columnsGroupVariable);
View Full Code Here

TOP

Related Classes of ar.com.fdvs.dj.domain.entities.columns.PropertyColumn

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.